learning-cloud-native-go / service-cluster

🌐 An implementation of an Istio gateway with k8s deployments and services.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setting up an Istio Gateway

Development environment

Development dependencies

01. Starting minikube

  • minikube start --memory=16384 --cpus=4
  • minikube tunnel (πŸ’‘separate terminal)

02. Setting up Istio

  • curl -L https://git.io/getLatestIstio | ISTIO_VERSION=1.3.3 sh -

The steps according to istio.io/docs/setup/install/helm,

  • kubectl create namespace istio-system
  • helm template istio-1.3.3/install/kubernetes/helm/istio-init --name istio-init --namespace istio-system | kubectl apply -f -
  • kubectl get crds | grep 'istio.io' | wc -l (should see 23)
  • helm template istio-1.3.3/install/kubernetes/helm/istio --name istio --namespace istio-system | kubectl apply -f -

πŸ’‘ Investigate the progress via kubectl get po -n istio-system.

Deployment process

Gateway

  • kubectl apply -f gateway.yaml

πŸ’‘ More info via kubectl get svc istio-ingressgateway -n istio-system.

Service A

  • kubectl create ns servicea
  • kubectl label ns servicea istio-injection=enabled
  • kubectl apply -f servicea-deployment.yaml
    • πŸ’‘ Investigate the progress via kubectl get po -n servicea.

  • kubectl apply -f servicea-service.yaml
    • πŸ’‘ Verify via kubectl get svc -n servicea.

  • kubectl apply -f servicea-virtualservice.yaml

πŸ’‘ istio-ingressgateway:LoadBalancer:EXTERNAL-IP/servicea/greet should give {"response": "Hello world!"}.

Service B

  • kubectl create ns serviceb
  • kubectl label ns serviceb istio-injection=enabled
  • kubectl apply -f serviceb-deployment.yaml
    • πŸ’‘ Investigate the progress via kubectl get po -n serviceb.

  • kubectl apply -f serviceb-service.yaml
    • πŸ’‘ Verify via kubectl get svc -n serviceb.

  • kubectl apply -f serviceb-virtualservice.yaml

πŸ’‘ istio-ingressgateway:LoadBalancer:EXTERNAL-IP/serviceb/greet should give {"response": "Hello world!"}.

About

🌐 An implementation of an Istio gateway with k8s deployments and services.