Provide default opt-in and opt-out options for sidecar injection #338
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #291
Description of changes
The current default
MutatingWebhookConfiguration
for webhookmpod.appmesh.k8s.aws
was to only send requests to the injector with namespace labelappmesh.k8s.aws/sidecarInjectorWebhook: enabled
. This would enable sidecar injection by default for pods in the labeled namespace and only provide an option to opt-out of sidecar injection for users who would have like to disable injection on a subset of pods in a namespace.This change will do
matchExpressions
on key:appmesh.k8s.aws/sidecarInjectorWebhook
and values:enabled
anddisabled
to send to request to the injector and will set the default injection based on the namespace label.appmesh.k8s.aws/sidecarInjectorWebhook: disabled
: The sidecar injector will not inject the sidecar into pods by default. Add the appmesh.k8s.aws/sidecarInjectorWebhook annotation with value enabled to the pod template spec to override the default and enable injection.e.g.
appmesh.k8s.aws/sidecarInjectorWebhook: enabled
: The sidecar injector will inject the sidecar into pods by default. Add the appmesh.k8s.aws/sidecarInjectorWebhook annotation with value disabled to the pod template spec to override the default and disable injection.e.g.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.