“在版本” kafka.strimzi.io/v1alpha1“中没有与种类” Kafka“相匹配的”

时间:2019-03-21 02:55:36

标签: strimzi

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

复制步骤:

1)安装olm:

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

2)安装strimzi-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”类型不匹配

有什么建议吗?谢谢。

1 个答案:

答案 0 :(得分: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