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
Skaffoldを使ってKubernetes してみた/skaffold_k8s
Search
KOYAMA Tetsuji
June 16, 2018
Programming
2
1.3k
Skaffoldを使ってKubernetes してみた/skaffold_k8s
PHPカンファレンス福岡2018での発表に用いた資料です。
KOYAMA Tetsuji
June 16, 2018
Tweet
Share
More Decks by KOYAMA Tetsuji
See All by KOYAMA Tetsuji
全日本PHPカンファレンス2024スタンプラリーについて/stamprally-php2024
koyhoge
0
130
日本PHPカンファレンス2024スタンプラリーとその実装/phpcon-stamprally
koyhoge
1
1.1k
日本のPHPカンファレンスの歩みと、その辺もろもろ/phpcon_japan_history
koyhoge
0
250
Inside SWOOLE: 非同期処理はどのようにして動くのか/inside_swoole
koyhoge
0
18k
映画を年300本観る技術/watch_300_movies_in_a_year
koyhoge
0
1.2k
Swooleで実装するPHP非同期処理の世界/phpcondo2019-swoole
koyhoge
3
5.1k
CloudFormation と FaaS のはざま - Kubernetes の設計思想を探る -/cf-faas-k8s
koyhoge
0
1.4k
ITイベントマニアから見る技術イベントの動向/techevent
koyhoge
0
300
東京が大雪の日に何気ない写真がバズった/snow_tree_buzz
koyhoge
0
520
Other Decks in Programming
See All in Programming
たのしいparse.y
ydah
3
120
return文におけるstd::moveについて
onihusube
1
1.1k
Recoilを剥がしている話
kirik
5
6.8k
Mermaid x AST x 生成AI = コードとドキュメントの完全同期への道
shibuyamizuho
0
160
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
Zoneless Testing
rainerhahnekamp
0
120
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
260
testcontainers のススメ
sgash708
1
120
良いユニットテストを書こう
mototakatsu
8
2.6k
Haze - Real time background blurring
chrisbanes
1
510
ドメインイベント増えすぎ問題
h0r15h0
2
340
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
7
1.3k
Featured
See All Featured
BBQ
matthewcrist
85
9.4k
For a Future-Friendly Web
brad_frost
175
9.4k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
810
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
The Language of Interfaces
destraynor
154
24k
Optimizing for Happiness
mojombo
376
70k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Practical Orchestrator
shlominoach
186
10k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Agile that works and the tools we love
rasmusluckow
328
21k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
Transcript
PHPΧϯϑΝϨϯεԬ2018 2018-06-16 4LB⒎PMEΛͬͯ ,VCFSOFUFTͯ͠Έͨ খࢁࢤ !LPZIPHF
ࣗݾհ খࢁࢤ ͜·ͯͭ͡ ߹ಉձࣾ΄ٕ͛ݚ Ϣʔβձ͍͔ͭ͘ ຊ6/*9Ϣʔβձ ຊ1PTUHSF42-Ϣʔβձ ຊ1)1Ϣʔβձ SBLVNPגࣜձࣾΤϯδχΞ
!LPZIPHF LPZIPHF
w (4VJUF (NBJM (PPHMFΧϨϯμʔͳͲ ʹػೳՃ͠ ͯൢച w ಋೖ ࣾҎ্ w
IUUQTSBLVNPDPN w ࡢ(PPHMF$MPVE1MBUGPSN ($1 ͷύʔτφʔʹ
ࠓճͷ༰ w ,VCFSOFUFTͷྺ࢙ w ,VCFSOFUFTͷಛ w 4LB⒎PMEͷಛ w 4LB⒎PMEͷ͍ํ
,VCFSOFUFT w IUUQTLVCFSOFUFTJP w LTͱུ͞ΕΔ w ಡΈʮ͘ʔͶͯ͌͢ʯ w %PDLFS͚ΦʔέετϨʔγϣϯπʔϧ
ࠓճͷ༰ w ,VCFSOFUFTͷྺ࢙ w ,VCFSOFUFTͷಛ w 4LB⒎PMEͷಛ w 4LB⒎PMEͷ͍ํ
LTIJTUPSZ w (PPHMFͷࣾπʔϧͱͯ͠։ൃ։࢝ w (PPHMFͷ#PSH͔Βڧ͍ӨڹΛड͚ͨ1SPKFDU4FWFO w 4FWFO4UBS5SFL7PZBHFSͷ4FWFOPG/JOF͔Β w ϩΰͷຊεϙʔΫͷͷ༝དྷ w
ʹWϦϦʔε w ͦͷޙ$/$'ʹҠ #Z4PVSDF 81/'$$ 'BJSVTF IUUQTFOXJLJQFEJBPSHXJOEFYQIQ DVSJE
LT%PDLFS w %PDLFS$PO&6 w LTͷ%PDLFSͱ౷߹Λൃද w ࣄ্࣮ͷඪ४ΦʔέετϨʔγϣϯπʔϧʹ w ͦͷޙΫϥυք۾͕૽͕͘͠ͳΔ
w (PPHMF$POUBJOFS&OHJOF w ($1ͷ%PDLFSίϯςφӡ༻ϚωʔδυαʔϏε w ུশ(,& ($&$PNQVUF&OHJOFʹΘΕ͍ͯ ͨ w
(PPHMF,VCFSOFUFT&OHJOF (,& ʹվ໊ LTPO($1
w "[VSF$POUBJOFS4FSWJDF "$4 w ࠷ॳ"QBDIF.FTPTϕʔε w ෳͷΦʔέετϨʔγϣϯπʔϧΛαϙʔτ w "[VSF$POUBJOFS4FSWJDF
",4 w ,VCFSOFUFTϕʔε w "[VSF,VCFSOFUFT4FSWJDF ",4 ʹվ໊ LTPO"[VSF
w &MBTUJD$POUBJOFS4FSWJDFGPS,VSCFSOFUFT &,4 w &$4ͱ͍͏ಠࣗϚωʔδυαʔϏεΛ͢Ͱʹ͍ͬͯ ͨ w LTඪ४ͷྲྀΕΛड͚ͯαʔϏεՃ
LTPO"84
ࠓճͷ༰ w ,VCFSOFUFTͷྺ࢙ w ,VCFSOFUFTͷಛ w 4LB⒎PMEͷಛ w 4LB⒎PMEͷ͍ํ
w ʮγεςϜΛߏ͢ΔϓϥοτϑΥʔϜϛυϧΣΞɺ αʔϏεɺΞϓϦέʔγϣϯɺཧπʔϧͳͲͷઃఆ ཧΛࣗతʹ࿈ܞͤ͞Δ͜ͱɻʯ ;%/FU+BQBOΩʔϫʔυղઆΑΓ w ΦʔέετϨʔγϣϯͱͳʹ͔
w ༷ʑͳׂͷίϯςφΛΈ߹ΘͤͯαʔϏεΛ࡞Δͱ ͖ͷɺӡ༻ͷෳࡶੑΛղܾ͢Δ w (PPHMF͕#PSHΛӡ༻͖ͯͨ͠ͱ͖ͷݟ͕٧·ͬͯ ͍Δ LTԿΛղܾ͢Δͷ͔
w Πϛϡʔλϒϧ w એݴతઃఆ w ΦϯϥΠϯͰࣗݾճ෮͢Δ LTͷઃܭίϯηϓτ
w *NNVUBCJMJUZ w Ұ࡞ͨ͠Βมߋ͞Εͳ͍ w ඞཁʹԠͯ͡ಉ͡༰ͷίϯςφΛ͍ͭ͘ىಈͰ͖Δ Πϛϡʔλϒϧ
w ʮԿΛ͢Δ͔ʯͰͳ͘ʮͲ͏͋Δ͖͔ʯΛهड़͢Δ w ࠷ऴతͳ·͍͠ঢ়ଶΛॻ͘ એݴతઃఆ
w ·͍͠ঢ়ଶ͍ͬͯΔ w ܧଓతʹࢹ͠ɺ·͍͠ঢ়ଶʹͳ͍ͬͯͳ͔ͬͨΒͦΕ ʹҰக͢ΔΑ͏ʹಈ͖ଓ͚Δ ࣗݾճ෮͢Δ
apiVersion: v1 kind: Pod metadata: name: nginx spec: containers: -
name: nginx image: nginx:1.7.9 ports: - containerPort: 80 nginx-pod.yml
w Ϋϥελ w 1PE w 4FSWJDF w 3FQMJDB4FU w %BFNPO4FU
w +PC w %FQMPZNFOU w $POpH.BQ LTߏཁૉ
w Ϋϥελ w 1PE w 4FSWJDF w 3FQMJDB4FU w %BFNPO4FU
w +PC w %FQMPZNFOU w $POpH.BQ LTߏཁૉ
w LTڥΛߏ͢ΔϚγϯ܈ w %PDLFS͕ಈ͚ཧཧͲͪΒͰྑ͍ w ΫϥυαʔϏεͰཧը໘ͰϙνΔ͚ͩ Ϋϥελ
w ϫʔΫϩʔυ ίϯςφ ͕ಈ࡞͢Δཧϊʔυ w ෳͷϫʔΫϩʔυ͕ಈ࡞͢Δ߹͋Δ w ಉҰ1PEͷ߹ɺϑΝΠϧγεςϜͰίϯςφಉ࢜ ͕ΓऔΓ͢Δ͜ͱՄೳ 1PE
w ໊લղܾ w ෦Ͱ%/4͕ಈ͍͍ͯΔ w ֎෦ͷΤϯυϙΠϯτ࡞ 4FSWJDF
w αʔϏεҰࣜΛஔ͢ΔΈ w ࢮ׆ࢹ w ߏมߋɾΦʔτεέʔϧ w %PDLFSΠϝʔδͷߋ৽ w Ξοϓσʔτઓུ
%FQMPZNFOU
w LTཧίϚϯυ w جຊ͜ͷίϚϯυ͔Βͯ͢Λߦ͏ LVCFDUM
w IPHFZNMʹαʔϏεͷͯ͢Λॻ͘ํࣜ w ͍ͨΜγϯϓϧ w :".-Ͱ͔͗͢ σϓϩΠ $ kubectl apply
-f hoge.yml
ࠓճͷ༰ w ,VCFSOFUFTͷྺ࢙ w ,VCFSOFUFTͷಛ w 4LB⒎PMEͷಛ w 4LB⒎PMEͷ͍ํ
w IUUQTHJUIVCDPN(PPHMF$POUBJOFS5PPMT TLB⒎PME w ϫʔΫϑϩʔͷࣗಈԽπʔϧ w ·ͩΞϧϑΝ൛Ͱ࣮ݧతͳҐஔ͚ͮ w ࠷৽൛ʹϦϦʔε͞Εͨ 4LB⒎PME
w .BUU3JDLBSE͞Μ w IUUQTHJUIVCDPNSE w ($1ΤϯδχΞ w NJOJLVCFʹؔΘ͍ͬͯΔ ࡞ͬͨͷ͜ͷਓ
w ίϯςφϕʔε։ൃͷ$* w %PDLFSΠϝʔδͷ࡞ɺϨδετϦͷొɺσϓϩΠ ͷͦΕͧΕΛࣗಈԽ ԿΛղܾ͢Δͷ
None
w ։ൃ࣌ w ϏϧυϩʔΧϧͷEPDLFSCVJME w ొͳ͠ w σϓϩΠNJOJLVCFʹLVCFDUM w ຊ൪࣌
($1ͷ߹ w Ϗϧυ(PPHMF$POUBJOFS#VJMEFSʹ͛Δ w ొ(PPHMF$POUBJOFS3FHJTUSZʹొ͢Δ w σϓϩΠ(,&ʹLVCFDUM ྆ऀͷҧ͍
w ΠϝʔδSFQPͷλάΛࣗಈͰଧͬͯ͘ΕΔɻ w ։ൃ࣌ϑΝΠϧΛࢹͯ͠ɺมߋ͕͋ͬͨΒࣗಈͰσϓ ϩΠ·Ͱͬͯ͘ΕΔ ·ͩ͋Δศརػೳ
w #B[FM w IUUQTCB[FMCVJME w )FMN w IUUQTIFMNTI w LBOJLP
w IUUQTHJUIVCDPN(PPHMF$POUBJOFS5PPMTLBOJLP w LVTUPNJ[F w IUUQTHJUIVCDPNLVCFSOFUFTTJHTLVTUPNJ[F w ෳΠϝʔδͷରԠ NJDSPTFSWJDF ֤छπʔϧରԠ
ࠓճͷ༰ w ,VCFSOFUFTͷྺ࢙ w ,VCFSOFUFTͷಛ w 4LB⒎PMEͷಛ w 4LB⒎PMEͷ͍ํ
w TLB⒎PMEίϚϯυͷΠϯετʔϧ w ඞཁͳΒ LVCFDUM NJOJLVCFͷΠϯετʔϧ w ຊ൪σϓϩΠڥͷ༻ҙ ྫ(,& ͰͬͯΈΑ͏
w TLB⒎PMEHP w ֤ϓϥοτϑΥʔϜ༻όΠφϦΛ͍ͬͯΔͷͰࣗͰ Ϗϧυ͢Δඞཁͳ͍ w .BDͳΒ TLB⒎PMEίϚϯυ curl -Lo
skaffold https://storage.googleapis.com/skaffold/ releases/latest/skaffold-darwin-amd64 && chmod +x skaffold && sudo mv skaffold /usr/local/bin
w NBJOHPΛίϯύΠϧ࣮ߦ͢Δ͚ͩͷαϯϓϧ FYBNQMFTHFUUJOHTUBSUFE
NBJOHP package main import ( "fmt" "time" ) func main()
{ for { fmt.Println("Hello world!") time.Sleep(time.Second * 1) } }
%PDLFSpMF FROM golang:1.10.1-alpine3.7 as builder COPY main.go . RUN go
build -o /app main.go FROM alpine:3.7 CMD ["./app"] COPY --from=builder /app .
TLB⒎PMEZNM apiVersion: skaffold/v1alpha2 kind: Config build: artifacts: - imageName: gcr.io/myproj-koyhoge/skaffold-gcb
deploy: kubectl: manifests: - k8s-* profiles: - name: gcb build: googleCloudBuild: projectId: myproj-koyhoge
LTQPEZNM apiVersion: v1 kind: Pod metadata: name: getting-started spec: containers:
- name: getting-started image: gcr.io/myproj-koyhoge/skaffold-gcb
TLB⒎PMEEFW Ϗϧυ ొ σϓϩΠ
w ϑΝΠϧอଘͱಉ࣌ʹҰ࿈ͷ࡞ۀ͕࠶ͼߦΘΕΔ ͦͷ··ϑΝΠϧมߋ fmt.Println("Hello world!") Λ fmt.Println("Hello phpconfuk!")
w Ҏ্ɺऴྃ ຊ൪σϓϩΠ $ skaffold run
w ඪ४తͳ$*$%ͱόοςΟϯά͠ͳ͍ w ͱ͋Εͯ͢ΛίϯςφͰ·͔ͳ͏ࢼΈ໘ന͍ w ͜͜ͰഓΘΕ͍ͯΔݟɺผͷ$*$%ͷΈͰ׆ ͔ͤΔͩΖ͏ ࢼͯ͠ͷײ
w LTࠓͱͯΞπ͍ w TLB⒎PMEΛ͡Ίɺ͞·͟·ͳपลπʔϧ͕։ൃ͞Εɺ ৽͍͠ࢼΈ͕ߦΘΕ͍ͯΔ w αʔϏεͷ044ج൫ͱͯ͠ͷඪ४ʹͳΓͭͭ͋Δ ·ͱΊ