kuiper
by EMQX
A lightweight IoT edge analytic software
About this chart
Kuiper can be deployed at k3s/k8s cluster through Helm chart. Below takes k3s as an example for demonstrating how to deploy at k3s.
Prepare
-
Install K3S
$ curl -sfL https://get.k3s.io | sh - $ sudo chmod 755 /etc/rancher/k3s/k3s.yaml $ kubectl get nodes NAME STATUS ROLES AGE VERSION ip-172-31-16-120 Ready master 4m31s v1.16.3-k3s.2 -
Install helm3
$ curl -sfL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash - Downloading https://get.helm.sh/helm-v3.0.1-linux-amd64.tar.gz Preparing to install helm into /usr/local/bin helm installed into /usr/local/bin/helm ## K8S can skip this step $ export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
Get Kuiper Helm Chart
-
With any approaches in below to get Kuiper Helm Chart, here uses
git cloneto get Helm chart.-
Git clone
$ git clone https://github.com/emqx/kuiper $ cd kuiper/deploy/chart/kuiper -
Helm repo (TODO)
-
Add Helm repo
$ helm repo add emqx https://repos.emqx.io/charts -
Search Kuiper
helm search kuiper NAME CHART VERSION APP VERSION DESCRIPTION emqx/kuiper 0.0.3 0.0.3 A lightweight IoT edge analytic software
-
-
-
By edit
values.yamlfile or use commandhelm install --setto editKuiper Helm Chartconfigurations.Kuiper Helm Chart Configurations
Parameters Descriptions Default Value replicaCountDeployed Kuiper instance number 1 image.repositoryDocker image name emqx/kuiper image.pullPolicyPull policy IfNotPresent service.typeKubernetes Service type. ClusterIP service.kuiperPort for Kuiper. 20498 service.restapiPort for ReseApi. 9081 service.nodePorts.kuiperKubernetes node port for Kuiper. nil service.nodePorts.restapiKubernetes node port for RestAPi. nil service.loadBalancerIPloadBalancerIP for Service nil service.loadBalancerSourceRangesAddress(es) that are allowed when service is LoadBalancer [] service.annotationsService annotations {}(evaluated as a template) persistence.enabledEnable PVC false persistence.storageClassStorage class name nilpersistence.existingClaimPV name "" persistence.accessModePVC access mode ReadWriteOnce persistence.sizePVC size 20Mi resourcesCPU/Memory {} nodeSelectorNode selector {} tolerationsTolerations [] affinityAffinity {} kuiperConfigConfiguration file in the Kuiper etcdirectory
Deploy Kuiper through Helm
Deploy Kuiper quickly
-
Deploy Kuiper through Helm
$ helm install my-kuiper . NAME: my-kuiper LAST DEPLOYED: Mon Dec 9 09:56:32 2019 NAMESPACE: default STATUS: deployed REVISION: 1 TEST SUITE: None -
Deployment is successful
$ kubectl get pods NAME READY STATUS RESTARTS AGE my-kuiper-0 1/1 Running 0 19s $ kubectl exec -it my-kuiper-0 sh /kuiper # ./bin/cli Connecting to 127.0.0.1:20498...
Deploy persisted Kuiper
-
Kuiper realized persisted
podsthrough creating PVC resources and mount/kuiper/datadirectory. Before deploying Kuiper, user need to create PVC or Storage Classes resource in Kubernetes. -
Open and edit
values.yamlfile, setpersistence.enabled=true- If user deploys PVC resource, , then set
persistence.existingClaim=your_pv_name - If user deploys Storage Classes resource, then set
persistence.storageClass=your_storageClass_name
- If user deploys PVC resource, , then set
-
Deploy Kuiper through Helm
$ helm install my-kuiper . NAME: my-kuiper LAST DEPLOYED: Mon Dec 9 09:56:32 2019 NAMESPACE: default STATUS: deployed REVISION: 1 TEST SUITE: None -
Deployment is successful
$ kubectl get pods NAME READY STATUS RESTARTS AGE my-kuiper-0 1/1 Running 0 19s $ kubectl exec -it my-kuiper-0 sh /kuiper # ./bin/cli Connecting to 127.0.0.1:20498...
Deploy Kuiper and using SSL certification and key
-
Use command
kubectl create secret, create certification & private keys toSecret resources, the usage of commandkubectl create secretis listed as in below:$ kubectl create secret generic your-secret-name --from-file=/path/to/fileCreate Secret resource for certification file:
$ kubectl create secret generic client-cert --from-file=certs/client-cert.pemCreate Secret for private key file:
$ kubectl create secret generic client-key --from-file=certs/client-key.pemReview Secret resources
$ kubectl get secret NAME TYPE DATA AGE client-cert Opaque 1 25m client-key Opaque 1 24m -
Open and edit
values.yamlfile$ vim value.yaml kuiperConfig: ... "mqtt_source.yaml": #Global MQTT configurations default: qos: 1 sharedSubscription: true servers: [tcp://127.0.0.1:1883] concurrency: 1 #username: user1 #password: password certificationSecretName: client-cert # Set certification Secret resource name certificationPath: /var/kuiper/certificate.pem # Set certification file path privateKeySecretName: client-key # Set private key Secret resource name privateKeyPath: /var/kuiper/xyz-private.pem.key # Set private key file path ... -
Deploy Kuiper through Helm
$ helm install my-kuiper . NAME: my-kuiper LAST DEPLOYED: Mon Dec 9 09:56:32 2019 NAMESPACE: default STATUS: deployed REVISION: 1 TEST SUITE: None -
Deployment is successful
$ kubectl get pods NAME READY STATUS RESTARTS AGE my-kuiper-0 1/1 Running 0 19s $ kubectl exec -it my-kuiper-0 -- ls -al /var/kuiper total 8 drwxr-xr-x 4 root root 4096 Dec 10 02:23 . drwxr-xr-x 1 root root 4096 Dec 10 02:23 .. drwxrwxrwt 3 root root 100 Dec 10 02:23 certificate.pem drwxrwxrwt 3 root root 100 Dec 10 02:23 private.pem.key $ kubectl exec -it my-kuiper-0 sh /kuiper # ./bin/cli Connecting to 127.0.0.1:20498...
Deploy kuiper with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has kuiper on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartkuiper is pinned at v0.9.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply