2

尝试通过 Strimzi Operator 安装 Kafka 集群时遇到以下错误

重现步骤:

1)安装olm:

kubectl create -f https://raw.githubusercontent.com/operator-framework/operator-lifecycle-manager/master/deploy/upstream/quickstart/olm.yaml

2)安装srimzi-cluster-operator:

kubectl create -f https://operatorhub.io/install/strimzi-cluster-operator.v0.11.1.yaml

3)安装kafka-cluster(见https://operatorhub.io/operator/strimzi-cluster-operator.v0.11.1#,在“自定义资源定义,寻找Kafka)

kubectl create -f kafka-cluster.yaml

,其中 kafka-cluster.yaml 的内容为:

apiVersion: kafka.strimzi.io/v1alpha1
kind: Kafka
metadata:
  name: my-cluster
spec:
  kafka:
    version: 2.1.0
    replicas: 3
    listeners:
      plain: {}
      tls: {}
    config:
      offsets.topic.replication.factor: 3
      transaction.state.log.replication.factor: 3
      transaction.state.log.min.isr: 2
    storage:
      type: ephemeral
  zookeeper:
    replicas: 3
    storage:
      type: ephemeral
  entityOperator:
    topicOperator: {}
    userOperator: {}

第 3 步失败并出现以下错误:

错误:无法识别“kafka-cluster.yaml”:版本“kafka.strimzi.io/v1alpha1”中的种类“Kafka”没有匹配项

有什么建议吗?谢谢。

4

1 回答 1

0

好吧,看起来我只需要等待几分钟才能运行第三个命令,即使所有相关的 pod 在发出第二个命令后都处于运行状态。(我认为下载 kafka 图像需要一些时间。)它工作正常。

NAME                                          READY   STATUS    RESTARTS   AGE
my-cluster-entity-operator-66fbf6bc5d-wqc96   1/3     Running   0          119s
my-cluster-kafka-0                            2/2     Running   0          2m46s
my-cluster-kafka-1                            2/2     Running   0          2m46s
my-cluster-kafka-2                            2/2     Running   0          2m46s
my-cluster-zookeeper-0                        2/2     Running   0          3m31s
my-cluster-zookeeper-1                        2/2     Running   0          3m31s
my-cluster-zookeeper-2                        2/2     Running   0          3m31s
于 2019-03-21T03:01:24.323 回答