eldadru / ksniff

Kubectl plugin to ease sniffing on kubernetes pods using tcpdump and wireshark
Apache License 2.0
3.13k stars 186 forks source link

Add istio inject false label/annotation #164

Open Noksa opened 1 year ago

Noksa commented 1 year ago

Currently, privileged ksniff pod will run with istio-proxy sidecar if it runs in a namespace with injection enabled.

It would be great if we could add such label and annotation here: https://github.com/eldadru/ksniff/blob/b0b737c110504e93047e6660e89fb1851187dc75/kube/kubernetes_api_service.go#L123

Should be like that:

    objectMetadata := v1.ObjectMeta{
        GenerateName: "ksniff-",
        Namespace:    k.targetNamespace,
        Labels: map[string]string{
            "app":                     "ksniff",
            "app.kubernetes.io/name":  "ksniff",
            "sidecar.istio.io/inject": "false",
        },
        Annotations: map[string]string{
            "sidecar.istio.io/inject": "false",
        },
    }