You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(kubectl describe ingress joey shows both annotations)
Update the spec, e.g. to change the annotation to foo = "bar1"
terraform apply. Note that there is no mention of foo.kubernetes.io in the plan
kubectl describe ingress joey. The annotation is gone!
Expected Behavior
Terraform should not silently delete annotations that it ignores, and if it does they should be in the plan.
Actual Behavior
Terraform deleted those annotations.
Important Factoids
The Terraform k8s provider considers all annotations ending in .kubernetes.io to be internal (with a few exceptions), despite the fact that some services outside of k8s proper use annotations ending in .kubernetes.io. In my case, these are alb.ingress.kubernetes.io/* annotations, though there is also external DNS.
I believe the same issue would happen if my annotation were in the ignore_annotations provider-level parameter, though I haven't tested this.
References
I have opened issue #2666 about not ignoring kubernetes.io annotations by default at all.
Community Note
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
The text was updated successfully, but these errors were encountered:
Perhaps missing from my report is the fact that this does not apply to all k8s resource types. I tried reproducing this with a pod instead of an ingress and it didn't work. I assume that annotations are munged differently on the k8s backend.
Terraform Version, Provider Version and Kubernetes Version
Affected Resource(s)
kubernetes_ingress_v1
Terraform Configuration Files
Debug Output
https://gist.github.com/joey-squid/41b5be220ee543dc3c93541c058496b7
Panic Output
Steps to Reproduce
terraform apply
kubectl annotate ingress joey foo.kubernetes.io=bar
kubectl describe ingress joey
shows both annotations)foo = "bar1"
terraform apply
. Note that there is no mention offoo.kubernetes.io
in the plankubectl describe ingress joey
. The annotation is gone!Expected Behavior
Terraform should not silently delete annotations that it ignores, and if it does they should be in the plan.
Actual Behavior
Terraform deleted those annotations.
Important Factoids
The Terraform k8s provider considers all annotations ending in
.kubernetes.io
to be internal (with a few exceptions), despite the fact that some services outside of k8s proper use annotations ending in.kubernetes.io
. In my case, these arealb.ingress.kubernetes.io/*
annotations, though there is also external DNS.I believe the same issue would happen if my annotation were in the
ignore_annotations
provider-level parameter, though I haven't tested this.References
I have opened issue #2666 about not ignoring
kubernetes.io
annotations by default at all.Community Note
The text was updated successfully, but these errors were encountered: