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.
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