Extended Setup - TheOpenCloudEngine/uEngine-cloud GitHub Wiki

Setup

์„ค์น˜ ๋ฐฉ๋ฒ•์€ ํฌ๊ฒŒ GKE (Google Kubernetes Engine)์„ ์ด์šฉํ•œ ์„ค์น˜(์„ค์น˜๋ผ๊ธฐ ๋ณด๋‹ค๋Š” ๊ฐ€์ž…๋งŒ์œผ๋กœ ์ด๋ฏธ ๋„๊ตฌ๊ฐ€ ๋ชจ๋‘ ์„ค์น˜๋œ ํ™˜๊ฒฝ์„ ์‚ฌ์šฉ)์™€ ์ง์ ‘ ๋กœ์ปฌ์— CLI๋“ค๊ณผ kubernetes ๋ฅผ ์„ค์น˜ํ•˜๋Š” ๋ฐฉ๋ฒ•์ด ์žˆ์Šต๋‹ˆ๋‹ค

GKE ๋ฅผ ์‚ฌ์šฉ

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

    • Mac OS

    • Fedora: dnf install docker

  • kubectl

    • Mac OS

    • Fedora: dnf install kubernetes-client

  • oc (eval $(minishift oc-env))

  • Apache Maven

    • Mac OS

    • Fedora: dnf install maven

  • 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

Setup minishift

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

Setup environment

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.

Istio installation script

#!/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.
โš ๏ธ **GitHub.com Fallback** โš ๏ธ