Draft
Conversation
…io sidecar injection (eldadru#164)
…io sidecar injection (eldadru#164)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add
sidecar.istio.io/inject: "false"Label and Annotation to ksniff Pod (#164)Description
Fixes #164
This PR adds the
sidecar.istio.io/inject: "false"label and annotation to theksniffpod'sObjectMetainkube/kubernetes_api_service.goto prevent Istio sidecar injection in namespaces with auto-injection enabled (istio-injection=enabled). Theksniffpod, used for network sniffing withtcpdumpand Wireshark, is privileged and should not include theistio-proxysidecar, which could interfere with its functionality.Changes
kube/kubernetes_api_service.goin theCreateSniffingPodfunction (around line 123).sidecar.istio.io/inject: "false"to theLabelsmap (standard for Istio >= 1.11).sidecar.istio.io/inject: "false"to theAnnotationsmap for compatibility with older Istio versions (<1.11).GenerateName,Namespace, other labels).Why Both Label and Annotation?
sidecar.istio.io/injectlabel to control sidecar injection (Istio issue #40512).Testing
Environment Setup:
ksniffbinary:Test in Istio-Enabled Namespace:
ksniff:istio-proxycontainer:sidecar.istio.io/inject: "false"inmetadata.labelsandmetadata.annotations.Test in Non-Istio Namespace:
ksniffworks and no sidecar is injected.Edge Cases:
ksniffon multiple pods to ensure no performance regression.Cleanup: