Fail scheduling all pods that are not labeled with app: consul.name.
This ensures that no user apps are inadvertently scheduled and skip mutation while the webhook is offline (after consul has been installed).
I chose to match on app: consul.name so we do not fail to schedule our own pods in case the webhook object is applied to k8s before the rest of our consul components are scheduled.
Changes proposed in this PR:
Set failure policy of the webhook to Fail instead of Ignore
Add a new field to connectInject stanza: connectInject.failurePolicy default to Fail which controls the behaviour.
How I've tested this PR:
Manually tested by applying this patch which sets the webhook to unready, deploy consul.
Fail scheduling all pods that are not labeled with
app: consul.name
. This ensures that no user apps are inadvertently scheduled and skip mutation while the webhook is offline (after consul has been installed). I chose to match onapp: consul.name
so we do not fail to schedule our own pods in case the webhook object is applied to k8s before the rest of our consul components are scheduled.Changes proposed in this PR:
Fail
instead ofIgnore
connectInject.failurePolicy
default toFail
which controls the behaviour.How I've tested this PR:
kubectl exec -it consul-consul-connect-injector-webhook-deployment-84cb5c97llxd9 -- touch /tmp/healthy
How I expect reviewers to test this PR: Code review CI run against GKE: https://app.circleci.com/pipelines/github/hashicorp/consul-helm/3370/workflows/2ae29e9c-a234-407a-a4c9-84a96fad0979 CI run against Kind: https://app.circleci.com/pipelines/github/hashicorp/consul-helm/3369/workflows/5a0f3727-e04a-4b03-902a-0bc0137e45f4
Checklist: