Deploy a local K3D Kubernetes development cluster that will use Istio as the service mesh.
- Docker Desktop is an easy-to-install application for your Mac, Linux, or Windows environment that enables you to build and share containerized applications and microservices.
- k3s is a efficient and lightweight fully compliant Kubernetes distribution.
- k3d is a utility designed to easily run k3s in Docker.It provides a simple CLI to create, run, delete a full compliance Kubernetes cluster with 0 to n worker nodes.
- k9s is a terminal based UI to interact with your Kubernetes clusters. It helps to make it easier to navigate, observe and manage deployed applications
Use below script to setup
scripts/all.sh setup
Install k3d, istio, kubectl, helm. k9s
scripts/pre-requisites.sh setup
Provision k3d cluster using config/k3d-config.yaml
scripts/k3d.sh setup
source scripts/lib/tools.sh
kubectl wait --for=condition=Ready pods --all -n kube-system
In Other Terminal
k9s
Provision istio
scripts/istio.sh setup
Hello World Refernce:
- https://github.com/istio/istio/tree/master/samples/helloworld
- https://istio.io/latest/docs/tasks/traffic-management/ingress/gateway-api/
Provision App
RESOURCES_PATH=apps
kubectl create namespace apps
kubectl apply -f $RESOURCES_PATH/helloworld.yaml -n apps
There are two ways to expose Apps
- Expose App using Istio Gateway
RESOURCES_PATH=apps
kubectl delete -f $RESOURCES_PATH/helloworld-gateway-api.yaml -n apps
istioctl install --set profile=default -y
kubectl apply -f $RESOURCES_PATH/helloworld-gateway.yaml -n apps
kubectl wait --for=condition=Ready pods --all -n apps
OR
- Expose App using Kubernetes Gateway API
RESOURCES_PATH=apps
kubectl delete -f $RESOURCES_PATH/helloworld-gateway.yaml -n apps
istioctl install --set profile=minimal -y
kubectl get crd gateways.gateway.networking.k8s.io || \
{ kubectl kustomize "github.com/kubernetes-sigs/gateway-api/config/crd?ref=v0.5.0" | kubectl apply -f -; }
kubectl apply -f $RESOURCES_PATH/helloworld-gateway-api.yaml -n apps
kubectl wait --for=condition=Ready pods --all -n apps
Test App
source scripts/lib/gateway.sh
curl http://$GATEWAY_URL/hello
kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.15/samples/addons/prometheus.yaml
kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.15/samples/addons/grafana.yaml
kubectl apply -f https://raw.githubusercontent.com/istio/istio/master/samples/addons/jaeger.yaml
kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml
kubectl get pods --namespace tekton-pipelines --watch
kubectl apply --filename https://storage.googleapis.com/tekton-releases/dashboard/latest/tekton-dashboard-release.yaml
kubectl get pods --namespace tekton-pipelines --watch
kubectl port-forward -n tekton-pipelines service/tekton-dashboard 9097:9097
- Istio service mesh included to replicate production setup
- Initially /etc/hosts was used for mapping custom domain names to 127.0.0.1 in Host OS. Now it is replaced with https://local.gd/
- Use tellerops teller fro AWS secrets Management in place of .env. Ref: https://github.com/tellerops/teller
- Tektron fro CI/CD