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
Kubernetesにおける学習基盤とLLMOpsの概要
ry
1
310
日本 Fintech 未来予測レポート 2027〜2028年(手動編集版)
8maki
0
2.3k
エラーバジェットのアラートのタイミングを考える.pdf
kairim0
0
150
自律型AIエージェントは何を破壊するのか
kojira
0
160
AIネイティブな開発のサプライチェーンリスク対策 〜激動の開発現場でリスクに立ち向かう〜【ZennFes】
cscengineer
PRO
2
130
連合学習と機密コンピューティング
lycorptech_jp
PRO
0
120
NAB Show 2026 動画技術関連レポート / NAB Show 2026 Report
cyberagentdevelopers
PRO
0
200
2026 TECHFRESH 畢業分享會 - AI-Native 重塑軟體工程與虛擬講師
line_developers_tw
PRO
0
1.1k
脆弱性対応、どこで線を引くか
rymiyamoto
1
390
LLMにもCAP定理があるという話
harukasakihara
0
380
AGENTS.mdとSkillsで始めるAIエージェント活用
sonoda_mj
3
210
やさしいA2A入門
minorun365
PRO
12
1.9k
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
141
7.5k
Google's AI Overviews - The New Search
badams
0
1k
Amusing Abliteration
ianozsvald
1
200
Faster Mobile Websites
deanohume
310
31k
RailsConf 2023
tenderlove
30
1.5k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
160
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
56k
The Invisible Side of Design
smashingmag
302
52k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
460
Testing 201, or: Great Expectations
jmmastey
46
8.2k
The agentic SEO stack - context over prompts
schlessera
0
820
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
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Λ׆༻
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ