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
61
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
3年でバックエンドエンジニアが5倍に増えても破綻しなかったアーキテクチャ そして、これから / Software architecture that scales even with a 5x increase in backend engineers in 3 years
euglena1215
11
4.3k
OPENLOGI Company Profile for engineer
hr01
1
18k
自社 200 記事を元に整理した読みやすいテックブログを書くための Tips 集
masakihirose
1
230
三菱電機で社内コミュニティを立ち上げた話
kurebayashi
1
320
ネットワーク可視化の世界
likr
7
5.7k
チームが毎日小さな変化と適応を続けたら1年間でスケール可能なアジャイルチームができた話 / Building a Scalable Agile Team
kakehashi
1
180
今年一年で頑張ること / What I will do my best this year
pauli
1
190
🌏丸い地球を効率的に平たくする 〜🗺️地図の幾何学とWeb地図技術〜
syotasasaki593876
0
120
駆け出しリーダーとしての第一歩〜開発チームとの新しい関わり方〜 / Beginning Journey as Team Leader
kaonavi
0
100
アジャイルチームが変化し続けるための組織文化とマネジメント・アプローチ / Agile management that enables ever-changing teams
kakehashi
3
3k
.NET AspireでAzure Functionsやクラウドリソースを統合する
tsubakimoto_s
0
150
Cloudflareで実現する AIエージェント ワークフロー基盤
kmd09
0
240
Featured
See All Featured
Practical Orchestrator
shlominoach
186
10k
Writing Fast Ruby
sferik
628
61k
Being A Developer After 40
akosma
89
590k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
860
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
560
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.2k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.3k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Documentation Writing (for coders)
carmenintech
67
4.5k
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 $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ͯ͠Δ w 3FTPVSDFͱ$POUSPMMFS/ͷؔ 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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FS )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 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 EFQMPZNFOUDPOUSPMMF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ογϡར༻ 3FqFDUPS 2VFVF *OGPSNFS͕3FqFDUPS͕ड͚औͬͨΦϒδΣΫτΛΩϟογϡʹՃ͢Δ *OGPSNFS 1PQBPCKFDUGSPNRVFVF "EEUIFPCKFDU $BDIF4UPSF 0CKFDU 0CKFDU 0CKFDU/ ᶄ ᶅ %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ʹ͓͚ΔΩϟογϡར༻ $BDIF4UPSF 0CKFDU 0CKFDU 0CKFDU/ %FQMPZNFOU 3FQMJDB4FU 1PE type ThreadSafeStore interface type threadSafeMap struct { items map[string]interface{} } IUUQTHPEPDPSHLTJPDMJFOUHPUPPMTDBDIF5ISFBE4BGF4UPSF
©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͕ΠϕϯτͱΦϒδΣΫτͷঢ়ଶʹԠͯ͡ૢ࡞Λߦ͏ *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 ؾʹͳΔਓΛ͔͚͍ͯͩ͘͞