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
Provisioner created with FluxCD or with kubectl but with removed last-applied-configuration annotation is randomly showing diffs for kubectl diff due to constantly changing order of list items in requirements. (diff result provided below)
I suspect that webhook is somehow changing order of list items on validation, but since I have no experience with webhooks development I wasn't able to trace the issue further. Happy to provide any additional information if needed.
Steps to Reproduce the Problem
create provisioner test with kubectl apply -f test.yaml
run kubectl edit provisioner test and remove annotation kubectl.kubernetes.io/last-applied-configuration
run kubectl diff -f test.yaml multiple times
random diff is shown, sometimes no changes (provided below)
now kubectl diff shows no diffs at all as expected.
Same issue when deploying provisioners with FluxCD: since Flux does not add last-applied-configuration annotation, it always updates provisioners on reconciliation, in my case every 15 min, resulting in multiple notifications. (I've first created an issue in Flux repo but was able to trace it to webhook)
UPD: traced it specifically to MutatingWebhookConfiguration defaulting.webhook.provisioners.karpenter.sh: removing other webhooks still produced diffs, only stopped after removing this one.
Version
Karpenter: v0.9.0
Kubernetes: v1.22.6-eks-7d68063
Expected Behavior
No diffs for provisoner's server-side apply.
Actual Behavior
Provisioner created with FluxCD or with kubectl but with removed last-applied-configuration annotation is randomly showing diffs for
kubectl diff
due to constantly changing order of list items inrequirements
. (diff result provided below)I suspect that webhook is somehow changing order of list items on validation, but since I have no experience with webhooks development I wasn't able to trace the issue further. Happy to provide any additional information if needed.
Steps to Reproduce the Problem
test
withkubectl apply -f test.yaml
kubectl edit provisioner test
and remove annotationkubectl.kubernetes.io/last-applied-configuration
kubectl diff -f test.yaml
multiple timeskubectl delete MutatingWebhookConfiguration defaulting.webhook.provisioners.karpenter.sh && kubectl delete ValidatingWebhookConfiguration validation.webhook.provisioners.karpenter.sh && kubectl delete ValidatingWebhookConfiguration validation.webhook.config.karpenter.sh
kubectl diff
shows no diffs at all as expected.Same issue when deploying provisioners with FluxCD: since Flux does not add last-applied-configuration annotation, it always updates provisioners on reconciliation, in my case every 15 min, resulting in multiple notifications. (I've first created an issue in Flux repo but was able to trace it to webhook)
Resource Specs and Logs
Provisioner manifest
kubectl diff results
➜ kubectl diff -f test-flux.yaml diff -u -N /var/folders/1w/c8g5cv1n05n47_0mms4ws5fm0000gn/T/LIVE-4237038111/karpenter.sh.v1alpha5.Provisioner..test-flux /var/folders/1w/c8g5cv1n05n47_0mms4ws5fm0000gn/T/MERGED-1128983386/karpenter.sh.v1alpha5.Provisioner..test-flux --- /var/folders/1w/c8g5cv1n05n47_0mms4ws5fm0000gn/T/LIVE-4237038111/karpenter.sh.v1alpha5.Provisioner..test-flux 2022-04-27 15:37:04.000000000 +0300 +++ /var/folders/1w/c8g5cv1n05n47_0mms4ws5fm0000gn/T/MERGED-1128983386/karpenter.sh.v1alpha5.Provisioner..test-flux 2022-04-27 15:37:04.000000000 +0300 @@ -2,7 +2,7 @@ kind: Provisioner metadata: creationTimestamp: "2022-04-27T11:36:07Z" - generation: 1 + generation: 2 labels: kustomize.toolkit.fluxcd.io/name: karpenter-provisioner kustomize.toolkit.fluxcd.io/namespace: flux-system @@ -45,22 +45,22 @@ subnetSelector: karpenter.sh/discovery: development requirements: + - key: node.kubernetes.io/instance-type + operator: In + values: + - t3.small + - t3.medium + - t3.large - key: kubernetes.io/arch operator: In values: - - amd64 - arm64 + - amd64 - key: karpenter.sh/capacity-type operator: In values: - on-demand - spot - - key: node.kubernetes.io/instance-type - operator: In - values: - - t3.small - - t3.medium - - t3.large taints: - effect: NoSchedule key: dedicated
Webhook logs when no diff is shown
webhook logs when diff IS shown
The text was updated successfully, but these errors were encountered: