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
NYC Summit 2026 におけるAmazon Bedrock AgentCore のアップデート
ren8k
3
300
AIエージェントの知識表現と推論に なぜグラフが使われるのか - 記号的AIの復権とニューラルAIとの統合
yohei1126
1
250
DevOps Agentで運用判断をチーム資産にする~Agent InstructionsとAgent Skillを継続的に育てる~
fujioka6789
0
180
システム監視入門
grimoh
5
790
PLaMo 3.0 Primeの事後学習
pfn
PRO
0
240
脱Jenkins、インターン生が挑んだCIツールGitHubActions移行
mixi_engineers
PRO
1
300
組織にどうSREを根付かせるか?〜IVRyの場合〜
abnoumaru
0
240
reFACToring
moznion
1
1.1k
AI エージェント時代のデジタルアイデンティティ
fujie
2
1.3k
AI工学特論: MLOps・継続的評価
asei
11
3.1k
クラウドセキュリティ入門 ~安全なクラウド利用のための基礎知識~
lhazy
7
5.8k
事業成長とAI活用を止めないデータ基盤アーキテクチャの設計思想
hiracky16
0
790
Featured
See All Featured
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.7k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
350
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
600
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.2k
Prompt Engineering for Job Search
mfonobong
0
390
Automating Front-end Workflow
addyosmani
1370
210k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
430
Optimising Largest Contentful Paint
csswizardry
37
3.9k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Color Theory Basics | Prateek | Gurzu
gurzu
0
400
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Λ׆༻
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ