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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
yuhara
December 05, 2018
Technology
900
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
どうして今サーバーサイドKotlinを選択したのか
nealle
0
210
Why is RC4 still being used?
tamaiyutaro
0
310
DMM.com 購入改善推進チーム におけるCodeRabbitを用いた レビューフロー改善の一例
ysknsid25
1
520
認証認可だけじゃない! ID管理の構成要素と ライフサイクルを意識しよう
ritou
1
520
cccccc
moznion
0
1.8k
Mastraエージェント、どのクラウドにデプロイする?
minorun365
PRO
2
170
攻撃者がいなくてもAIエージェントはインシデントを起こす
nomizone
0
200
ZOZOTOWNの進化と信頼性を両立する負荷試験
zozotech
PRO
0
140
AIDLC_ヤフーショッピングの取り組み
lycorptech_jp
PRO
0
560
AIで政治は変わるのか? — 中高生と考えたAI時代の民主主義(東海高校サタデープログラム)
eitarosuda
0
400
キャリアの中で本を作る / Making a Book During Your Career
ak1210
0
120
そのタスクオンスケですか?
poropinai1966
0
140
Featured
See All Featured
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
1.9k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
880
Odyssey Design
rkendrick25
PRO
2
730
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
260
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
340
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
New Earth Scene 8
popppiees
3
2.4k
Paper Plane
katiecoart
PRO
1
52k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
320
Designing for Timeless Needs
cassininazir
1
280
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Λ׆༻
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ