datashim icon indicating copy to clipboard operation
datashim copied to clipboard

DLF labels are having conflicts with Istio sidecar Injection

Open Tomcli opened this issue 5 years ago • 3 comments

When trying to deploy a pod with DLF labels inside an namespace with istio inject, I'm seeing the errors below. It looks like there's some conflicts between the DLF and istio mutation.

The Pod "nginx" is invalid: spec.volumes[4].name: Duplicate value: "example-dataset"

Here is my pod

cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
  name: nginx
  namespace: default
  labels:
    dataset.0.id: "example-dataset"
    dataset.0.useas: "mount"
spec:
  containers:
    - name: nginx
      image: nginx
EOF

Tomcli avatar Oct 16 '20 21:10 Tomcli

Hi @Tomcli can you try creating the pod like this:

cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
  name: nginx
  annotations:
    sidecar.istio.io/inject: "false"
  namespace: default
  labels:
    dataset.0.id: "example-dataset"
    dataset.0.useas: "mount"
spec:
  containers:
    - name: nginx
      image: nginx
EOF

YiannisGkoufas avatar Oct 19 '20 08:10 YiannisGkoufas

Thanks @YiannisGkoufas, for pipelines we can disable istio sidecar. On the notebook server we can define our own volume mount definition on the UI so we can bypass this problem. But on KFServing, if we are going to disable istio sidecar, then we are losing some traffic metrics. Although those metrics are not important for now, we should revisit it in the future as there could be other mutation webhook that can cause this problem.

Tomcli avatar Oct 19 '20 18:10 Tomcli

Hi @Tomcli can you try creating the pod like this:

cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
  name: nginx
  annotations:
    sidecar.istio.io/inject: "false"
  namespace: default
  labels:
    dataset.0.id: "example-dataset"
    dataset.0.useas: "mount"
spec:
  containers:
    - name: nginx
      image: nginx
EOF

@YiannisGkoufas we can put this into a troubleshooting section and close this issue.

Tomcli avatar Nov 06 '20 18:11 Tomcli

Closing this issue as it seems to have been resolved

srikumar003 avatar Jan 27 '23 10:01 srikumar003