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
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.1k
Improve Docker Image by BuildKit
govargo
4
1.7k
Debugging for MicroService on Kubernetes
govargo
2
830
Other Decks in Programming
See All in Programming
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
250
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
870
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
1
500
海上で動くGoサーバー: goroutineとchannelでさばく航行データストリーム
atsuki_seo
0
870
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
420
Agents on Rails - Rails at Scale 2026
irinanazarova
0
140
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
110
AWS DevOps Agentで インシデント対応をAIに任せたい
honmarkhunt
7
3.1k
新卒PdEのリアル
ryu1013
1
510
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
350
Webの地図
yosuke_furukawa
PRO
6
4.7k
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
5
8k
Featured
See All Featured
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
700
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.1k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
500
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
530
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
470
A Soul's Torment
seathinner
8
3.6k
Done Done
chrislema
186
17k
Design in an AI World
tapps
1
330
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
340
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
280
For a Future-Friendly Web
brad_frost
183
10k
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