Share
Embed
Getting Started Istio
Getting Started Istio on Shinjuku mokumoku programming vol.17
threetreeslight
October 13, 2018
Transcript
23 slides
-
Istio って何? service mash を実現するサービスだよ service mesh が何かについては以下のブログ⾒てもら うと分かりやすいかもしれません threetreeslight
- Why do we need service mesh? 6 / 23 -
Install Istio はinstall に必要なkit がいい感じにまとまってい るので助かる。それだけsystem component が多いと いうことも⽰している⽤に感じる。 curl
でもってきて、 istioctl だけpath 通しておく curl -L https://git.io/getLatestIstio | sh - cp ./istio-1.0.2/bin/istioctl /usr/local/bin 8 / 23 -
Manual OR Helm? Istio はいくつかの⽅法がある 1. helm (kubernates ⽤のpakcage manager
だと思ってもら えればOK) 2. kubectl でapply していく Istio 公式⾒解としえはhelm を使って構築されること を期待しているようだ。 9 / 23 -
Helm でGo ちなみにhelm でinstall できるcomponents は以下の通 り。 https://github.com/istio/istio/blob/master/install/kubernete keywords: -
istio - security - sidecarInjectorWebhook - mixer - pilot - galley 10 / 23 -
Monitoring 他にもinstallation として、prometheus, grafana, servicegraph, tracing など様々なchart が⽤意されてい る。幸せ。 prometheus
とgrafana のchart を参考にできるのはあ りがたい. 11 / 23 -
Tracing tracing chart に含まれているのが Zipkin ではなく jaeger ( ) だった。
jaeger がデファクトなのかな? https://www.jaegertracing.io/ 12 / 23 -
ちなみに 公式ドキュメントを⾒ていてCustom resource definision を⼿動で⼊れてしまい、helm で⼊らんと嘆 く⼈が多い。 Helm delete does
not clean the custom resource definitions Tutorial Helm note update # Install Istio’s Custom Resource Definitions via kubectl apply, and wait $ kubectl apply -f install/kubernetes/helm/istio/templates/crds.yaml 13 / 23 -
意気揚々にvalidate あるぇ、、、prometheus service が⽴ってる、、、 % kubectl get svc -n istio-system
NAME TYPE CLUSTER-IP EXTERNAL-IP istio-citadel ClusterIP 10.59.252.14 <none> istio-egressgateway ClusterIP 10.59.252.179 <none> istio-galley ClusterIP 10.59.247.233 <none> istio-ingressgateway LoadBalancer 10.59.255.51 35.197.96.12 istio-pilot ClusterIP 10.59.245.42 <none> istio-policy ClusterIP 10.59.246.86 <none> istio-sidecar-injector ClusterIP 10.59.249.91 <none> istio-statsd-prom-bridge ClusterIP 10.59.245.16 <none> istio-telemetry ClusterIP 10.59.252.157 <none> prometheus ClusterIP 10.59.252.174 <none> 15 / 23 -
mixier の依存っぽい components のenable,disable を制御できるようなの で以下のコマンドで再構築すると良い。 よく sidecarInjectorWebhook の制御はこれで⾏ うらしい。気持わかる
% helm install install/kubernetes/helm/istio --name istio --namespace ist --set prometheus.enabled=false 16 / 23 -
Deploying というわけで、⾃前のサービスのns を整理して、 development 環境から istio- injection=enabled flag を付与していく %
kubectl label ns staging istio-injection=enabled % kubectl get ns --show-labels NAME STATUS AGE LABELS default Active 146d <none> development Active 2m istio-injection=enabled istio-system Active 2h name=istio-system kube-public Active 146d <none> kube-system Active 146d <none> production Active 2m <none> staging Active 2m <none> 17 / 23 -
What's CRD? ubernates にはcustom resource という概念がある。 あたらしく独⾃リソースを定義することで、汎⽤的 なリソースとして、kubectl やkubernates のAPI
を利 ⽤した操作であったり、権限管理を⾏うことができ るようになる。 20 / 23 -
Consider API aggregation if: Your API is Declarative. You want
your new types to be readable and writable using kubectl. You want to view your new types in a Kubernetes UI, such as dashboard, alongside built-in types. You are developing a new API. You are willing to accept the format restriction that Kubernetes puts on REST resource paths, such as API Groups and Namespaces. (See the API Overview.) Your resources are naturally scoped to a cluster or to namespaces of a cluster. You want to reuse Kubernetes API support features. 21 / 23 -
con gmap + pod をcustom resource として管理しちゃったほ うが良いのかな? と思ったら書いてあった config
file format があるものだったらconfigmap pod のプログラムの設定ファイルだったらconfigmap の が楽 kubernetes api より環境変数で定義しちゃいたくなるも のであればconfigmap rolling update を必要とするものだったらconfigmap うーむ。 23 / 23