Sitemap

Starting Istio Bookinfo on Minikube

3 min readJun 14, 2018

--

I’m going to try “Bookinfo” guide on Minkube.

1. Prepare Minikube & kubectl

The OS of my laptop is Ubuntu.

Install a Hypervisor

I’ve already installed VirtualBox.

Install Minikube

# Install
$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
# Check
$ minikube version
minikube version: v0.27.0

Install kubectl

# Install
$ curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x ./kubectl && sudo mv ./kubectl /usr/local/bin/kubectl
# Check
$ kubectl version --client --short
Client Version: v1.10.4

Start Minikube with memory option

Bookinfo sample needs at least 4GB for Minikube. So I ran the command with an additional option --memory=4096:

# Start Minikube with 4GB memory
$ minikube start \
--extra-config=controller-manager.cluster-signing-cert-file="/var/lib/localkube/certs/ca.crt" \
--extra-config=controller-manager.cluster-signing-key-file="/var/lib/localkube/certs/ca.key" \
--extra-config=apiserver.admission-control="NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" \
--kubernetes-version=v1.10.0 \
--memory=4096
# Check
$ minikube status
minikube: Running
cluster: Running
kubectl: Correctly Configured: pointing to minikube-vm at 192.168.99.100
$ kubectl version --short
Client Version: v1.10.4
Server Version: v1.10.0
$ cat ~/.minikube/profiles/minikube/config.json
{
"MachineConfig": {
"MinikubeISO": "https://storage.googleapis.com/minikube/iso/minikube-v0.26.0.iso",
"Memory": 4096,
"CPUs": 2,
"DiskSize": 20000,
...
},
"KubernetesConfig": {
...
"ExtraOptions": [
{
"Component": "controller-manager",
"Key": "cluster-signing-cert-file",
"Value": "/var/lib/localkube/certs/ca.crt"
},
{
"Component": "controller-manager",
"Key": "cluster-signing-key-file",
"Value": "/var/lib/localkube/certs/ca.key"
},
{
"Component": "apiserver",
"Key": "admission-control",
"Value": "NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
}
],
"ShouldLoadCachedImages": true
}

It looks good :)

2. Install Istio on k8s with Helm

Install Helm

$ curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash

Download Istio & Install istioctl

$ curl -L https://git.io/getLatestIstio | sh -$ cd istio-0.8.0
$ sudo mv bin/istioctl /usr/local/bin

Install Istio with Helm and Tiller on Minikube

# Create tiller serviceaccount
$ kubectl create -f install/kubernetes/helm/helm-service-account.yaml
# Install Tiller
$ helm init --service-account tiller
# Install Istio with automatic sidecar injection
$ helm install install/kubernetes/helm/istio --name istio --namespace istio-system

Verify Services

$ kubectl get svc -n istio-system
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
istio-citadel ClusterIP 10.99.25.204 <none> 8060/TCP,9093/TCP 13m
istio-egressgateway ClusterIP 10.102.122.61 <none> 80/TCP,443/TCP 13m
istio-ingress LoadBalancer 10.97.116.135 <pending> 80:32000/TCP,443:30064/TCP 13m
istio-ingressgateway LoadBalancer 10.98.54.17 <pending> 80:31380/TCP,443:31390/TCP,31400:31400/TCP 13m
istio-pilot ClusterIP 10.110.214.155 <none> 15003/TCP,15005/TCP,15007/TCP,15010/TCP,15011/TCP,8080/TCP,9093/TCP 13m
istio-policy ClusterIP 10.108.86.127 <none> 9091/TCP,15004/TCP,9093/TCP 13m
istio-sidecar-injector ClusterIP 10.107.23.123 <none> 443/TCP 13m
istio-statsd-prom-bridge ClusterIP 10.106.114.186 <none> 9102/TCP,9125/UDP 13m
istio-telemetry ClusterIP 10.99.253.183 <none> 9091/TCP,15004/TCP,9093/TCP,42422/TCP 13m
prometheus ClusterIP 10.96.252.77 <none> 9090/TCP 13m

Verify Pods

$ kubectl get pods -n istio-system
NAME READY STATUS RESTARTS AGE
istio-citadel-7bdc7775c7-b4rx4 1/1 Running 0 16m
istio-egressgateway-795fc9b47-j8z4x 1/1 Running 0 16m
istio-ingress-84659cf44c-22sbh 1/1 Running 0 16m
istio-ingressgateway-7d89dbf85f-fgplm 1/1 Running 0 16m
istio-mixer-post-install-2glk8 0/1 Completed 0 14m
istio-pilot-66f4dd866c-gcvq7 2/2 Running 0 16m
istio-policy-76c8896799-nm225 2/2 Running 0 16m
istio-sidecar-injector-645c89bc64-h6vbd 1/1 Running 0 16m
istio-statsd-prom-bridge-949999c4c-vnss8 1/1 Running 0 16m
istio-telemetry-6554768879-wp4jh 2/2 Running 0 16m
prometheus-86cb6dd77c-2ncln 1/1 Running 0 16m

3. Deploy Bookinfo

Deploy Bookinfo Services

$ kubectl apply -f samples/bookinfo/kube/bookinfo.yaml

Define the ingress gateway

$ istioctl create -f samples/bookinfo/routing/bookinfo-gateway.yaml

Verify

$ kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
details ClusterIP 10.104.125.86 <none> 9080/TCP 13m
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 22h
productpage ClusterIP 10.110.119.110 <none> 9080/TCP 13m
ratings ClusterIP 10.103.69.16 <none> 9080/TCP 13m
reviews ClusterIP 10.103.122.155 <none> 9080/TCP 13m
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
details-v1-7b97668445-t92zd 1/1 Running 0 13m
productpage-v1-7bbdd59459-6ph5f 1/1 Running 0 13m
ratings-v1-76dc7f6b9-pvl6m 1/1 Running 0 13m
reviews-v1-64545d97b4-hd4dc 1/1 Running 0 13m
reviews-v2-8cb9489c6-mxpnk 1/1 Running 0 13m
reviews-v3-6bc884b456-hmp7x 1/1 Running 0 13m

Confirm the Bookinfo app

$ export INGRESS_HOST=$(minikube ip)
$ export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http")].nodePort}')
$ export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT
# Check
$ curl -o /dev/null -s -w "%{http_code}\n" http://${GATEWAY_URL}/productpage
200
# Check on a browser
$ xdg-open http://${GATEWAY_URL}/productpage

(๑•̀ㅂ•́)و✧

--

--

Mitz
Mitz

Written by Mitz

Java, Scrum, DDD, and daughters

Responses (2)