You will need in this tutorial:
-
openshift
-
Mac:
brew install openshift-cli
-
-
minishift
-
docker
-
Fedora:
dnf install docker
-
kubectl
-
Fedora:
dnf install kubernetes-client
-
oc (eval $(minishift oc-env))
-
Apache Maven
-
Fedora:
dnf install maven
-
-
Mac OS:
brew install stern
-
Fedora:
sudo curl --output /usr/local/bin/stern -L https://github.com/wercker/stern/releases/download/1.6.0/stern_linux_amd64 && sudo chmod +x /usr/local/bin/stern
-
-
istioctl (will be installed via the steps below)
-
curl
,gunzip
,tar
-
Mac OS: built-in or part of your bash shell
-
Fedora: should also be installed already, but just in case…
dnf install curl gzip tar
-
-
git
-
dnf install git
-
-
siege
-
MAC OS:
brew install siege
-
Fedora:
dnf install siege
-
Tip
|
If you want to validate if everything is installed at once, just open a terminal and run:
The output should be something like: ✔ minishift
✔ docker 18.09.0
✔ oc 22
✔ kubectl
✔ git 2.17.2
✔ mvn 3.5.0
✔ curl 7.54.0
✔ stern 1.6.0
✔ siege 4.0.4 You can check quickly if you are missing any tool and decide if you want to install or not. |
In case of using Minishift you need at least minishift v1.24.0.
#!/bin/bash
# add the location of minishift executable to PATH
# I also keep other handy tools like kubectl and kubetail.sh
# in that directory
minishift profile set istio-tutorial
minishift config set memory 8GB
minishift config set cpus 3
minishift config set image-caching true
minishift config set openshift-version v3.11.0
minishift addon enable admin-user
#cdk 3.7 bug - docker url check
minishift config set skip-startup-checks true
minishift start
#This needs to be executed again if you restart minishift.
minishift ssh -- sudo setenforce 0
# Openshift console bug. anyuid needs to be applied after startup
minishift addon apply anyuid
eval $(minishift oc-env)
eval $(minishift docker-env)
oc login $(minishift ip):8443 -u admin -p admin
#or
oc login -u system:admin
Note
|
In this tutorial, you will often be polling the customer endpoint with curl , while simultaneously viewing logs via stern or kubetail.sh and issuing commands via oc and istioctl . Consider using three terminal windows.
|
#!/bin/bash
# Mac OS:
curl -L https://github.com/istio/istio/releases/download/1.1.1/istio-1.1.1-osx.tar.gz | tar xz
# Fedora/RHEL:
curl -L https://github.com/istio/istio/releases/download/1.1.1/istio-1.1.1-linux.tar.gz | tar xz
# Both:
cd istio-1.1.1
export ISTIO_HOME=`pwd`
export PATH=$ISTIO_HOME/bin:$PATH
oc apply -f install/kubernetes/helm/istio-init/files/crd-11.yaml
or
kubectl apply -f install/kubernetes/helm/istio-init/files/crd-11.yaml
oc apply -f install/kubernetes/istio-demo.yaml
or
kubectl apply -f install/kubernetes/istio-demo.yaml
oc project istio-system
or
kubectl config set-context $(kubectl config current-context) --namespace=istio-system
oc expose svc istio-ingressgateway
oc expose svc grafana
oc expose svc prometheus
oc expose svc tracing
oc expose service kiali --path=/kiali
oc adm policy add-cluster-role-to-user admin system:serviceaccount:istio-system:kiali-service-account -z default
Wait for Istio’s components to be ready
$ oc get pods -w
or
$ kubectl get pods -w
NAME READY STATUS RESTARTS AGE
grafana-6995b4fbd7-ntp4f 1/1 Running 0 57m
istio-citadel-54f4678f86-jnv5s 1/1 Running 0 57m
istio-cleanup-secrets-nch4k 0/1 Completed 0 57m
istio-egressgateway-5d7f8fcc7b-r76gg 1/1 Running 0 57m
istio-galley-7bd8b5f88f-nlczb 1/1 Running 0 57m
istio-grafana-post-install-lffq2 0/1 Completed 0 57m
istio-ingressgateway-6f58fdc8d7-gbzzq 1/1 Running 0 57m
istio-pilot-d99689994-zh66q 2/2 Running 0 57m
istio-policy-766bf4bd6d-skwkp 2/2 Running 0 57m
istio-sidecar-injector-85ccf84984-crmhv 1/1 Running 0 57m
istio-statsd-prom-bridge-55965ff9c8-76nx4 1/1 Running 0 57m
istio-telemetry-55b6b5bbc7-qmf2l 2/2 Running 0 57m
istio-tracing-77f9f94b98-kknh7 1/1 Running 0 57m
prometheus-7456f56c96-nxdvv 1/1 Running 0 57m
servicegraph-684c85ffb9-f7tjp 1/1 Running 2 57m
And if you need quick access to the OpenShift console
minishift console
Note
|
On your first launch of the OpenShift console via minishift , you will receive a warning like "Your connection is not private". For our demo, simply select "Proceed to 192.168.xx.xx (unsafe)" to bypass the warning. Both the username and the password are set to admin , thanks to the admin-user add-on.
|
Wait for Istio’s components to be ready
$ oc get pods -n istio-system
NAME READY STATUS RESTARTS AGE
elasticsearch-0 1/1 Running 0 3m
grafana-648c7d5cc6-d4cgr 1/1 Running 0 3m
istio-citadel-64f86c964-vjd6f 1/1 Running 0 5m
istio-egressgateway-8579f6f649-zwmqh 1/1 Running 0 5m
istio-galley-569c79fcbf-rc24l 1/1 Running 0 5m
istio-ingressgateway-5457546784-gct2p 1/1 Running 0 5m
istio-pilot-78d8f7465f-kmclw 2/2 Running 0 5m
istio-policy-b57648f9f-cvj82 2/2 Running 0 5m
istio-sidecar-injector-5876f696f-s2pdt 1/1 Running 0 5m
istio-statsd-prom-bridge-549d687fd9-g2gmc 1/1 Running 0 5m
istio-telemetry-56587b8fb6-wpg9k 2/2 Running 0 5m
jaeger-agent-6qgrl 1/1 Running 0 3m
jaeger-collector-9cbd5f46c-kt9w9 1/1 Running 0 3m
jaeger-query-6678967b5-8sgdp 1/1 Running 0 3m
kiali-6b8c686d9b-mkxdv 1/1 Running 0 2m
openshift-ansible-istio-installer-job-rj7pj 0/1 Completed 0 7m
prometheus-6ffc56584f-zgbv8 1/1 Running 0 5m