strimzi-kafka-operator: The CustomResourceDefinition "kafkas.kafka.strimzi.io" is invalid: metadata.annotations: Too long: must have at most 262144 bytes

With the new 0.22.0 release I am getting this error:

The CustomResourceDefinition "kafkas.kafka.strimzi.io" is invalid: metadata.annotations: Too long: must have at most 262144 bytes

When doing:

  ##strimzi_version=$(curl https://github.com/strimzi/strimzi-kafka-operator/releases/latest |  awk -F 'tag/' '{print $2}' | awk -F '"' '{print $1}' 2>/dev/null)
  oc create namespace kafka
  oc -n kafka apply --selector strimzi.io/crd-install=true -f "https://github.com/strimzi/strimzi-kafka-operator/releases/download/${strimzi_version}/strimzi-cluster-operator-${strimzi_version}.yaml"
  curl -L "https://github.com/strimzi/strimzi-kafka-operator/releases/download/${strimzi_version}/strimzi-cluster-operator-${strimzi_version}.yaml" \
  | sed 's/namespace: .*/namespace: kafka/' \
  | oc -n kafka apply -f -

Version 0.21.1 works

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 20 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Yeah, I have the same problem. kubectl apply will work again in 0.23 after we removed the older APIs.

Yeah, this is not a bug in Strimzi. kubectl apply adds the original resource to annotations and annotations have limited size. So it cannot handle the Kafka CRD which is too big (because of the migration to v1beta2 which is needed because of the migration to CRD v1). You have to use kubectl create / kubectl replace.

This is somewhat of a blocker for us argocd/kustomize users… Any chance we can trim down the size of the kafkas.kafka.strimzi.io CRD?

use create/replace instead of apply