This guide demonstrates how to run Istio on a KWOK cluster by simulating nodes and then migrating Istio controllers to a real node to ensure they function correctly within the simulated environment.
1. Set up Cluster
Create a KWOK cluster using the kind runtime:
kwokctl create cluster --runtime kind
2. Create Node
Apply a KWOK node definition to the cluster:
kubectl apply -f https://kwok.sigs.k8s.io/examples/node.yaml
3. Deploy Istio
Install Istio using istioctl:
istioctl install -y
4. Migrate Controllers to Real Node
To ensure Istio controllers function properly, patch the istiod and istio-ingressgateway deployments to pin them to a real node (e.g., kwok-kwok-control-plane):
kubectl patch deploy istiod -n istio-system --type=json -p='[{"op":"add","path":"/spec/template/spec/nodeName","value":"kwok-kwok-control-plane"}]'
kubectl patch deploy istio-ingressgateway -n istio-system --type=json -p='[{"op":"add","path":"/spec/template/spec/nodeName","value":"kwok-kwok-control-plane"}]'
5. Create Pod and Inject Sidecar
Enable Istio sidecar injection for the default namespace and deploy a sample application (Bookinfo):
kubectl label namespace default istio-injection=enabled
kubectl apply -f https://raw.githubusercontent.com/istio/istio/master/samples/bookinfo/platform/kube/bookinfo.yaml
# Set up Cluster
kwokctl create cluster --runtime kind
# Create Node
kubectl apply -f https://kwok.sigs.k8s.io/examples/node.yaml
# Deploy Istio
istioctl install -y
# Migrate Controllers to Real Node
kubectl patch deploy istiod -n istio-system --type=json -p='[{"op":"add","path":"/spec/template/spec/nodeName","value":"kwok-kwok-control-plane"}]'
kubectl patch deploy istio-ingressgateway -n istio-system --type=json -p='[{"op":"add","path":"/spec/template/spec/nodeName","value":"kwok-kwok-control-plane"}]'
# Create Pod and Inject Sidecar
kubectl label namespace default istio-injection=enabled
kubectl apply -f https://raw.githubusercontent.com/istio/istio/master/samples/bookinfo/platform/kube/bookinfo.yaml