This contains files necessary to demo istio via GCP
Adapted from Google Cloud instructions.
- Create a GCP project
- Enable Kubernetes APIs
- Enable billing
- Install gcloud
- Install kubectl:
gcloud components install kubectl
Create cluster named istio-demo
.
gcloud container clusters create istio-demo \
--machinetype=n1-standard-2 \
--num-nodes=4 \
--no-enable-legacy-authorization \
--zone=us-central1-b
Give the current user admin permissions for the cluster.
kubectl create clusterrolebinding cluster-admin-binding \
--clusterrole=cluster-admin \
--user="$(gcloud config get-value core/account)"
- Download Istio release.
- extract and navigate to your istio directory in a terminal.
- Add istioctl to your PATH:
export PATH=$PWD/bin:$PATH
. - Istall Istio core components:
kubectl apply -f install/kubernetes/istio-auth.yaml
.
Deploy the bookinfo microservices in Istio.
kubectl apply -f <(istioctl kube-inject -f samples/bookinfo/kube/bookinfo.yaml)
Find out what the ingress IP is.
kubectl get ingress -o wide
You may add any of the policies that are in the policies
directory to the bookinfo example. They work best individually so remember to remove them when you are done.
General format to add rule:
istioctl create -f policies/{policy-file-name.yml}
General format to remove rule:
istio delete -f policies/{policy-file-name.yml}
- Create a docker image (ex. I've created
hello-node-image
in myamp-istio
project.) kubectl apply -f <(istioctl kube-inject -f deployments/deployment.yml)
- Add a route rule
kubectl apply -f <(istioctl kube-inject -f deployments/route-rule.yml)