The Fluvio CLI (command-line interface) is an all-in-one tool for setting up, interacting, and managing with Fluvio clusters.
Install the Fluvio CLI by running the following command:
curl -fsS https://packages.fluvio.io/v1/install.sh | bash
If you have kubectl
, helm
, and kind
already set up, then continue to steps for [running a local Fluvio cluster].
Kind is a tool for running a local Kubernetes cluster.
Install kind
package:
$ brew install kind
To configure kind cluster creation, you will need to create a YAML config file. This file follows Kubernetes conventions for versioning etc.
Create a file named: config.yaml
with the following content:
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
# port forward 80 on the host to 80 on this node
extraPortMappings:
- containerPort: 30003 #sc
hostPort: 30003
protocol: TCP
- containerPort: 30004 #spu 1
hostPort: 30004
protocol: TCP
- containerPort: 30005 #spu 2
hostPort: 30005
protocol: TCP
- containerPort: 30006 #spu 3
hostPort: 30006
protocol: TCP
Start a Kubernetes cluster locally with by running the following in a terminal window:
$ kind create cluster --config k8-util/cluster/kind.yaml
kubectl
is the Kubernetes command-line tool. It is used to run commands against Kubernetes clusters.
Install kubectl
with the [Brew Package Manager] by running the following in a terminal window:
$ brew install kubectl
Or follow the instructions at the kubectl installation page and follow the instructions to download and install kubectl
on MacOS.
Helm is the package manager for Kubernetes.
Install helm
with the [Brew Package Manager] by running the following in a terminal window:
$ brew install helm
Or follow the instructions at the helm installation page and follow the instructions to download and install helm
on MacOS.
You can start a Fluvio cluster by running following command:
$ fluvio cluster start --proxy-addr 127.0.0.1
📝 Running pre-flight checks
✅ Kubernetes config is loadable
✅ Supported helm version is installed
✅ Fluvio system charts are installed
✅ Previous fluvio installation not found
🛠️ Installing Fluvio
✅ Fluvio app chart has been installed
🔎 Found SC service addr: 127.0.0.1:31003
-
👤 Profile set
🤖 SPU group launched (1)
✅ All SPUs confirmed
🎯 Successfully installed Fluvio!
We can check the fluvio cluster by checking version and status with the following command:
$ fluvio version
fluvio version
Fluvio CLI : 0.9.13
Fluvio CLI SHA256 : de53060048aa7a10def4940741e25c8ddefdcdc3ef511562ec915bdb456e1770
Fluvio Platform : 0.9.13 (kind-kind)
Git Commit : 88b0d793f3143af3eb0c57bda3bc3b4cf44fd741
OS Details : Darwin 10.16 (kernel 21.1.0)
=== Plugin Versions ===
Fluvio Runner (fluvio-run) : 0.0.0
Infinyon Cloud CLI (fluvio-cloud) : 0.1.6
Congratulations, you’ve successfully installed Fluvio on your local machine!
Let’s use the Fluvio CLI to play with some basic functionality.
The first thing we need to do is create a topic.
$ fluvio topic create greetings
topic "greetings" created
Now that we have a topic, we can produce some messages!
Use the following command to send a message to the greetings
topic:
$ echo "Hello, Fluvio" | fluvio produce greetings
Finally, we can consume messages back from the topic
$ fluvio consume greetings -B -d
Consuming records from the beginning of topic 'greetings'
Hello, Fluvio
Way to go! You’re well on your way to writing real-time distributed apps with Fluvio!
Next, check out our Tutorials page to see real-world examples of Fluvio in action.
If you run into any problems along the way, make sure to check out our troubleshooting page to find a fix.