Skip to content

Instantly share code, notes, and snippets.

@dtan4
Created December 21, 2017 06:49
Show Gist options
  • Save dtan4/14303ec35eae7f24854f50dfe7db1756 to your computer and use it in GitHub Desktop.
Save dtan4/14303ec35eae7f24854f50dfe7db1756 to your computer and use it in GitHub Desktop.

Istio on Minikube

Requirements

  • Kubernetes 1.7.3 or newer w/ alpha features

The following instructions require you have access to a Kubernetes 1.7.3 or newer cluster with RBAC (Role-Based Access Control) enabled. You will also need kubectl 1.7.3 or newer installed. If you wish to enable automatic injection of sidecar, you need to turn on Kubernetes alpha features in your cluster.

Create Kubernetes cluster using Minikube

https://istio.io/docs/setup/kubernetes/sidecar-injection.html#automatic-sidecar-injection

minikube start \
    --extra-config=apiserver.Admission.PluginNames="Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,GenericAdmissionWebhook,ResourceQuota" \
    --kubernetes-version=v1.7.5

Install Istio

https://istio.io/docs/setup/kubernetes/quick-start.html

curl -L https://git.io/getLatestIstio | sh -
cd istio-x.y.z
kubectl apply -f install/kubernetes/istio.yaml
$ kubectl get svc -n istio-system
NAME            TYPE           CLUSTER-IP   EXTERNAL-IP   PORT(S)                                                            AGE
istio-ingress   LoadBalancer   10.0.0.174   <pending>     80:30167/TCP,443:31451/TCP                                         26s
istio-mixer     ClusterIP      10.0.0.24    <none>        9091/TCP,15004/TCP,9093/TCP,9094/TCP,9102/TCP,9125/UDP,42422/TCP   29s
istio-pilot     ClusterIP      10.0.0.126   <none>        15003/TCP,443/TCP                                                  27s
$ kubectl get po -n istio-system
NAME                                 READY     STATUS              RESTARTS   AGE
istio-ca-191975193-hn2ww             0/1       ContainerCreating   0          27s
istio-ingress-3924138486-gsmnw       0/1       ContainerCreating   0          26s
istio-initializer-2169589188-ztdtk   0/1       ContainerCreating   0          12s
istio-mixer-333075648-dk2jn          0/3       ContainerCreating   0          32s
istio-pilot-4226036077-k82gg         0/2       ContainerCreating   0          29s

Install Istio Initializer

https://istio.io/docs/setup/kubernetes/sidecar-injection.html#automatic-sidecar-injection

to enable automatic sidecar injection

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

Install Zipkin

https://istio.io/docs/tasks/telemetry/distributed-tracing.html

kubectl apply -f install/kubernetes/addons/zipkin.yaml
kubectl port-forward -n istio-system $(kubectl get pod -n istio-system -l app=zipkin -o jsonpath='{.items[0].metadata.name}') 9411:9411 &
open http://localhost:9411

Deploy a sample application: Bookinfo

https://istio.io/docs/guides/bookinfo.html

kubectl apply -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}')
open http://$GATEWAY_URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment