qbec
qbec copied to clipboard
Add option to dispay qbec.io/component and qbec.io/last-applied in show
When using qbec with argocd it alows to only generate YAML but do not apply, so qbec show is used to generate YAML.
But once qbec apply used locally then qbec will show wrong state even if it is updated by argo to actual one.
To avoid such problems we need an opportunity to display qbec.io/component and qbec.io/last-applied annotations for qbec show command.
More details about qbec and argocd integration read in my article: https://itnext.io/configure-custom-tooling-in-argo-cd-a4948d95626e
how does Argo CD maintain previous state? I'm wondering if you'll have the reverse problem with Argo CD using wrong last applied configuration even if qbec supports the feature above
This is a good question, Argo CD is fully rely on state described in Git. Even small difference in resources definition in Git and Kubernetes applied manifests causes OutOfSync error, eg. if you have:
resources:
requests:
cpu: 100m
Kubernetes will replace it to:
resources:
requests:
cpu: 0.1
As about applying, Argo CD uses few phases, on the early phases it invokes helm template or qbec show to generate the manifests from the Git, and the last phase invokes somewhat like kubectl apply. I can tell by the presence having kubectl.kubernetes.io/last-applied-configuration annotation in on the applied manifests.