1+ # Kind cluster management
2+
3+ KIND_CLUSTER_NAME ?= kubernetes-mcp-server
4+
5+ # Detect container engine (docker or podman)
6+ CONTAINER_ENGINE ?= $(shell command -v docker 2>/dev/null || command -v podman 2>/dev/null)
7+
8+ # #@ Istio
9+
10+ ISTIOCTL = _output/bin/istioctl
11+
12+ $(ISTIOCTL ) :
13+ @mkdir -p _output/bin
14+ @echo " Downloading istioctl..."
15+ @set -e; \
16+ TMPDIR=$$(mktemp -d ) ; \
17+ cd $$ TMPDIR; \
18+ curl -sL https://istio.io/downloadIstio | sh -; \
19+ ISTIODIR=$$(ls -d istio-* | head -n1 ) ; \
20+ cp $$ ISTIODIR/bin/istioctl $(PWD ) /$(ISTIOCTL ) ; \
21+ cd - > /dev/null; \
22+ rm -rf $$ TMPDIR; \
23+ echo " istioctl installed at $( ISTIOCTL) "
24+
25+ .PHONY : istioctl
26+ istioctl : $(ISTIOCTL ) # # Ensure istioctl is installed to _output/bin/
27+
28+ .PHONY : install-istio
29+ install-istio : istioctl # # Install Istio (demo profile) and enable sidecar injection in default ns
30+ ./$(ISTIOCTL ) install --set profile=demo -y
31+ kubectl label namespace default istio-injection=enabled --overwrite
32+
33+ .PHONY : install-istio-addons
34+ install-istio-addons : install-istio # # Install Istio addons
35+ kubectl apply -f dev/config/istio/prometheus.yaml -n istio-system
36+ kubectl apply -f dev/config/istio/kiali.yaml -n istio-system
37+ kubectl wait --namespace istio-system --for=condition=available deployment/kiali --timeout=300s
38+ kubectl wait --namespace istio-system --for=condition=available deployment/prometheus --timeout=300s
39+
40+ .PHONY : install-bookinfo-demo
41+ install-bookinfo-demo : # # Install Bookinfo demo
42+ kubectl create ns bookinfo
43+ kubectl label namespace bookinfo istio-discovery=enabled istio.io/rev=default istio-injection=enabled
44+ kubectl apply -f dev/config/istio/bookinfo.yaml -n bookinfo
45+ kubectl wait --for=condition=Ready pod --all -n bookinfo --timeout=300s
46+
47+ .PHONY : setup-kiali
48+ setup-kiali : install-istio-addons install-bookinfo-demo # # Setup Kiali
0 commit comments