-
I stopped and then started my k8s cluster. My pods started initializing long before the hook. As a result there were no AZURE_xxx environment variables in play and all my pods failed. After running kubectl delete and kubectl apply on each pod everything was working again. How can I make my deployment wait for the hook to initialize, or encourage the hook to redeploy my pods? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
Note: we are going to make the above changes default in the upcoming |
Beta Was this translation helpful? Give feedback.
-
I think I have the same issue, and resolve it by "restarting" the pods - by setting the workload replicas to 0, then back to a positive number. ie: |
Beta Was this translation helpful? Give feedback.
-
@aramase you wrote "3. Add a labelSelector in the mutating webhook configuration to only mutate pods with the "azure.workload.identity/use": "true" label." I've configured AKS to use Workload Identity following MSLearn Docs Deploy and configure cluster, ie: I am assuming From that starting point, how would I implement step 3? ie:
What would the labelSelector be and where does it go in the MutatingWebhookConfiguration ? ie:
|
Beta Was this translation helpful? Give feedback.
@9Rune5
failurePolicy
toFail
instead ofIgnore
azure-workload-identity/deploy/azure-wi-webhook.yaml
Line 253 in df6362a
labelSelector
in the mutating webhook configuration to only mutate pods with the"azure.workload.identity/use": "true"
label.Note: we are going to make the above changes default in the upcoming
v1.0.0
release (xref: #601)