Skip to content

Instantly share code, notes, and snippets.

@angelachin
Last active March 8, 2018 22:17
Show Gist options
  • Save angelachin/0a8dd12cab7a2e7dca903005a91f77db to your computer and use it in GitHub Desktop.
Save angelachin/0a8dd12cab7a2e7dca903005a91f77db to your computer and use it in GitHub Desktop.
Exploring Istio on Minikube

install required tools

brew install kubectl
brew cask install minikube

boot local kubernetes cluster

minikube start \
  --extra-config=controller-manager.ClusterSigningCertFile="/var/lib/localkube/certs/ca.crt" \
  --extra-config=controller-manager.ClusterSigningKeyFile="/var/lib/localkube/certs/ca.key" \
  --extra-config=apiserver.Admission.PluginNames=NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota \
  --kubernetes-version=v1.9.0

If an error occurs, try to minikube delete -v 0 and try again

get latest istio

(reference doc)

mkdir -p ~/workspace/istio-sandbox && cd ~/workspace/istio-sandbox
curl -L https://git.io/getLatestIstio | sh -
cd istio-0.6.0
cp bin/istioctl /usr/local/bin/

install istio onto your kubernetes

kubectl apply -f install/kubernetes/istio-auth.yaml

If it fails, re-run the last command above

deploy bookinfo sample

(reference doc)

kubectl apply -f <(istioctl kube-inject -f samples/bookinfo/kube/bookinfo.yaml)
export GATEWAY_URL=$(kubectl get po -l istio=ingress -n istio-system -o 'jsonpath={.items[0].status.hostIP}'):$(kubectl get svc istio-ingress -n istio-system -o 'jsonpath={.spec.ports[0].nodePort}')

so that

echo $GATEWAY_URL

shows an IP and port and when you

curl -o /dev/null -s -w "%{http_code}\n" http://${GATEWAY_URL}/productpage

you get a 200, indicating the bookinfo app is running

to see the app in your browser

open http://${GATEWAY_URL}/productpage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment