Enabling Istio in a namespacae

6/25/2020

How should I enable istio injection as the side car in a namespace while creating the namespace yaml file itself ? I am doing it manually for now, what changes can I made in the yaml file.

-- warrior22123
google-kubernetes-engine
istio
kubernetes
namespaces

1 Answer

6/25/2020

You can enable Istio injection in the namespaces with setting istio-injection=enabled as a label while creating the namespace.

kind: Namespace
apiVersion: v1
metadata:
  name: test
  labels:
    istio-injection: enabled

you can check the labels with kubectl get ns --show-labels=true command

[node2 ~]$ kubectl get ns --show-labels=true
NAME              STATUS   AGE     LABELS
default           Active   3m8s    <none>
kube-node-lease   Active   3m9s    <none>
kube-public       Active   3m9s    <none>
kube-system       Active   3m9s    <none>
test              Active   2m26s   istio-injection=enabled
-- Armagan Karatosun
Source: StackOverflow