Extended Setup - TheOpenCloudEngine/uEngine-cloud GitHub Wiki
์ค์น ๋ฐฉ๋ฒ์ ํฌ๊ฒ GKE (Google Kubernetes Engine)์ ์ด์ฉํ ์ค์น(์ค์น๋ผ๊ธฐ ๋ณด๋ค๋ ๊ฐ์ ๋ง์ผ๋ก ์ด๋ฏธ ๋๊ตฌ๊ฐ ๋ชจ๋ ์ค์น๋ ํ๊ฒฝ์ ์ฌ์ฉ)์ ์ง์ ๋ก์ปฌ์ CLI๋ค๊ณผ kubernetes ๋ฅผ ์ค์นํ๋ ๋ฐฉ๋ฒ์ด ์์ต๋๋ค
https://cloud.google.com ๋ก ์ ์ํ์ ํ, "๋ฌด๋ฃ์ฌ์ฉ"์ ํด๋ฆญํฉ๋๋ค. 1๋ 300๋ฌ๋ฌ ํ๋์ ๋ฌด๋ฃ๊ณ์ ์ด ์ ๊ณต๋๋๋ฐ, ๊ฐ์ ์ ์นด๋๋ฒํธ๋ฅผ ์๊ตฌํฉ๋๋ค. ์ด๋ ์ฌ์ฉ์์ ์นด๋๊ฒฐ์ ๊ฐ๋ฅ ํ์ธ์ ์ํจ์ด๋ฉฐ, ์ค์ ๋ก ๊ฒฐ์ ๋์ง ์์ผ๋ ๋ฌด๋ฃ์ฌ์ฉ์ ์ถ์ฒํฉ๋๋ค. ์๋จ์ shell ๋ฒํผ์ ํด๋ฆญํ์ฌ ์ ์ํ๋ฉด ๋๋ถ๋ถ์ CLI ํด์ด ๋ชจ๋ ์ค์น๋ ํ๊ฒฝ์ ์น๋ธ๋ผ์ฐ์ ์์ ์ฌ์ฉ๊ฐ๋ฅํฉ๋๋ค.
๊ธฐ๋ณธ GKE ๊ฐ์ ์ ์ฑ๊ณตํ ํ์ ๋ค์์ ๋งํฌ์ ์ค๋ช ์ ๋ฐ๋ผ Istio ๋ฅผ ์ค์นํ๊ณ ๊ธฐ๋ณธ์ ์ธ Istio ์ฌ์ฉ๋ฒ์ ์์งํ์๊ธฐ ๋ฐ๋๋๋ค:
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
-
Assumes minishift
, tested with minishift v1.22.0+7163416
#!/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 vm-driver virtualbox ## or kvm, for Fedora
minishift config set image-caching true
minishift addon enable admin-user
minishift addon enable anyuid
minishift start
minishift ssh -- sudo setenforce 0
eval $(minishift oc-env)
eval $(minishift docker-env)
oc login $(minishift ip):8443 -u admin -p 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.0.2/istio-1.0.2-osx.tar.gz | tar xz
# Fedora/RHEL:
curl -L https://github.com/istio/istio/releases/download/1.0.2/istio-1.0.2-linux.tar.gz | tar xz
# Both:
cd istio-1.0.2
export ISTIO_HOME=`pwd`
export PATH=$ISTIO_HOME/bin:$PATH
oc apply -f install/kubernetes/helm/istio/templates/crds.yaml
or
kubectl apply -f install/kubernetes/helm/istio/templates/crds.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 servicegraph
oc expose svc grafana
oc expose svc prometheus
oc expose svc tracing
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.
|