From cf66279af8fb33c9bb410777c16218cadbf4dcd6 Mon Sep 17 00:00:00 2001 From: QiLiang Date: Wed, 7 Mar 2018 14:45:30 +0800 Subject: Basic setup for istio sidecar auto injection To enable auto sidecar injection on specific namespace, you only need label the namespace with `istio-injection=enabled`, e.g.: kubectl label namespace default istio-injection=enabled For details please refer: https://istio.io/docs/setup/kubernetes/sidecar-injection.html#automatic-sidecar-injection Change-Id: I2059aa0be2ab3f4f942342850d286281c5f940d4 Signed-off-by: QiLiang --- src/vagrant/kubeadm_istio/istio/deploy.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/vagrant/kubeadm_istio/istio/deploy.sh') diff --git a/src/vagrant/kubeadm_istio/istio/deploy.sh b/src/vagrant/kubeadm_istio/istio/deploy.sh index 051497c..3dd1426 100755 --- a/src/vagrant/kubeadm_istio/istio/deploy.sh +++ b/src/vagrant/kubeadm_istio/istio/deploy.sh @@ -37,15 +37,30 @@ source ~/.bashrc kubectl apply -f install/kubernetes/istio.yaml +# Install the sidecar injection configmap +./install/kubernetes/webhook-create-signed-cert.sh \ + --service istio-sidecar-injector \ + --namespace istio-system \ + --secret sidecar-injector-certs +kubectl apply -f install/kubernetes/istio-sidecar-injector-configmap-release.yaml + +# Install the sidecar injector webhook +cat install/kubernetes/istio-sidecar-injector.yaml | \ + ./install/kubernetes/webhook-patch-ca-bundle.sh > \ + install/kubernetes/istio-sidecar-injector-with-ca-bundle.yaml +kubectl apply -f install/kubernetes/istio-sidecar-injector-with-ca-bundle.yaml +kubectl -n istio-system get deployment -listio=sidecar-injector + # Validate the installation kubectl get svc -n istio-system kubectl get pods -n istio-system +kubectl get namespace -L istio-injection -r="0" -while [ $r -ne "4" ] +r="1" +while [ $r -ne "0" ] do kubectl get pods -n istio-system - r=$(kubectl get pods -n istio-system | grep Running | wc -l) + r=$(kubectl get pods -n istio-system | egrep -v 'NAME|Running' | wc -l) sleep 60 done -- cgit 1.2.3-korg