kubernetes / kubernetes

Production-Grade Container Scheduling and Management
https://kubernetes.io
Apache License 2.0
111.01k stars 39.64k forks source link

kubectl apply fails because "invalid: metadata.annotations: Too long: must have at most 262144 bytes" #100572

Closed nyarly closed 3 years ago

nyarly commented 3 years ago

What happened:

I'm attempting to incorporate Strimzi into our cluster configuration. Our process is GitOps style: specifically, we build a declarative configuration in code, and then kubectl apply the whole thing. I got the error referenced here: https://github.com/strimzi/strimzi-kafka-operator/issues/4589

The Strimzi project's solution is to use kubectl create for the one CRD, which would be reasonable if I was catering to a single cluster.

What you expected to happen:

kubectl apply to succeed.

How to reproduce it (as minimally and precisely as possible):

Pull down the Strimzi 0.22.1 Kafkas CRD, and attempt to apply it.

Anything else we need to know?:

This is a general limit on the size of any Kubernetes resource for apply. I understand in passing it has to do with the way in which apply annotates the resource with its own previous applied state interacting with etcd limits. It seems like this is a bug in Kubernetes, however, since it expects something from its datastore that isn't available.

Environment:

nyarly commented 3 years ago

/sig api-machinery /sig cli

pacoxu commented 3 years ago

It should be similar to https://github.com/kubernetes/kubectl/issues/712.

kubectl apply will add that annotation and the annotation has a length limitation for etcd limitation.

liggitt commented 3 years ago

This is a duplicate of https://github.com/kubernetes/kubernetes/issues/82292

fedebongio commented 3 years ago

/triage accepted