我使用Confluent for Kubernetes在AKS上配置了Confluent Platform-快速入门版
概况
Confluent for Kubernetes(CFK)是一个云原生的控制平面,它可在私有云环境(本例中为Azure Kubernetes Service(AKS))上部署和管理Confluent。它提供了一个简单标准的接口,通过声明式API来定制、部署和管理Confluent Platform。
我根据这篇文章中的内容,使用CFK在AKS上构建了Confluent Platform,并进行了快速启动的尝试。
本地环境
-
- macOS Monterey 12.3.1
-
- python 3.8.12
-
- Azure CLI 2.34.1
-
- helm v3.6.3
- kubectl v1.21.3
事先准备
-
- 执行本文中的步骤后,确认已经成功建立了AKS集群环境。
执行本文中的步骤后,确认已经完成了在AKS上使用CFK配置和部署Confluent Platform的准备工作。请注意,命名空间需要设为confluent。
安装Confluent平台。
## すべての Confluent Platform コンポーネントをインストールします
$ kubectl apply -f https://raw.githubusercontent.com/confluentinc/confluent-kubernetes-examples/master/quickstart-deploy/confluent-platform.yaml
etes-examples/master/quickstart-deploy/confluent-platform.yaml
zookeeper.platform.confluent.io/zookeeper created
kafka.platform.confluent.io/kafka created
connect.platform.confluent.io/connect created
ksqldb.platform.confluent.io/ksqldb created
controlcenter.platform.confluent.io/controlcenter created
schemaregistry.platform.confluent.io/schemaregistry created
kafkarestproxy.platform.confluent.io/kafkarestproxy created
## サンプルプロデューサーアプリとトピックをインストールします
$ kubechave tl apply -f https://raw.githubusercontent.com/confluentinc/confluent-kubernetes-examples/master/quickstart-deploy/producer-app-data.yaml
secret/kafka-client-config created
statefulset.apps/elastic created
service/elastic created
kafkatopic.platform.confluent.io/elastic-0 created
安装后的确认
## Pod の確認
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
confluent-operator-64c5c5756d-wcn79 1/1 Running 0 3h33m
connect-0 1/1 Running 2 (3h26m ago) 3h32m
controlcenter-0 1/1 Running 0 3h26m
elastic-0 1/1 Running 3 (3h29m ago) 3h31m
kafka-0 1/1 Running 0 3h29m
kafka-1 1/1 Running 0 3h29m
kafka-2 1/1 Running 0 3h29m
kafkarestproxy-0 1/1 Running 0 3h26m
ksqldb-0 1/1 Running 0 3h26m
schemaregistry-0 1/1 Running 0 3h26m
schemaregistry-1 1/1 Running 0 3h26m
schemaregistry-2 1/1 Running 0 3h26m
zookeeper-0 1/1 Running 0 3h32m
zookeeper-1 1/1 Running 0 3h32m
zookeeper-2 1/1 Running 0 3h32m
## 起動サービスの確認
$ kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
confluent-operator ClusterIP 10.1.0.49 <none> 7778/TCP 3h33m
connect ClusterIP None <none> 8083/TCP,7203/TCP,7777/TCP,7778/TCP 3h33m
connect-0-internal ClusterIP 10.1.0.108 <none> 8083/TCP,7203/TCP,7777/TCP,7778/TCP 3h33m
controlcenter ClusterIP None <none> 9021/TCP,7203/TCP,7777/TCP,7778/TCP 3h27m
controlcenter-0-internal ClusterIP 10.1.0.15 <none> 9021/TCP,7203/TCP,7777/TCP,7778/TCP 3h27m
elastic ClusterIP None <none> <none> 3h32m
kafka ClusterIP None <none> 9092/TCP,8090/TCP,9071/TCP,7203/TCP,7777/TCP,7778/TCP,9072/TCP 3h30m
kafka-0-internal ClusterIP 10.1.0.34 <none> 9092/TCP,8090/TCP,9071/TCP,7203/TCP,7777/TCP,7778/TCP,9072/TCP 3h30m
kafka-1-internal ClusterIP 10.1.0.172 <none> 9092/TCP,8090/TCP,9071/TCP,7203/TCP,7777/TCP,7778/TCP,9072/TCP 3h30m
kafka-2-internal ClusterIP 10.1.0.235 <none> 9092/TCP,8090/TCP,9071/TCP,7203/TCP,7777/TCP,7778/TCP,9072/TCP 3h30m
kafkarestproxy ClusterIP None <none> 8082/TCP,7203/TCP,7777/TCP,7778/TCP 3h27m
kafkarestproxy-0-internal ClusterIP 10.1.0.115 <none> 8082/TCP,7203/TCP,7777/TCP,7778/TCP 3h27m
ksqldb ClusterIP None <none> 8088/TCP,7203/TCP,7777/TCP,7778/TCP 3h27m
ksqldb-0-internal ClusterIP 10.1.0.175 <none> 8088/TCP,7203/TCP,7777/TCP,7778/TCP 3h27m
schemaregistry ClusterIP None <none> 8081/TCP,7203/TCP,7777/TCP,7778/TCP 3h27m
schemaregistry-0-internal ClusterIP 10.1.0.14 <none> 8081/TCP,7203/TCP,7777/TCP,7778/TCP 3h27m
schemaregistry-1-internal ClusterIP 10.1.0.28 <none> 8081/TCP,7203/TCP,7777/TCP,7778/TCP 3h27m
schemaregistry-2-internal ClusterIP 10.1.0.127 <none> 8081/TCP,7203/TCP,7777/TCP,7778/TCP 3h27m
zookeeper ClusterIP None <none> 2181/TCP,7203/TCP,7777/TCP,3888/TCP,2888/TCP,7778/TCP 3h33m
zookeeper-0-internal ClusterIP 10.1.0.171 <none> 2181/TCP,7203/TCP,7777/TCP,3888/TCP,2888/TCP,7778/TCP 3h33m
zookeeper-1-internal ClusterIP 10.1.0.113 <none> 2181/TCP,7203/TCP,7777/TCP,3888/TCP,2888/TCP,7778/TCP 3h33m
zookeeper-2-internal ClusterIP 10.1.0.33 <none> 2181/TCP,7203/TCP,7777/TCP,3888/TCP,2888/TCP,7778/TCP 3h33m
## Confluent Platform のバージョンを確認します
$ kubectl confluent version
COMPONENT NAME VERSION OPERATOR-VERSION
Zookeeper zookeeper 7.1.0 v0.435.23
Kafka kafka 7.1.0 v0.435.23
Connect connect 7.1.0 v0.435.23
SchemaRegistry schemaregistry 7.1.0 v0.435.23
KsqlDB ksqldb 7.1.0 v0.435.23
ControlCenter controlcenter 7.1.0 v0.435.23
打开 Confluent 控制中心
$ kubectl confluent dashboard controlcenter
http://localhost:9021
善後處理
Pod / namespace 的卸载方法
## Pod : confluent-operator
$ helm delete confluent-operator
## Pod : confluent-platform
$ kubectl delete -f https://raw.githubusercontent.com/confluentinc/confluent-kubernetes-examples/master/quickstart-deploy/confluent-platform.yaml
## Pod : producer-app-data
$ kubectl delete -f https://raw.githubusercontent.com/confluentinc/confluent-kubernetes-examples/master/quickstart-deploy/producer-app-data.yaml
## namespace の削除方法(namespace配下のPodも全て削除される)
$ kubectl delete namespace confluent
停止和启动AKS集群。
$ az aks stop -g rg_ituru_aks01 -n aks_ituru_cp01
$ az aks start -g rg_ituru_aks01 -n aks_ituru_cp01
The requested phrase in Chinese can be translated as:
总结 jié)
我已经使用CFK在AKS上构建了Confluent Platform的快速入门指南。
请提供相关信息
我参考了以下信息。
引入 Confluent for Kubernetes
Confluent for Kubernetes 简介
Confluent for Kubernetes 快速入门