-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use last-applied-configuration #10
Comments
@sagikazarmark .. I'm hitting major issues making use of this provider due to the above. Unfortunately, during the course of testing I have to live edit many objects and expected the provider to detect and re-apply the configs when run. That does not happen. Hoping we can get a quick fix please, since detecting config drift, is a core feature of terraform. Thanks a lot for this provider |
Thanks .. I guess I'm a little worried if you try to diff on your own, that the diffing would break from the many fields which are added dynamically by kubernetes (like, selflink, revision, last-applied-configuration ...etc). Not sure if there's a smart way to ignore those and only diff the "important" fields. Actually, just diffing against last-applied-configuration, was my way of only diffing those important fields. I also know that recent version of kubernetes offer "server side diff", which might be something we want to use. But overall, I'm Ok with anything that works PS: One last question, I'm a little confused if today, the provider is able to detect manual changes to kubernetes and reapply the yaml files, or not ? Does that functionality exist today, even if it's blindly reapplies ? Thanks |
We wrote a library for diffing k8s objects: https://github.com/banzaicloud/k8s-objectmatcher The plan is to use it in this provider as well. |
Is your feature request related to a problem? Please describe.
Yes, when applying any manifest (say HPA). Then changing it live
kubectl edit hpa foo
. Then usingterraform apply
, it should but does NOT detect that the object has changed outside its controlDescribe the solution you'd like to see
Kubernetes tracks the last applied configuration in
kubectl.kubernetes.io/last-applied-configuration
.. This provider after creating a resource, should parse out that field and store it in TF state. Every time the state is refreshed, it should be refreshed. In case, there is a difference between 2 runs, the update method should be called and the yaml files reappliedDescribe alternatives you've considered
resourceVersion
numberskubectl diff -f
to detect any driftThe text was updated successfully, but these errors were encountered: