Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Kubernetes × CircleCIで実現する安心安全Deploy / Safe Dep...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
VTRyo
June 03, 2020
Technology
3.8k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Kubernetes × CircleCIで実現する安心安全Deploy / Safe Deploy with Kubernetes and CircleCI
2020.6.3 CircleCI ユーザーコミュニティミートアップ登壇資料
https://circleci.connpass.com/event/175195/
VTRyo
June 03, 2020
More Decks by VTRyo
See All by VTRyo
越境するなら専門用語を使うな高校校歌 / If you wanna cross border, you shouldn't use jargon
vtryo
0
130
なぜ私たちのSREプラクティスはなかなか機能しないのか 〜システムより先に組織を見る〜 / Why our SRE practices aren't really working
vtryo
4
6.1k
飲食店もAIで。レジ締めやハンディシステムをつくってる話 / Using AI for restaurant management
vtryo
0
320
そのSLO 99.9%、本当に必要ですか? 〜優先度付きSLOによる責任共有の設計思想〜 / Is that 99.9% SLO really necessary? Design philosophy of shared responsibility through prioritized SLOs
vtryo
2
4.1k
あの職員室 / That teachers' lounge
vtryo
0
180
自分だけの、誰も想像できないキャリアの育て方 〜偶然から始めるキャリアプラン〜 / Career planning starting by luckly v2
vtryo
1
570
60以上のプロダクトを持つ組織における開発者体験向上への取り組み - チームAPIとBackstageで構築する組織の可視化基盤 - / sre next 2025 Efforts to Improve Developer Experience in an Organization with Over 60 Products
vtryo
3
3.3k
一体いつからSRE NEXTがSREだけのカンファレンスだと錯覚していた? / When did you ever get the idea that SRE NEXT was a conference just for SREs?
vtryo
1
930
一人から始めたSREチーム3年の歩み - 求められるスキルの変化とチームのあり方 - / The three-year journey of the SRE team, which started all by myself
vtryo
9
16k
Other Decks in Technology
See All in Technology
「守り」で活用するオンデバイスLLM 〜写ってはいけないを総力戦で防ぐ〜 / iOSDC Japan 2026
nakamuuu
0
150
SQL文一行も書けない人事がCortexもろもろを使って人事業務を楽にしてみる
ponponmikankan
1
240
omasushiというライブラリを作った
polidog
PRO
0
220
20260912_スクフェス三河
kgnkhkr
0
350
Deploying a Full-Stack Bun-Native Framework on Cloudflare Workers
7nohe
0
160
iOSDC Japan 2026 day1 TrackC 10:50
feedtailor
1
140
What the customer really needed
kawaguti
PRO
1
120
Reactの設計論
uhyo
22
12k
AIで仕事のやり方を変える
matsu7874
3
1.1k
家のリアーキテクト・リファクタリング
suguruooki
0
140
AI 時代のスタートアップエコシステ厶から考究する技術的負債との向き合い方
m3m0r7
PRO
2
1.5k
GoにおけるFFIのこれまでとこれから
goccy
5
2.8k
Featured
See All Featured
Building AI with AI
inesmontani
PRO
1
1.2k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.9k
KATA
mclloyd
PRO
35
15k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.9k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
330
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
690
Speed Design
sergeychernyshev
33
2.1k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
520
How to Think Like a Performance Engineer
csswizardry
28
2.8k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.8k
Transcript
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. Kubernetes
× CircleCI で実現する安⼼安全Deploy VTRyo / @3s_hv #CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. #CircleCIJP
イベントハッシュタグ #CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. #CircleCIJP
スライドは公開します
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. VTRyo
/ @3s_hv ➤ 株式会社マツリカ / SRE ➤ 作家(早く脱稿したい) ➤ CircleCIユーザコミュニティメ ンバー etc. ➤ AWS Summit 2019 Startup Central 登壇 etc. https://vtryo.me illustration by 湊川あい #CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. 営業をもっと⾃由に、もっと創造的に。
#CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. 営業をもっと⾃由に、もっと創造的に。
#CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. 営業をもっと⾃由に、もっと創造的に。
#CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ➤
CI/CDってなんだっけ? ➤ 安⼼安全のDeployって? ➤ CircleCIに何をさせている? ➤ Deploy Workflow ➤ config.yml 話すこと #CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ⼿動でDeployまでしている⼈
#CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. Build,
Testは⾃動の⼈ #CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. Build,
Test, Deploy承認 までは⾃動の⼈ #CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ⾃動でDeployまでしている⼈
#CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ⾃動
CI/CDってなんだっけ? #CircleCIJP 参考:https://aws.amazon.com/jp/devops/continuous-delivery/ Build & Test Deploy Staging Deploy Production Commit change ⾃動 継続的インテグレーション 継続的デリバリ 継続的デプロイメント v1.1 本番Deploy 承認します ⾃動
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ➤
CI(継続的インテグレーション) ➤ リリースプロセスのBuild段階とTest段階のことを指す。コードの変更がCommit されるたびに、⾃動化されたBuildとTestが実⾏される ➤ CD(継続的デリバリ) ➤ リリースプロセスの全体を⾃動化すること。ステージング環境まで⾃動Deployさ れる。本番環境へのDeployするかは開発者が決める ➤ CD(継続的デプロイメント) ➤ 継続的デリバリにおいて、本番環境へのDeployに承認が必要かどうか CI/CDってなんだっけ? #CircleCIJP 参考:https://aws.amazon.com/jp/devops/continuous-delivery/
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ҆৺҆શͷDeployͱ
#CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. 1.
開発者なら誰でもDeployまでできる CircleCIの頑張りどころ #CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. 2.
⼈間が頑張らずにDeployまでできる CircleCI, Kubernetes の頑張りどころ #CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. 3.
Stagingでテストされた環境が ProductionにDeployされる CircleCI, Kubernetes の頑張りどころ #CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ͜ͷ3ͭΛϙΠϯτʹ
͍͖ͯ͠·͢ #CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ։ൃऀͳΒ୭ͰDeploy·ͰͰ͖Δ
#CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ⾃動
どこの部分の話? #CircleCIJP 参考:https://aws.amazon.com/jp/devops/continuous-delivery/ Build & Test Deploy Staging Deploy Production Commit change ⾃動 継続的インテグレーション 継続的デリバリ 継続的デプロイメント v1.1 本番Deploy 承認します ⾃動 ͜͜ͷΛ͢ΔΑ
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ➤
開発者がソースコードをPush or Mergeすると… ➤ CircleCIがBuild & Testを開始 ➤ DockerΠϝʔδ͕ECRにPushされる ➤ KubernetesクラスタにDeployされる Workflowの概要 #CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ➤
開発者がソースコードをPush or Mergeすると… ➤ CircleCIがBuild & Testを開始 ➤ DockerΠϝʔδ͕ECRにPushされる ➤ KubernetesクラスタにDeployされる Workflowの概要 開発者がやることはシンプル #CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ➤
⾃動的にテスト(リリース候補確認)環境にDeployされる ➤ 開発者はMasterにMergeするだけでOK v1.1がMasterにMergeされたWorkflow #CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ➤
ProductionリリースWorkflowはStaging(本番相当)環境に⾃動Deployされる ➤ 問題なければ「request_prod 」をApprovedすることで本番Deployされる v1.1がProduction DeployされるときのWorkflow #CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ➤
ProductionリリースWorkflowはStaging(本番相当)環境に⾃動Deployされる ➤ 問題なければ「request_prod 」をApprovedすることで本番Deployされる v1.1がProduction DeployされるときのWorkflow #CircleCIJP 開発者は「Approved」するだけ
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ➤
ProductionリリースWorkflowはStaging(本番相当)環境に⾃動Deployされる ➤ 問題なければ「request_prod 」をApprovedすることで本番Deployされる v1.1がProduction DeployされるときのWorkflow #CircleCIJP 安全だね!
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ➤
Stagingに⾃動的にDeployしたあとに ApprovedのJobを挟んでおく ➤ 開発者はこの中⾝を知らなかったとしても Deployすることができる config.yml #CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ਓ͕ؒؤுΒͣʹDeploy·ͰͰ͖Δ
#CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ⾃動
どこの部分の話? #CircleCIJP 参考:https://aws.amazon.com/jp/devops/continuous-delivery/ Build & Test Deploy Staging Deploy Production Commit change ⾃動 継続的インテグレーション 継続的デリバリ 継続的デプロイメント v1.1 本番Deploy 承認します ⾃動 ͜͜ͷΛ͢ΔΑ
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ➤
⼈間がコマンドラインなどを使⽤してDeployするやりかた ➤ kubectl apply ➤ terraform apply ➤ Deploy時にパラメータの変更が⼿動で必要なやりかた ⼈間が頑張るDeployとは(⼀例です) #CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ➤
⼈間がコマンドラインなどを使⽤してDeployするやりかた ➤ kubectl apply ➤ terraform apply ➤ Deploy時にパラメータの変更が⼿動で必要なやりかた ⼈間が頑張るDeployとは(⼀例です) #CircleCIJP いつかミスでる & 時間かかる
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ➤
変更されたコードのテスト ➤ Dockerイメージの作成 ➤ 作成されるたび、Dockerイメージタグにバージョン管理のためコミットハッシュ を付与する ➤ ECRにPushする ➤ Migrationの実⾏ ➤ Deploy ➤ クラスタで、作成したDockerイメージに差し替える KubernetesクラスタにDeployするまで #CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ➤
変更されたコードのテスト ➤ Dockerイメージの作成 ➤ 作成されるたび、Dockerイメージタグにバージョン管理のためコミットハッシュ を付与する ➤ ECRにPushする ➤ Migrationの実⾏ ➤ Deploy ➤ クラスタで、作成したDockerイメージに差し替える KubernetesクラスタにDeployするまで #CircleCIJP なんだかんだ⾔ってやること多い
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ➤
Dockerイメージタグにコミットハッシュ ➤ ↑で作成されたDockerイメージを使ってDeployされる config.yml #CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ➤
ECRの操作は、CircleCI Orbsを利⽤することで簡単に実現できる config.yml #CircleCIJP 参考:https://circleci.com/orbs/registry/orb/circleci/aws-ecr
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. StagingͰςετ͞Εͨڥ͕
ProductionʹDeploy͞ΕΔ #CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ⾃動
どこの部分の話? #CircleCIJP 参考:https://aws.amazon.com/jp/devops/continuous-delivery/ Build & Test Deploy Staging Deploy Production Commit change ⾃動 継続的インテグレーション 継続的デリバリ 継続的デプロイメント v1.1 本番Deploy 承認します ⾃動 ͜͜ͷΛ͢ΔΑ
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ➤
StagingにDeployされてからでなければProductionへDeployできない流れ v1.1がProduction DeployされるときのWorkflow #CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. なぜその流れがよいの?
#CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. かつての地獄…
➤ Opsworksによる構築、Deploy ➤ Stackによって失敗したりする ➤ 詳細なログを出してくれない… ➤ 構成変更に時間がかかる(停⽌も⻑ い) ➤ Chef ➤ 毎回Setupコマンド待ち ➤ ローカル開発環境はDockerなんだけど… #CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. 確かなDockerイメージをProductionへ
#CircleCIJP Deploy Staging Deploy Production Docker Image ⾃動 workflowでは Staging Deploy前にdocker build実⾏ 同じDockerイメージがDeploy ➤ 動作確認が取れているDockerイメージが 確実にProductionへ届く ➤ 安定性の向上 ➤ 「それStagingだと環境差分があって 再現しないんですよ」が減る ※データベース内容による環境差分はあると思います
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. 確かなDockerイメージをProductionへ
#CircleCIJP Deploy Staging Deploy Production Docker Image ⾃動 workflowでは Staging Deploy前にdocker build実⾏ 同じDockerイメージがDeploy ➤ 動作確認が取れているDockerイメージが 確実にProductionへ届く ➤ 安定性の向上 ➤ 「それStagingだと環境差分があって 再現しないんですよ」が減る ※データベース内容による環境差分はあると思います 安全だね!
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ➤
CircleCIによって、継続的デプロイメント(or 継続的デリバリ)の実装が可能 ➤ 「⼈間が頑張らず、誰でもDeployできる」ことには様々なメリットがあるよ ➤ 効率化 ➤ 属⼈化排除 ➤ Deploy安定性向上 ➤ Staging→ProductionというDeployフローが可能なら実装するとメリットがあるよ ➤ 動作確認保証が取れたものがProductionへ届く ➤ サービス安定性向上 まとめ #CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. ➤
Amazon EKSͰߏங͢ΔࣾPaaS ➤ https://speakerdeck.com/vtryo/create-paas-eks ➤ KubernetesͷJobͰ࣮ߦͨ͠MigrationͷϩάΛCircleCIͰݟΕΔͱศར ➤ https://blog.vtryo.me/entry/migration-log-to-circleci ➤ CircleCIͰϏϧυ͍ͯ͠Δϒϥϯν໊ΛDockerΠϝʔδͷλάʹઃఆ͢Δ ➤ https://blog.vtryo.me/entry/docker-image-tag-using-branch-name その他 参考資料 #CircleCIJP
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. Hire
me! (side job.) ➤ Hire meは冗談ですが、ご相談はいつで もお待ちしています ➤ Twitter→@3s_hv #CircleCIJP illustration by 湊川あい
© 株式会社マツリカ ∕ mazrica, inc. - All Rights Reserved. Kubernetes
× CircleCI で実現する安⼼安全Deploy VTRyo / @3s_hv 完 #CircleCIJP