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
Admission Webhookで快適なSecret管理 / Berglas Secret ...
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
go_vargo
December 18, 2019
Programming
3.8k
5
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Admission Webhookで快適なSecret管理 / Berglas Secret Admission Webhook
go_vargo
December 18, 2019
More Decks by go_vargo
See All by go_vargo
Kubernetes Internal #9 - Minikube
govargo
0
360
気をつけたいKubernetesとの付き合い方 / Happy Kubernetes Life
govargo
6
3k
[CNDT2020]Linux Observability with BPF Performance Tools
govargo
15
3.7k
[CNDK2019]Production Ready Kubernetesに必要な15のこと / Production Ready Kubernetes 15 Rules
govargo
38
16k
ゼロから始めるKubernetes Controller / Under the Kubernetes Controller
govargo
40
16k
Inside of Kubernetes Controller
govargo
20
12k
コロプラが実践しているSpinnakerを用いたデプロイ戦略 / Deploy Strategy with Spinnaker at Colopl
govargo
6
5.2k
Improve Docker Image by BuildKit
govargo
4
1.8k
Debugging for MicroService on Kubernetes
govargo
2
840
Other Decks in Programming
See All in Programming
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
270
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
140
ジョジョの世界をXRで再現する
mofurune
0
140
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
260
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
5.7k
mrbgem 三角測量 開発
ogom
0
220
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
580
速習iPhone Duo対応
yuukiw00w
2
970
GitHubハンズオン講座 — 実務レベルのチーム開発のフローを身につけよう
junhat6
0
120
dotNET_vulnclicker_intro.pdf
deka_morita
0
130
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
350
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2k
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Darren the Foodie - Storyboard
khoart
PRO
4
4k
Un-Boring Meetings
codingconduct
0
450
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
450
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
66k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
Deep Space Network (abreviated)
tonyrice
0
360
Amusing Abliteration
ianozsvald
1
330
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
490
Transcript
Admission Webhook ͰշదͳSecretཧ 2019/12/18 Kubernetes Invitational Meetup Tokyo #4
Admission Webhookͱʁ
Admission Control Admission ControlೝূɾೝՄͷޙʹɺAPI RequestΛ มߋ(Mutate)ɾݕূ(Validate)Ͱ͖ΔΈ )551 )BOEMFS "VUIFOUJDBUF "VUIPSJ[F
.VUBUF "ENJTTJPO 4DIFNF 7BMJEBUJPO 7BMJEBUF "ENJTTJPO ɾɾɾ
Admission Control Admission ControlೝূɾೝՄͷޙʹɺAPI RequestΛ มߋ(Mutate)ɾݕূ(Validate)Ͱ͖ΔΈ )551 )BOEMFS "VUIFOUJDBUF "VUIPSJ[F
.VUBUF "ENJTTJPO 4DIFNF 7BMJEBUJPO 7BMJEBUF "ENJTTJPO ɾɾɾ
LVCFBQJTFSWFS 3FTPVSDF)BOEMFS .VUBUJOH 8FCIPPL 7BMJEBUJOH 8FCIPPL "ENJTTJPO8FCIPPL ʜ ʜ ʜ
ʜ "ENJTTJPO ʜ ʜ 7BMJEBUJPO Admission Webhook ҙͷॲཧΛWebServer ͷHookͱͯ͠ՃͰ͖Δ
ࠓճ࡞ͬͨAdmission Webhook
Berglas Secret Admission Webhook GCPͷSecretཧπʔϧͰ͋Δ BerglasΛͬͯɺಁաతͳSecretཧΛ࣮ݱ
࡞ͬͨAdmission Webhookͷత త: SecretͷཧͰɺGit্ʹSecretͷValueΛ͞ͳ͍ Α͏ʹ͍ͨ͠ɻGCP্ͷSecretཧʹBerglasΛ ͍ͬͯΔͷͰɺBerglasΛK8sͰ׆༻͍ͨ͠ɻ apiVersion: v1 kind: Secret
metadata: name: database_secret data: PASS: cGFzc3dvcmQ= $ echo cGFzc3dvcmQ= | base64 --decode password : ͨͩͷBase64Τϯίʔυͩͱ ͙͢ʹσίʔυͰ͖ͯ͠·͏ ࡞ͬͨAdmission Webhook: Berglas্ʹ࡞ͬͨSecretΛɺK8s্ʹ෮߸ͯ͘͠ΕΔ → YAML୭͕ݟͯͳ͍Α͏ʹ͢Δ
Berglas BerglasGoogle Cloud Platform্ͰSecret(ൿີใ)Λ ཧ͢ΔͨΊͷCLIπʔϧɻ Cloud KMSʹ͋Δ伴ΛͬͯɺBerlgasͰSecretΛ҉߸ Խɾ෮߸ԽͰ͖Δ (※K8s SecretͱผͳͷͰҙ)
Key Management Service Cloud Storage #FSHMBT ҉߸ʹར༻ Secretσʔλ͕࡞ΒΕΔ berglas create <BUCKET>/<KEY> <VALUE> Encrypt
Berglas BerglasGoogle Cloud Platform্ͰSecret(ൿີใ)Λ ཧ͢ΔͨΊͷCLIπʔϧɻ Cloud KMSʹ͋Δ伴ΛͬͯɺBerlgasͰSecretΛ҉߸ Խɾ෮߸ԽͰ͖Δ (※K8s SecretͱผͳͷͰҙ)
Key Management Service Cloud Storage #FSHMBT ෮߸ʹར༻ SecretσʔλΛࢀর berglas access <BUCKET>/<KEY> Decrypt
Admission Webhook࡞ʹͬͨͷ Kubewebhook: Admission WebhookΛ࡞ΔͨΊͷϑϨʔϜϫʔΫ AdmissionReview, AdmissionResponseͱ͍ͬͨɺ Admission Webhookʹඞཁͳ෦Λड͚࣋ͬͯ͘ΕΔ ར༻ऀMutateؔͱValidateؔͷ࣮ʹूதͰ͖Δ
Berglas API: https://github.com/slok/kubewebhook https://github.com/GoogleCloudPlatform/berglas SampleͰCloud FunctionΛར༻ͨ͠Admission Webhookͷ ྫ͋Δ͕ɺ༻్͕ҟͳͬͨͷͰࠓճWebhookΛࣗ࡞ https://github.com/GoogleCloudPlatform/berglas/tree/master/examples/kubernetes
Berglas Secret Admission Webhook SecretΛ࡞͢Δͱɺʮberglas://ʙʯͱ͍͏ϦϑΝϨϯε ͕͋Δͷɺಁաతʹ෮߸Խ͢Δ(ͦΕҎ֎εΩοϓ) ᶃ kubectl apply -f
secret.yaml Mutating Webhook Server Validating Webhook Server #FSHMBT apiVersion: v1 kind: Secret metadata: name: database_secret data: PASS: berglas://BUCKET/pass ᶄ Admission Webhook ᶅ Mutate ᶇ Validate ᶆ Decode
ϋϚͬͨͱ͜Ζ
Managed K8sͰಈ͔ͳ͍(ͱצҧ͍ͯͨ͠) Admission Webhook cannot work on private GKE clusters
https://github.com/elastic/cloud-on-k8s/issues/1437 443ϙʔτҎ֎ͰɺWebhook ServerΛಈ͔͍ͯ͠Δͱɺ Webhook ServerͷPod·ͰAPI Request͕౸ୡ͠ͳ͍ɻ GKEͰΤϯυϙΠϯτIPʹ௨৴͢Δ͕ɺ443(HTTPS), 10250(Kubelet)ͷϙʔτ͔͠ڐՄ͞Ε͍ͯͳ͍ͨΊ Webhook Server Master VPC Worker VPC Port: 443 ڐՄ ※443Ҏ֎ͷ߹ɺϑΝΠΞΥʔϧͷ݀։͚͕ඞཁ
ࢀߟʹ͢Δͱྑ͍ͷ Admission Webhooks: Configuration and Debugging Best Practices - Haowei
Cai, Google https://kccncna19.sched.com/event/UaVt/admission-webhooks-configuration-and-debugging-best- practices-haowei-cai-google
Thank you