Published on

Kubernetes/kubectl Ignores Annotation Changes


Today we were busy trying to configure an Nginx ingress for Kubernetes. We added a bunch of annotations and ran:

kubectl apply -f someIngress.yml

This applied the changes to the cluster. We started trying to tweak the annotations in the ingress but kept getting a message similar to: no change or unchanged. This was despite the fact that we definitely had commented out an annotation that was there.

We did a kubectl get ingress someIngress -o yaml and we could see that the annotation we had commented out was not there. We uncommented the annotation and did a get on the ingress again. The output was exactly the same as before for the annotation section despite adding a new annotation!

It turns out the ingress we were using is very finicky where annotation values all have to be in quotes " even booleans and numbers. As soon as we put our boolean and number annotation values in quotes and applied the change we saw our changes reflect on the server: ingress "someIngress" configured.