Share
Embed
Compose on Kubernetes をGKEで動かそう
Compose on Kuberenetes を GKEで動かしました。
それで得られた知見などをまとめています。
Event
- 2019/06/07 Cloud Native Kansai #03
- https://cnjp.connpass.com/event/127545/
Masa
June 07, 2019
Transcript
42 slides
-
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 Compose on Kubernetes を GKEで動かそう Cloud Native Kansai #03 2019/06/07 @masayuki14 -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 Masaといいます もりさきまさゆき ✓ @masayuki14 ✓ プロ主夫 フリーランス (パートタイム) ✓ Webエンジニア ✓ データベーススペシャリスト ✓ ✓ -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 このアイコン Follow me !! -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 自己紹介 コミュニティ はんなりPython (第3金曜開催@京都) ✓ OSS Gate (京都, 大阪, 東京) ✓ ✓ スプーキーズアンバサダー ✓ -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 スプーキーズ@京都 ボードゲーム制作 ✓ ソーシャルゲーム開発 ✓ Web系システム ✓ ゲームクリエイター積極採用中 -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 スプーキーズ@京都 モクモクモック(もくもく会) テクテクテック(勉強会) 2019/07 企画中 ISUCONワークショップ - 速度改善 ✓ CTF - セキュリティ ✓ ✓ -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 今日の話 Compose on Kubernetesを GKEで動かそう -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 Compose on k8s Compose on Kubernetes allows you to deploy Docker Compose fles onto a Kubernetes cluster. [「https://github.com/docker/compose-on- kubernetes」より引用] -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 Compose on k8s docker-compose.ymlをk8sクラ スターにデプロイ ✓ 前回のLTで紹介 ✓ -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 Docker Preferences -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 docker-compose.yml version: '3.3' services: db: image: dockersamples/k8s-wordsmith-db words: image: dockersamples/k8s-wordsmith-api deploy: replicas: 5 web: image: dockersamples/k8s-wordsmith-web ports: - "33000:80" -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 ローカルで実行 $ docker stack deploy \ -c docker-compose.yml \ --orchestrator=kubernetes \ kubesample -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 ローカルで実行 $ docker stack deploy -c docker-compose.yml --orchestrator=kubernetes kubesample Waiting for the stack to be stable and running... words: Ready [pod status: 2/5 ready, 3/5 pending, 0/5 failed] web: Ready [pod status: 1/1 ready, 0/1 pending, 0/1 failed] db: Ready [pod status: 1/1 ready, 0/1 pending, 0/1 failed] Stack kubesample is stable and running $ kubectl get pods NAME READY STATUS RESTARTS AGE db-79b45689db-f49f6 1/1 Running 0 4m web-6b56cf97b9-2rbwg 1/1 Running 0 4m words-6d654698d5-49l8g 1/1 Running 0 4m words-6d654698d5-b9pf7 1/1 Running 0 4m words-6d654698d5-fmp9f 1/1 Running 0 4m words-6d654698d5-xhvfn 1/1 Running 0 4m words-6d654698d5-z6zsf 1/1 Running 0 4m -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 Compose on k8s Deploy on GKE -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 Install -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 Run $ kubectl config use-context gke_beta-4... $ docker stack deploy \ -c docker-compose.yml \ --orchestrator=kubernetes \ kubesample failed to find a Stack API version -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 結果 動かない!! おしまい!! -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 Issue 作成 Contribute -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 返信なし 同じ問題に困ってる人はいた ✓ どうしよう(いまここ) ✓ -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 わかったこと 本を読もう ✓ レジストリ使おう ✓ Docker/CLI 最新版必要 ✓ GCP $300 トライアル ✓ コントリビュートしよう ✓ 動かすことで理解が深まる ✓ -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 本を読もう -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 本を読もう docker, compose, swarm 順序よく学べる ✓ ✓ GCP まわりもわかる gcloud ✓ kubectl ✓ ✓ -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 本を読もう Webの情報では不十分 ✓ 入門書として良い ✓ 時間を買うと思えば安い ✓ -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 レジストリ使おう Docker Compose build できる ✓ ✓ Compose on k8s build できない ✓ ✓ -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 レジストリ使おう docker-compose.yml services: app: build: context: ./app dockerfile: Dockerfile build できない -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 レジストリ使おう docker-compose.yml services: app: image: localhost:5000/sample/app レジストリを指定 -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 レジストリ使おう Dockerレジストリサービス Docker Hub ✓ Quay ✓ -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 レジストリ使おう コンテナでローカルレジストリ $ docker run \ -v $(pwd)/registry:/var/lib/registry \ -p 5000:5000 \ registry:latest -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 レジストリ使おう build & push $ ls Dockerfile $ docker build -t localhost:5000/sample/app . $ docker push localhost:5000/sample/app -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 レジストリ使おう tag & push $ docker tag app localhost:5000/sample/app $ docker push localhost:5000/sample/app -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 Docker/CLI 最新版必要 Important: You will need a custom build of Docker CLI to deploy stacks onto GKE. The build must include this PR which has been merged onto the master branch. [「https://github.com/docker/compose-on- kubernetes/blob/master/docs/install-on-gke.md」よ り引用] -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 Docker/CLI 最新版必要 $ docker version stable 18.09.2 ✓ ✓ requirement 19.03 <= ✓ ✓ -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 Docker/CLI 最新版必要 $ git clone [email protected]:docker/cli.git $ cd cli $ make -f docker.Makefile binary $ make -f docker.Makefile cross $ ./build/docker-darwin-amd64 version -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 Docker/CLI 最新版必要 19.03 is comming soon. -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 GCP $300 トライアル いまなら1年間$300まで使い放題 -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 GCP $300 トライアル -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 コントリビュートしよう 困ったことはIssueにあげる 返事があるとは限らない ✓ ✓ バグレポート ✓ -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 コントリビュートしよう 解決したらPullRequest ✓ ドキュメントの改善 ハードルが低い ✓ ✓ -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 動かすことで理解が深まる GCP はじめての利用 ✓ ✓ Kubernetes 仕組み ✓ Manifest ✓ Resources ✓ ✓ -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 動かすことで理解が深まる commands kubectl ✓ docker ✓ gcloud ✓ ✓ -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 さいごに To be continued!! -
Compose on Kubernetes をGKEで動かそう - Cloud Native Kansai #03 Powered
by Rabbit 2.2.1 さいごに ありがとう ございました