Author: LI Yu
Let's demonstrate the installation of KAFKA cluster in K8S cluster. The premise is still that the K8S cluster described above has been installed and the conditions for CEPH storage are available.
Some common warehouses
helm repo add stable http://mirror.azure.cn/kubernetes/charts
helm repo add aliyun https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
helm repo add aliyuncs https://apphub.aliyuncs.com
helm repo update
To add warehouses, we use Alibaba Cloud because of the wall being walled abroad.
helm repo add aliyuncs https://apphub.aliyuncs.com helm search repo kafka NAME CHART VERSION APP VERSION DESCRIPTION aliyuncs/kafka 7.2.2 2.4.0 Apache Kafka is a distributed streaming platform. helm pull aliyuncs/kafka [root@adm-master kafka]# tree . ├── Chart.lock ├── charts │ └── zookeeper │ ├── Chart.yaml │ ├── README.md │ ├── templates │ │ ├── configmap.yaml │ │ ├── _helpers.tpl │ │ ├── metrics-deployment.yaml │ │ ├── metrics-svc.yaml │ │ ├── NOTES.txt ├── ├── poddisruptionbudget.yaml ├── ├── ├── ├── NOTES.txt ├── ├── am secrets.yaml ├── ├── ic serviceaccount.yaml ├── ├── ic servicemonitor.yaml ├── ├── statefulset.yaml ├── ├── svc-headless.yaml └── └── c. svc.yaml ├── values-production.yaml └── └── values.yaml ├── Chart.yaml ├── README.md ├── requirements.lock ├── requirements.yaml ├── templates ├── configmap. yaml ├── ├── _helpers.tpl │ ├── jmx-configmap.yaml ├── ├── kafka-exporter.yaml ├── ├── kafka-jmx-metrics-svc.yaml ├── ├── kafka-metrics-svc.yaml Enter poddisruptionbudget.yaml Enter scripts-configmap.yaml │ ├── secrets.yaml │ ├── serviceaccount.yaml │ ├── servicemonitor-jmx-metrics.yaml │ ├── servicemonitor-metrics.yaml │ ├── statefulset.yaml │ ├── svc-external-access.yaml │ ├── svc-headless.yaml │ └── svc.yaml ├── values-production.yaml └── values.yaml 4 directories, 40 files 把 values-production.yaml values.yaml 的storageClass改成k8s-rbd 一共4个文件,都要改。 helm install kafka . -f ./values.yaml [root@adm-master kafka]# kubectl get pods,svc NAME READY STATUS RESTARTS AGE pod/kafka-0 1/1 Running 0 113m pod/kafka-1 1/1 Running 0 57s pod/kafka-2 1/1 Running 0 57s pod/kafka-zookeeper-0 1/1 Running 0 87m pod/kafka-zookeeper-1 1/1 Running 0 13s pod/kafka-zookeeper-2 0/1 Running 0 13s pod/rbd-provisioner-c968dcb4b-wbhlc 1/1 Running 0 109m NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/kafka ClusterIP 10.1.162.141 <none> 9092/TCP 23h service/kafka-headless ClusterIP None <none> 9092/TCP 23h service/kafka-zookeeper ClusterIP 10.1.135.217 <none> 2181/TCP,2888/TCP,3888/TCP 23h service/kafka-zookeeper-headless ClusterIP None <none> 2181/TCP,2888/TCP,3888/TCP 23h service/kubernetes ClusterIP 10.1.0.1 <none> 443/TCP 230d
The installation is complete.