This repo is a sample about using divert with istio. The following diagram explains the architectture of the application we will be using in this sample:
The admin of the cluster must run the following commands to install Istio in the Okteto cluster:
helm repo add istio https://istio-release.storage.googleapis.com/charts
helm repo update
helm install --namespace istio-system --create-namespace istio-base istio/base --version 1.13.8 --wait
kubectl create namespace istio-ingress
kubectl label namespace istio-ingress istio-injection=enabled
helm install --namespace istio-system istiod istio/istiod --values istio/istiod-helm-values.yaml --wait
helm install --namespace istio-ingress istio-ingress istio/gateway --values istio/istio-ingress-helm-values.yaml --version 1.13.8 --wait
Replace <<okteto-subdomain>>
in istio-ingress-config.yaml
by the subdomain
field in your okteto Helm values file:
kubectl apply -n istio-ingress -f istio/istio-ingress-config.yaml
Each developer must run the following commands to deploy their dev environment
okteto ctx use https://okteto.<<okteto-subdomain>>
okteto kubeconfig
Then, run okteto deploy -f okteto-staging.yml
to deploy the application in the staging
namespace.
curl -k https://service-a-staging.<<okteto-subdomain>>/
curl -k https://service-b-staging.<<okteto-subdomain>>/
curl -k https://service-c-staging.<<okteto-subdomain>>/
curl -k https://service-a-staging.<<okteto-subdomain>>/call-b
curl -k https://service-a-staging.<<okteto-subdomain>>/call-c
Run okteto deploy
.
curl -k https://service-a-<<your-namespace>>.<<okteto-subdomain>>/
curl -k https://service-b-<<your-namespace>>.<<okteto-subdomain>>/
curl -k https://service-c-<<your-namespace>>.<<okteto-subdomain>>/
curl -k https://service-a-<<your-namespace>>.<<okteto-subdomain>>/call-b
curl -k https://service-a-<<your-namespace>>.<<okteto-subdomain>>/call-c
curl -k https://service-a-staging.<<okteto-subdomain>>/call-b
curl -k https://service-a-staging.<<okteto-subdomain>>/call-c