Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
managed_Kubernetes_on-premises.pdf
Search
yuhara
December 05, 2018
Technology
890
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
managed_Kubernetes_on-premises.pdf
yuhara
December 05, 2018
More Decks by yuhara
See All by yuhara
Introduce Conftest
yuhara
2
560
Other Decks in Technology
See All in Technology
白金鉱業Meetup_Vol.24_「AIエージェントは分けるほど良い」は本当か? / Is it true that “the more you divide AI agents, the better”?
brainpadpr
1
390
ルールやカスタム機能、どう活かす?ハンズオンで体感するIBM Bobの出力コントロール
muehara
1
170
SONiCのLinuxベースを活かしたZabbix監視
sonic
0
170
Disciplined Vibes: Scaling AI-Assisted Engineering
sheharyar
0
150
気軽に使える"情報のハブ"としてのNotion活用 〜フロー情報の集積点 と、 Claude Code × Notion AI〜
syucream
1
130
スキルと MCP ツール、責務をどう分けるか? AI が迷わないインターフェース設計の戦略
cdataj
1
1.1k
手塩にかけりゃいいってもんじゃない
ming_ayami
0
580
2026 TECHFRESH 畢業分享會 - 開發日常大解密!從領域驅動到企業級上線
line_developers_tw
PRO
0
1.1k
いまさら聞けない「仕様駆動開発入門」 〜AI活用時代の開発プロセスを考える〜
findy_eventslides
2
120
やさしいA2A入門
minorun365
PRO
12
1.9k
人材育成分科会.pdf
_awache
4
260
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
2.9k
Featured
See All Featured
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.6k
Optimizing for Happiness
mojombo
378
71k
Music & Morning Musume
bryan
47
7.2k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
230
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.5k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
Odyssey Design
rkendrick25
PRO
2
700
How GitHub (no longer) Works
holman
316
150k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.6k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Building Applications with DynamoDB
mza
96
7.1k
Transcript
ΦϯϓϨͩͬͯ͜͜·ͰͰ͖Δ KubernetesͰ࡞ΔࣗલPaaS Takaaki Yuhara Infrastructure Service Group Gurunavi, Inc. 2018.12.04
Japan Container Days v18.12
Takaaki Yuhara Infrastructure Engineer 2014~ ͙Δͳͼ ɹ͙ΔͳͼશͯͷαΠτΠϯϑϥͷߏஙͱӡ༻ ɹVirtualization/OS/Middleware/Container/k8s…ϨΠϠʔΛ୲ ɹΠϯϑϥͷίʔυԽɾࣗಈԽɺࢹςετͷ࠷దԽ etc…
ΦϯϓϨKubernetes kubeadm, Rancher, RKEͳͲɺखܰʹΦϯϓ ϨϛεͰߏஙͰ͖ΔΑ͏ʹͳΓ·ͨ͠ɻ ςʔϚɿΦϯϓϨKubernetesΛͲͷΑ͏ʹ׆༻͢Δ͔
Kubernetesに詳しくなくても誰でも簡単に使えるプラットフォーム
γεςϜ֓ཁ Generator API Management Console Load Barancer Ingress Service Deployment
Namespace
γεςϜ֓ཁ Generator API Management Console Load Barancer ར༻ऀManagement Console͔ Βඞཁࣄ߲Λೖྗ͠ར༻։࢝Ϙλϯ
ΛΫϦοΫ
γεςϜ֓ཁ Generator API Management Console Load Barancer Generator APIͷ֤छδϣϒʹϦΫ Τετ͕Δ
γεςϜ֓ཁ Generator API Management Console Load Barancer Ingress Service Deployment
Namespace Kubernetes APIΛ௨ͯ͡ NamespaceඞཁͱͳΔϦιʔ ε܈Λ࡞
γεςϜ֓ཁ Generator API Management Console Load Barancer Ingress Service Deployment
Namespace GitLab APIΛ௨ͯ͡ϓϩδΣΫτ ͷ࡞ʢςϯϓϨʔτ͔ΒͷΠϯ ϙʔτʣͱCI/CD༻ͷVariablesͷ ઃఆ Container Registryར༻Մ
γεςϜ֓ཁ Generator API Management Console Load Barancer Ingress Service Deployment
Namespace LoadBalancerʢk8sͷ֎ʣͷઃఆ Λมߋ͠ΫϥΠΞϯτ͔ΒͷΤϯυ ϙΠϯτΛఏڙ
• Kubernetes ্ͷNamespace֤छϦιʔε܈ • ΞϓϦέʔγϣϯʹର͢ΔΤϯυϙΠϯτ • GitLab ͷ Projectʢ֤छઃఆ͕ࢪ͞Εͨঢ়ଶʣ Management
Console ͔Β࡞ ޙΞϓϦΛ࡞ͯ͠Commit & Push͢Δ͚ͩ
Kubernetes Resouce Generator • KubernetesͷϦιʔε܈Λ࡞ΔͨΊʹಠࣗʹ࡞ͨ͠API • YAMLϚχϡϑΣετΛapply͍ͯ͠ΔΑ͏ͳΠϝʔδ • Kubernetes client
pythonΛ༻ • Officialʹఏڙ͞Ε͍ͯΔgopythonͷClient Library ɹɹhttps://github.com/kubernetes-client/python ɹɹhttps://github.com/kubernetes/client-go • Python FlaskͰREST APIԽ
Kubernetes Client Python ྫʣNamespaceͷ࡞
DeployͷྲྀΕ
γεςϜ֓ཁ Developer Load Barancer Ingress Service Deployment Namespace Container Registry
ίʔυΛGitLabͷϓϩδΣΫ τʹରͯ͠Commit / Push
γεςϜ֓ཁ Developer Load Barancer Ingress Service Deployment Namespace Container Registry
GitLab CI͕։࢝͞Εk8s্ͷrunner ʹରͯ͠Pipelineͷ࣮ߦΛ໋ྩ
γεςϜ֓ཁ Developer Load Barancer Ingress Service Deployment Namespace workspace Container
Registry #01 Build Stage Kubernetes্ͰίϯςφϏϧυ ༻ͷίϯςφΛ࣮ߦ
γεςϜ֓ཁ Developer Load Barancer Ingress Service Deployment Namespace workspace Container
Registry #01 Build Stage GitLabͷProjectΛclone͠ DockerfileΛݩʹΠϝʔδϏϧυ
γεςϜ֓ཁ Developer Load Barancer Ingress Service Deployment Namespace workspace Container
Registry #01 Build Stage ϏϧυΠϝʔδΛGitLab Container RegistryʹPush
γεςϜ֓ཁ Developer Load Barancer Ingress Service Deployment Namespace workspace Container
Registry #02 Deploy Stage Runner͔ΒDeploy༻ͷίϯςφ Λىಈɻ Kubernetes APIΛ௨ͯ͡ Deploymentʹରͯ͠Rolling updateΛ໋ྩ
γεςϜ֓ཁ Developer Load Barancer Ingress Service Deployment Namespace Container Registry
ϏϧυΠϝʔδ͔ΒRolling updateΛ࣮ߦ
GitLab & GitLab CI • GitLabɺGitLab Container RegistryΛར༻ • CI/CDδϣϒKubernetes
executorͰ࣮ߦ • .gitlab-ci.ymlͰύΠϓϥΠϯΛఆٛ͠ɺ࣮ߦ͍ͨ͠ॲཧͱɺͦͷॲཧΛ ࣮ߦ͢ΔϕʔεΠϝʔδΛબʢServerlessͳײ֮ʣ • εςʔδຖʹtagΛࢦఆ͢Δ͜ͱͰɺDevelop/Staging/Productionͱ ͍ͬͨܗͰ࣮ߦڥΛ͚ΒΕΔ Build to develop stage: build only: - /^develop.*/ image: gcr.io/kaniko-project/executor:debug script: - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination …(লུ) tags: - develop .gitlab-ci.ymlͷҰ෦Λൈਮ
Kubernetes ExecutorΛͬͨPipeline • #01 Build Stage • Builderͱͯ͠dind(docker in docker)
͔ kanikoͷબ͕Մ • kanikoGoogle͕։ൃ͢ΔϏϧμʔɻKubernetes্ͰΠϝʔδ Ϗϧυ͢Δ͜ͱΛఆ͠privilegedແ͠ͰϏϧυՄ ɹɹhttps://github.com/GoogleContainerTools/kaniko • #02 Deploy Stage • Kubernetes client pythonͰ࡞ͨ͠ಠࣗπʔϧΛ༻ • Rolling update ຊ൪ͰͷB/G DeploymentɺRollbackʹର Ԡ
FeatureϒϥϯνରԠ • FeatureϒϥϯνΛ࡞͢Δ ͱͦΕʹରԠͨ͠Endpointͱ Service/DeploymentΛࣗಈ తʹߏ • GitLab CIͱ࿈ಈ͠ϒϥϯν໊ ʹԠͨ͡Development͕ߋ
৽͞ΕΔ Ingress Service Deployment Service Deployment Service Deployment a.com b.com c.com develop branch feature/a branch feature/b branch
։ൃϑϩʔ develop staging release master feature/a ֤ϒϥϯνͰͷCommitMerge୯ҐͰCI/CDΛ࣮ߦ ӡ༻Gitૢ࡞Ͱ݁ ϓϧϦΫΤετɺϨϏϡʔɺϚʔδ ͷϓϩηεΛճ͢ࣄʹूத
tag v1.1.0
• Push Code, Not Container • ӡ༻ϓϧϦΫΤετͰ࣮ߦ͞ΕΔ Weaveworks : Alexis
Richardsonࢯ • kubectlͷίϚϯυϥΠϯπʔϧΘͳ͍ʢGitૢ࡞ͷΈʣ • GitͱγεςϜͷঢ়ଶ͕ඞ͍ͣ͠ɺGitΛਅͱ͢Δߟ͑ • γεςϜΛGitཧ͢Δ GitOps
·ͱΊ • Kubernetes্ͷϦιʔε܈Load Balancer / GitLab Project ͷ࡞ΛAPIΛ௨ͯࣗ͡ಈԽ • Management
ConsoleΛఏڙ͠KubernetesΛநԽ • GitLab CIͱ࿈ܞ͠CI/CDΛ࣮ݱ • ӡ༻Gitૢ࡞Ͱ݁ͤ͞ಛผͳૢ࡞ෆཁ ୭Ͱ؆୯ʹ͑ΔϓϥοτϑΥʔϜͱͯ͠KubernetesΛ׆༻
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ