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
Kubernetes の API Client における キャッシュ設計 / Cache De...
Search
Takayuki Kasai
May 18, 2019
Technology
6
4.1k
Kubernetes の API Client における キャッシュ設計 / Cache Design in Kubernetes API Client
Go Conference 2019 Spring
Takayuki Kasai
May 18, 2019
Tweet
Share
More Decks by Takayuki Kasai
See All by Takayuki Kasai
スケジュールジョブ(CronJob)の実行失敗通知基盤における成功と失敗 / Success and failure in scheduled job execution failure notification infrastructure
unblee
0
48
DVC を活用した機械学習パイプライン開発の高速化 / Using DVC to accelerate machine learning pipeline development
unblee
3
2.9k
自作 Controller による Secret の配布と収集 / Distributing and collecting secrets with self-made controller
unblee
4
2.1k
Other Decks in Technology
See All in Technology
LINEスキマニにおけるフロントエンド開発
lycorptech_jp
PRO
0
300
Password-less Journey - パスキーへの移行を見据えたユーザーの準備 @ AXIES 2024
ritou
3
1.3k
新機能VPCリソースエンドポイント機能検証から得られた考察
duelist2020jp
0
120
リクルートのデータ基盤 Crois 年3倍成長!1日40,000コンテナの実行を支える AWS 活用とプラットフォームエンジニアリング
recruitengineers
PRO
2
310
Kubernetesトラフィックルーティング徹底解説/Kubernetes-traffic-deep-dive
oracle4engineer
PRO
5
1k
5分でわかるDuckDB
chanyou0311
9
3.1k
PHPからGoへのマイグレーション for DMMアフィリエイト
yabakokobayashi
1
130
KubeCon NA 2024 Recap: Managing and Distributing AI Models Using OCI Standards and Harbor / Kubernetes Meetup Tokyo #68
pfn
PRO
0
210
大幅アップデートされたRagas v0.2をキャッチアップ
os1ma
2
380
Oracle Database Release and Support Timelines 2024/12/11
wmo6hash
0
290
Snowflake女子会#3 Snowpipeの良さを5分で語るよ
lana2548
0
180
2024年のModern Data Stackを振り返ろう~分野別の目玉アップデート情報まとめ~
sagara
0
620
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
A designer walks into a library…
pauljervisheath
204
24k
Faster Mobile Websites
deanohume
305
30k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
How to Ace a Technical Interview
jacobian
276
23k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Become a Pro
speakerdeck
PRO
26
5k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Transcript
©2019 Wantedly, Inc. Kubernetes ͷ API Client ʹ͓͚Δ Ωϟογϡઃܭ Go
Conference 2019 Spring Takayuki Kasai (@unblee) Wantedly, Inc. 2019.5.18 -
©2019 Wantedly, Inc. !VOCMFF5BLBZVLJ,BTBJ *OGSBTUSVDUVSF&OHJOFFS 8BOUFEMZ *OD ৽ଔ
©2019 Wantedly, Inc. w (PQIFST$PEF3FBEJOH1BSUZʢࣾษڧձʣͰͷίʔυϦʔσΟϯά w αʔϏεج൫ͱͯ͠,VCFSOFUFTΛ༻͍ͯ͠Δ ςʔϚઃఆͷಈػ
©2019 Wantedly, Inc. w ,VCFSOFUFTͷΞʔΩςΫνϟͷಛ w ΞʔΩςΫνϟʹଇͬͨ"1*ϦΫΤετΛݮ͢ΔͨΊͷΩϟογϡઃܭ ࠓ͢͜ͱ
©2019 Wantedly, Inc. w ίϯςφӡ༻ΛࣗಈԽ͢ΔͨΊͷϓϥοτϑΥʔϜ w σϓϩΠɺΦʔτεέʔϧɺࣗݾճ෮ɺϦιʔε࠷దԽɺFUD w ෳͷখ͍͞αʔϏε͕ڠௐಈ࡞ͯ͠ػೳΛ࣮ݱ͍ͯ͠ΔࢄγεςϜ ,VCFSOFUFTͱ
IUUQTLVCFSOFUFTJP
©2019 Wantedly, Inc. /PEF /PEF ,VCFSOFUFTͷΞʔΩςΫνϟ .BTUFS
©2019 Wantedly, Inc. /PEF $POUBJOFS $POUSPMMFS $POUBJOFS $POUBJOFS $POUBJOFS /PEF
$POUBJOFS $POUSPMMFS $POUBJOFS $POUBJOFS $POUBJOFS ,VCFSOFUFTͷΞʔΩςΫνϟ .BTUFS "1*4FSWFS 4UBUF4UPSF
©2019 Wantedly, Inc. /PEF $POUBJOFS $POUSPMMFS $POUBJOFS $POUBJOFS $POUBJOFS /PEF
$POUBJOFS $POUSPMMFS $POUBJOFS $POUBJOFS $POUBJOFS ,VCFSOFUFTͷΞʔΩςΫνϟ .BTUFS "1*4FSWFS 4UBUF4UPSF $POUSPMMFS $POUSPMMFS 3FTPVSDFͷঢ়ଶΛ࣮ڥ্ʹөͤ͞Δ 3FTPVSDFૢ࡞ରΛநԽͨ֓͠೦ ίϯςφɺϩʔυόϥϯαɺFUD
©2019 Wantedly, Inc. /PEF $POUBJOFS $POUSPMMFS $POUBJOFS $POUBJOFS $POUBJOFS /PEF
$POUBJOFS $POUSPMMFS $POUBJOFS $POUBJOFS $POUBJOFS ,VCFSOFUFTͷΞʔΩςΫνϟ .BTUFS "1*4FSWFS 4UBUF4UPSF "1*4FSWFS 3FTPVSDFΛૢ࡞͢ΔͨΊͷ"1*&OEQPJOUΛఏڙ͢Δ 3FTPVSDFͷมߋΠϕϯτΛ௨͢ΔͨΊͷ8BUDI"1*ఏڙ͍ͯ͠Δ
©2019 Wantedly, Inc. /PEF $POUBJOFS $POUSPMMFS $POUBJOFS $POUBJOFS $POUBJOFS /PEF
$POUBJOFS $POUSPMMFS $POUBJOFS $POUBJOFS $POUBJOFS ,VCFSOFUFTͷΞʔΩςΫνϟ .BTUFS "1*4FSWFS 4UBUF4UPSF 4UBUF4UPSF 3FTPVSDFͷঢ়ଶઃఆɺൿಗใͱ͍ͬͨ ,VCFSOFUFTΛߏ͢ΔͨΊͷσʔλ͕อଘ͞Ε͍ͯΔ
©2019 Wantedly, Inc. /PEF $POUBJOFS $POUSPMMFS $POUBJOFS $POUBJOFS $POUBJOFS /P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SPMMFS/ͷؔ w ͭͷ3FTPVSDF0CKFDUΛૢ࡞͢Δ͚ͩͰෳͷ$POUSPMMFS͕ಈ࡞͢Δ w "1*ϦΫΤετ͕େྔʹൃߦ͞ΕΔ
©2019 Wantedly, Inc. େྔͷ"1*ϦΫΤετʹΑΔ ύϑΥʔϚϯεվળͷͨΊʹ࣮͞Εͨͷ w 3FGIUUQTLVCFSOFUFTJPCMPHLVCFSOFUFTQFSGPSNBODF NFBTVSFNFOUTBOE w "1*4FSWFSʹ8BUDI"1*ͱΩϟογϡػೳΛ࣮ͨ͠
w 8BUDI"1*ϕʔεͰಈ࡞͢ΔΑ͏ʹ$POUSPMMFSΛॻ͖͑ͨ w ෛՙʹΑͬͯ"1*&OEQPJOUͷϨεϙϯελΠϜ͕͘ͳΔ w ͕ͯ͢"1*ʹΑ੍ͬͯޚ͞Ε͍ͯΔͷͰɺશମతͳಈ࡞͕ॏ͘ͳΔ
©2019 Wantedly, Inc. $POUSPMMFSʹ͓͚ΔΩϟογϡઃܭͷ֓ཁ "1*4FSWFS *OGPSNFS -JTU 8BUDI FWFOUT 1PQBPCKFDUGSPNRVFVF
"EEUIFPCKFDU /PUJGZFWFOU $IBOHFUIFTUBUFPGUIFPCKFDU (FUUIFPCKFDUGSPNDBDIFTUPSF DMJFOUHP 6TFS )BOEMFS $BDIF4UPSF 0CKFDU 0CKFDU 0CKFDU/ 3FqFDUPS 2VFVF ᶈ ᶃ ᶄ ᶅ ᶆ ᶇ ,VCFSOFUFT"1*$MJFOU1BDLBHFҎԼʹΩϟογϡػߏ͕ఏڙ͞Ε͍ͯΔ IUUQTHPEPDPSHLTJPDMJFOUHPUPPMTDBDIF w $POUSPMMFSͰར༻͞Ε͍ͯΔ w 8BUDI"1*ΛલఏʹΩϟογϡػߏΛߏங͍ͯ͠Δ w ىಈ࣌ʹͯ͢ͷΦϒδΣΫτΛΩϟογϡͯ͠ $POUSPMMFSΩϟογϡ͔ΒΦϒδΣΫτΛऔಘͰ͖Δ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U 0CKFDU 0CKFDU/ 3FqFDUPS 2VFVF ᶈ ᶃ ᶄ ᶅ ᶆ ᶇ "1*4FSWFS (FUBMMUBSHFUSFTPVSDFPCKFDUT $BDIF4UPSF 0CKFDU 0CKFDU 0CKFDU/ 3FqFDUPS 2VFVF ᶃ EFQMPZNFOUDPOUSPMMFSʹ͓͚ΔΩϟογϡར༻ ᶄ $BDIFBMMPCKFDUT %FQMPZNFOU 3FQMJDB4FU 1PE %FQMPZNFOU 3FQMJDB4FU 1PE type Deployment struct { metav1.TypeMeta metav1.ObjectMeta Spec DeploymentSpec Status DeploymentStatus } IUUQTHPEPDPSHLTJPBQJBQQTW%FQMPZNFOU
©2019 Wantedly, Inc. EFQMPZNFOUDPOUSPMMFSʹ͓͚ΔΩϟογϡར༻ "1*4FSWFS *OGPSNFS -JTU 8BUDI FWFOUT 1PQBPCKFDUGSPNRVFVF
"EEUIFPCKFDU /PUJGZFWFOU $IBOHFUIFTUBUFPGUIFPCKFDU (FUUIFPCKFDUGSPNDBDIFTUPSF DMJFOUHP 6TFS )BOEMFS $BDIF4UPSF 0CKFDU 0CKFDU 0CKFDU/ 3FqFDUPS 2VFVF ᶈ ᶃ ᶄ ᶅ ᶆ ᶇ "1*4FSWFS (FUBMMUBSHFUSFTPVSDFPCKFDUT $BDIF4UPSF 0CKFDU 0CKFDU 0CKFDU/ 3FqFDUPS 2VFVF ᶃ EFQMPZNFOUDPOUSPMMFSʹ͓͚ΔΩϟογϡར༻ ᶄ $BDIFBMMPCKFDUT %FQMPZNFOU 3FQMJDB4FU 1PE %FQMPZNFOU 3FQMJDB4FU 1PE type Lister interface { List(options metav1.ListOptions) (runtime.Object, error) } type Watcher interface { Watch(options metav1.ListOptions) (watch.Interface, error) } type ListerWatcher interface { Lister Watcher } IUUQTHPEPDPSHLTJPDMJFOUHPUPPMTDBDIF-JTUFS8BUDIFS IUUQTHPEPDPSHLTJPDMJFOUHPUPPMTDBDIF-JTUFS IUUQTHPEPDPSHLTJPDMJFOUHPUPPMTDBDIF8BUDIFS
©2019 Wantedly, Inc. EFQMPZNFOUDPOUSPMMFSʹ͓͚ΔΩϟογϡར༻ "1*4FSWFS *OGPSNFS -JTU 8BUDI FWFOUT 1PQBPCKFDUGSPNRVFVF
"EEUIFPCKFDU /PUJGZFWFOU $IBOHFUIFTUBUFPGUIFPCKFDU (FUUIFPCKFDUGSPNDBDIFTUPSF DMJFOUHP 6TFS )BOEMFS $BDIF4UPSF 0CKFDU 0CKFDU 0CKFDU/ 3FqFDUPS 2VFVF ᶈ ᶃ ᶄ ᶅ ᶆ ᶇ EFQMPZNFOUDPOUSPMMFSʹ͓͚ΔΩϟογϡར༻ return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1().Deployments(namespace).List(options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1().Deployments(namespace).Watch(options) }, }, &appsv1.Deployment{}, resyncPeriod, indexers, ) IUUQTHJUIVCDPNLVCFSOFUFTDMJFOUHPCMPCCEGCFDCCF⒎EDDBJOGPSNFSTBQQTWEFQMPZNFOUHP--
©2019 Wantedly, Inc. EFQMPZNFOUDPOUSPMMFSʹ͓͚ΔΩϟογϡར༻ "1*4FSWFS *OGPSNFS 8BUDIUBSHFUSFTPVSDFFWFOUT 1PQBPCKFDUGSPNRVFVF "EEUIFPCKFDU /PUJGZFWFOU
$IBOHFUIFTUBUFPGUIFPCKFDU (FUUIFPCKFDUGSPNDBDIFTUPSF DMJFOUHP 6TFS )BOEMFS $BDIF4UPSF 0CKFDU 0CKFDU 0CKFDU/ 3FqFDUPS 2VFVF ᶈ ᶃ ᶄ ᶅ ᶆ ᶇ %FQMPZNFOU 3FQMJDB4FU 1PE %FQMPZNFOU 3FQMJDB4FU 1PE EFQMPZNFOUDPOUSPMMFSʹ͓͚ΔΩϟογϡར༻ શମ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U 1PE EFQMPZNFOUDPOUSPMMFSʹ͓͚ΔΩϟογϡར༻ )BOEMFS͕ΠϕϯτͱΦϒδΣΫτͷঢ়ଶʹԠͯ͡ૢ࡞Λߦ͏ *OGPSNFS $BDIF4UPSF 0CKFDU 0CKFDU 0CKFDU/ %FQMPZNFOU 3FQMJDB4FU 1PE /PUJGZFWFOU (FUUIFPCKFDUGSPNDBDIFTUPSF )BOEMFS ᶆ ᶇ %FQMPZNFOU 3FQMJDB4FU 1PE
©2019 Wantedly, Inc. EFQMPZNFOUDPOUSPMMFSʹ͓͚ΔΩϟογϡར༻ "1*4FSWFS *OGPSNFS 8BUDIUBSHFUSFTPVSDFFWFOUT 1PQBPCKFDUGSPNRVFVF "EEUIFPCKFDU /PUJGZFWFOU
$IBOHFUIFTUBUFPGUIFPCKFDU (FUUIFPCKFDUGSPNDBDIFTUPSF DMJFOUHP 6TFS )BOEMFS $BDIF4UPSF 0CKFDU 0CKFDU 0CKFDU/ 3FqFDUPS 2VFVF ᶈ ᶃ ᶄ ᶅ ᶆ ᶇ %FQMPZNFOU 3FQMJDB4FU 1PE %FQMPZNFOU 3FQMJDB4FU 1PE EFQMPZNFOUDPOUSPMMFSʹ͓͚ΔΩϟογϡར༻ )BOEMFS %FQMPZNFOU 3FQMJDB4FU 1PE type ResourceEventHandler interface { OnAdd(obj interface{}) OnUpdate(oldObj, newObj interface{}) OnDelete(obj interface{}) } IUUQTHPEPDPSHLTJPDMJFOUHPUPPMTDBDIF3FTPVSDF&WFOU)BOEMFS $BDIF4UPSF 0CKFDU 0CKFDU 0CKFDU/ %FQMPZNFOU 3FQMJDB4FU 1PE (FUUIFPCKFDUGSPNDBDIFTUPSF ᶇ
©2019 Wantedly, Inc. EFQMPZNFOUDPOUSPMMFSʹ͓͚ΔΩϟογϡར༻ "1*4FSWFS *OGPSNFS 8BUDIUBSHFUSFTPVSDFFWFOUT 1PQBPCKFDUGSPNRVFVF "EEUIFPCKFDU /PUJGZFWFOU
$IBOHFUIFTUBUFPGUIFPCKFDU (FUUIFPCKFDUGSPNDBDIFTUPSF DMJFOUHP 6TFS )BOEMFS $BDIF4UPSF 0CKFDU 0CKFDU 0CKFDU/ 3FqFDUPS 2VFVF ᶈ ᶃ ᶄ ᶅ ᶆ ᶇ %FQMPZNFOU 3FQMJDB4FU 1PE %FQMPZNFOU 3FQMJDB4FU 1PE EFQMPZNFOUDPOUSPMMFSʹ͓͚ΔΩϟογϡར༻ func (dc *DeploymentController) syncDeployment(key string) error { namespace, name, err := cache.SplitMetaNamespaceKey(key) deployment, err := dc.dLister.Deployments(namespace).Get(name) d := deployment.DeepCopy() if reflect.DeepEqual(d.Spec.Selector, &everything) { dc.eventRecorder.Eventf(d, v1.EventTypeWarning, "SelectingAll", "This deployment is selecting all pods. A non- empty selector is required.") if d.Status.ObservedGeneration < d.Generation { d.Status.ObservedGeneration = d.Generation dc.client.AppsV1().Deployments(d.Namespace).UpdateStatus(d) } return nil } rsList, err := dc.getReplicaSetsForDeployment(d) podMap, err := dc.getPodMapForDeployment(d, rsList) if getRollbackTo(d) != nil { return dc.rollback(d, rsList) } scalingEvent, err := dc.isScalingEvent(d, rsList) switch d.Spec.Strategy.Type { case apps.RecreateDeploymentStrategyType: return dc.rolloutRecreate(d, rsList, podMap) case apps.RollingUpdateDeploymentStrategyType: return dc.rolloutRolling(d, rsList) } } IUUQTHJUIVCDPNLVCFSOFUFTLVCFSOFUFTCMPCBGGFFCFFCGBFFGFDQLHDPOUSPMMFSEFQMPZNFOUEFQMPZNFOU@DPOUSPMMFSHP--
©2019 Wantedly, Inc. EFQMPZNFOUDPOUSPMMFSʹ͓͚ΔΩϟογϡར༻ "1*4FSWFS *OGPSNFS 8BUDIUBSHFUSFTPVSDFFWFOUT 1PQBPCKFDUGSPNRVFVF "EEUIFPCKFDU /PUJGZFWFOU
$IBOHFUIFTUBUFPGUIFPCKFDU (FUUIFPCKFDUGSPNDBDIFTUPSF DMJFOUHP 6TFS )BOEMFS $BDIF4UPSF 0CKFDU 0CKFDU 0CKFDU/ 3FqFDUPS 2VFVF ᶈ ᶃ ᶄ ᶅ ᶆ ᶇ 3FQMJDB4FU 1PE %FQMPZNFOU 3FQMJDB4FU 1PE EFQMPZNFOUDPOUSPMMFSʹ͓͚ΔΩϟογϡར༻ %FQMPZNFOU EFQMPZNFOUDPOUSPMMFSʹ͓͚ΔΩϟογϡར༻ "1*4FSWFSʹૢ࡞ޙͷΦϒδΣΫτΛ1045͢Δ )BOEMFS "1*4FSWFS %FQMPZNFOU 3FQMJDB4FU 1PE 3FQMJDB4FU 1PE $IBOHFUIFTUBUFPGUIFPCKFDU ᶈ
©2019 Wantedly, Inc. $POUSPMMFSʹ͓͚ΔΩϟογϡઃܭͷ֓ཁ "1*4FSWFS *OGPSNFS -JTU 8BUDI FWFOUT 1PQBPCKFDUGSPNRVFVF
"EEUIFPCKFDU /PUJGZFWFOU $IBOHFUIFTUBUFPGUIFPCKFDU (FUUIFPCKFDUGSPNDBDIFTUPSF DMJFOUHP 6TFS )BOEMFS $BDIF4UPSF 0CKFDU 0CKFDU 0CKFDU/ 3FqFDUPS 2VFVF ᶈ ᶃ ᶄ ᶅ ᶆ ᶇ
©2019 Wantedly, Inc. w ,VCFSOFUFTͰ"1*DMJFOUQBDLBHFʹΩϟογϡػߏ͕࣮͞Ε͍ͯΔ w ͭͷσʔλมߋ͕ಉ࣌ʹෳՕॴʹӨڹΛ༩͑ΔΞʔΩςΫνϟʹ͓͍ͯ ΦϒδΣΫτͷঢ়ଶΛΩϟογϡ͢Δઃܭ͕"1*ϦΫΤετͷݮʹ༗ޮ w ,VCFSOFUFTͷΑ͏ͳେن044ͰݸʑͷύοέʔδΛಡΜͰΈΔͱ໘ന͍
·ͱΊ
©2019 Wantedly, Inc. એ ຖि݄༵.JDSPTFSWJDFT.POEBZ IUUQTXXXXBOUFEMZDPNQSPKFDUT IUUQTHJUIVCDPNXBOUFEMZNJDSPTFSWJDFT@NPOEBZ ຖिਫ༵(PQIFST$PEF3FBEJOH1BSUZ IUUQTHJUIVCDPNXBOUFEMZHPQIFSTDPEFSFBEJOHQBSUZJTTVFT ؾʹͳΔਓΛ͔͚͍ͯͩ͘͞