在kubernetes上创建Strimzi集群

时间:2020-04-12 02:52:37

标签: kubernetes openshift strimzi

我跟随下面的链接在k8s中创建strimzi集群算子

https://medium.com/@sincysebastian/setup-kafka-with-debezium-using-strimzi-in-kubernetes-efd494642585

下载了strimzi 0.17.0版本并解压缩。我跑了 Kubectl apply -f apply install / cluster-operator。 我收到错误消息“检测版本失败”,并且套接字连接超时。

为解决此问题,我在cluster-operator conf文件中添加了STRIMZI_KUBERNETES_VERSION。 现在,我收到“ routes.openshift.io/ API检测失败。API将被禁用”。

我认为这是网络政策问题,并添加为允许所有端口。得到同样的错误。 ... 出口: -{} 入口: -{}

任何人都可以帮我解决我在这里缺少的内容,以及如何在k8s中使用debezuim使它更加醒目。

谢谢。

2 个答案:

答案 0 :(得分:1)

我不确定自己遇到的错误,但是使用Helm安装Strimzi很轻松,我从未遇到任何安装崩溃:

以下是针对Kafka应用程序:

helm install strimzi/strimzi-kafka-operator \
--name my-strimzi-release \
--namespace strimzi \
--version 0.15.0

答案 1 :(得分:0)

这实际上很简单。

您可以使用Minikube作为测试环境来运行以下命令:

$ NAMESPACE="kafka"
$ STRIMZI_VER="0.20.0"

# create a new namespace
$ kubectl create namespace $NAMESPACE && kubectl config set-context --current --namespace=$NAMESPACE

# deploy Strimzi operator
$ curl -L https://github.com/strimzi/strimzi-kafka-operator/releases/download/$STRIMZI_VER/strimzi-cluster-operator-$STRIMZI_VER.yaml \
    | sed "s/namespace: .*/namespace: $NAMESPACE/g" | kubectl apply -f -

# deploy Kafka cluster
$ kubectl apply -f https://raw.githubusercontent.com/strimzi/strimzi-kafka-operator/release-${STRIMZI_VER/%.0/.x}/examples/kafka/kafka-persistent.yaml

最终结果应如下所示:

$ kubectl get pods
NAME                                          READY   STATUS    RESTARTS   AGE
my-cluster-entity-operator-574bcbc568-5mr4w   3/3     Running   0          33s
my-cluster-kafka-0                            1/1     Running   0          72s
my-cluster-kafka-1                            1/1     Running   0          72s
my-cluster-kafka-2                            1/1     Running   0          72s
my-cluster-zookeeper-0                        1/1     Running   0          108s
my-cluster-zookeeper-1                        1/1     Running   0          108s
my-cluster-zookeeper-2                        1/1     Running   0          108s
strimzi-cluster-operator-54ff55979f-msqq4     1/1     Running   0          2m48s