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
プロダクションレディ Pods / Production-Ready Pods
Search
Kazuki Suda
December 20, 2017
Technology
5
1.8k
プロダクションレディ Pods / Production-Ready Pods
市ヶ谷Geek★Night #16 Kubernetes Christmas! /
https://ichigayageek.connpass.com/event/74057/
Kazuki Suda
December 20, 2017
Tweet
Share
More Decks by Kazuki Suda
See All by Kazuki Suda
個人的、Kubernetes の最新注目機能! (2024年5月版)
superbrothers
0
67
Kubernetes + containerd で cgroup v2 に移行したら "failed to create fsnotify watcher" エラーが発生する原因と対策
superbrothers
0
1.2k
Kubernetes にこれから入るかもしれない注目機能!(2022年11月版)
superbrothers
2
1.4k
コミュニティ/ 勉強会紹介
superbrothers
0
210
高可用性、省力運用を目指す 自宅 Kubernetes クラスタ (K8s@home #1)
superbrothers
12
5.1k
KubeCon + CloudNativeCon Europe 2022 Recap
superbrothers
0
48
独断と偏見で選んだ Kubernetes 1.24 の注目機能と今後!
superbrothers
2
7.4k
わかる!metadata.managedFields
superbrothers
4
1.9k
Local ephemeral-storage のメトリクスを取得するのに kube-summary-exporter がべんり / kube-summary-exporter is useful to get the metrics of local ephemeral-storage
superbrothers
0
620
Other Decks in Technology
See All in Technology
なぜ今 AI Agent なのか _近藤憲児
kenjikondobai
4
1.4k
【令和最新版】AWS Direct Connectと愉快なGWたちのおさらい
minorun365
PRO
5
760
[CV勉強会@関東 ECCV2024 読み会] オンラインマッピング x トラッキング MapTracker: Tracking with Strided Memory Fusion for Consistent Vector HD Mapping (Chen+, ECCV24)
abemii
0
230
【Startup CTO of the Year 2024 / Audience Award】アセンド取締役CTO 丹羽健
niwatakeru
0
1.3k
New Relicを活用したSREの最初のステップ / NRUG OKINAWA VOL.3
isaoshimizu
3
630
SRE×AIOpsを始めよう!GuardDutyによるお手軽脅威検出
amixedcolor
0
180
Adopting Jetpack Compose in Your Existing Project - GDG DevFest Bangkok 2024
akexorcist
0
110
アジャイルでの品質の進化 Agile in Motion vol.1/20241118 Hiroyuki Sato
shift_evolve
0
170
日経電子版のStoreKit2フルリニューアル
shimastripe
1
140
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
300
OCI Security サービス 概要
oracle4engineer
PRO
0
6.5k
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
180
Featured
See All Featured
Making Projects Easy
brettharned
115
5.9k
It's Worth the Effort
3n
183
27k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
10 Git Anti Patterns You Should be Aware of
lemiorhan
655
59k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
130
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Why Our Code Smells
bkeepers
PRO
334
57k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
Transcript
䋐٠靼(FFLӹ/JHIU ,B[VLJ4VEBLTVEB![MBCDPKQ !TVQFSCSPUIFST ϓϩμΫγϣϯϨσΟ Pods
,B[VLJ4VEB!TVQFSCSPUIFST Ӝ اؿزؐؑ،ؒٝآص،!;-BC Ӝ ,VCFSOFUFT.FFUVQ5PLZP⚺⪵
،آؑٝت 1PETהכ⡦ַ فٗتؙءّٖٝر؍1PET
1PETהכ⡦ַ
Ӝ 醱侧ך؝ٝذشה醱侧ךنُٔ٦ي Ӝ رفٗ؎ך剑㼭⽃⡘ Ӝ *1QFS1PE 1PET 1PE Volume 8FCTFSWFS
'JMF1VMMFS
apiVersion: v1 kind: Pod metadata: name: nginx spec: containers: -
name: nginx image: nginx:1.13.7 ports: - containerPort: 80 Ӝ 醱侧ך؝ٝذشה醱侧ךنُٔ٦ي Ӝ رفٗ؎ך剑㼭⽃⡘ Ӝ *1QFS1PE 1PET
1PEٓ؎ؿ؟؎ؙٕ 3VOOJOH 5FSNJOBUJOH 4DIFEVMJOH
فٗتؙءّٖٝر؍1PET
#VJMEJOH $POUBJOFST Ӝ 5IF5XFMWF'BDUPS"QQ Ӝ 㼭ְׁك٦أ؎ً٦آ⢪ֲ Ӝ ♶銲זػح؛٦آ؎ٝأز٦ٕ׃זְ NVMUJTUBHFCVJMET Ӝ
فٗإأ؝ٝذش Ӝ ؚٗכTUEPVU TUEFSSח⳿⸂ׅ
NVMUJTUBHFCVJMET 6TFNVMUJTUBHFCVJMET]%PDLFS%PDVNFOUBUJPO FROM golang:1.7.3 WORKDIR /go/src/github.com/alexellis/href-counter/ RUN go get -d
-v golang.org/x/net/html COPY app.go . RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app . FROM alpine:latest RUN apk --no-cache add ca-certificates WORKDIR /root/ COPY --from=0 /go/src/github.com/alexellis/href-counter/app . CMD ["./app"]
㹋遤ח䗳銲זٔا٦أָ婍גְזְظ٦سחأ؛آُ٦ٕ ׁג׃תֲ Ӝ ؝ٝذشך䗳銲剑⡚ꣲ䗳銲זٔا٦أ䭷㹀ׅ SFTPVSDFSFRVFTUT 4DIFEVMJOH
SFTPVSDFSFRVFTUT Ӝ ؝ٝذشך㹋遤ח䗳銲剑⡚ꣲ䗳銲זٔا٦أ Ӝ أ؛آُ٦ׁٕ؝ٝذشךٔا٦أ銲実ך さ鎘ָظ٦سך㺁ꆀ״㼰זְֿה⥂鏾ׅ apiVersion: v1 kind: Pod
metadata: name: kuard spec: containers: - image: gcr.io/kuar-demo/kuard- name: kuard resources: requests: cpu: "500m" memory: "128Mi" ports: - containerPort: 8080 name: http protocol: TCP
3VOOJOH ظ٦سךٔا٦أ⢪ְⴖג׃תֲ ،فٔ؛٦ءָؙّٝٓحءُ׃ג㔿תג׃תֲ ؙٔؒأز「ֽ彊⪒ָ穄חؙٔؒأزָֹג׃תֲ Ӝ ؝ٝذشךٔا٦أ⢪欽ꆀך♳ꣲ䭷㹀ׅ SFTPVSDFMJNJUT Ӝ ؝ٝذشךقٕأثؑحؙ鏣㹀ׅ -JWFOFTTQSPCF
欰ֹגְַוֲַ 3FBEJOFTTQSPCF 䘔瘶דַֹוֲַ
apiVersion: v1 kind: Pod metadata: name: kuard spec: containers: -
image: gcr.io/kuar-demo/kuar name: kuard resources: requests: cpu: "500m" memory: "128Mi" limits: cpu: "1000m" memory: "256Mi" ports: - containerPort: 8080 name: http protocol: TCP Ӝ ؝ٝذشךٔا٦أ⢪欽ꆀך♳ꣲ䭷㹀ׅ $16♳ꣲ馄ִג⢪欽׃זְ NFNPSZ♳ꣲ馄ִה00.ח״فٗإأָ媷ׁ SFTPVSDFMJNJUT
-JWFOFTTQSPCF Ӝ ؝ٝذشⰻفٗإأך娤崞湊鋔 Ӝ 㣟侁ׅה؝ٝذش䓼ⵖ涸חⱄ饯⹛ׅ name: kuard spec: containers: -
image: gcr.io/kuar-demo/kuard-amd64:1 name: kuard ports: - containerPort: 8080 name: http protocol: TCP livenessProbe: httpGet: path: /healthy port: 8080 initialDelaySeconds: 5 timeoutSeconds: 1 periodSeconds: 10 failureThreshold: 3 readinessProbe: httpGet: path: /ready port: 8080 initialDelaySeconds: 30 timeoutSeconds: 1 periodSeconds: 10 failureThreshold: 3
-JWFOFTTQSPCF Ӝ FYFD؝وٝسך㹋遤 &YJU؝٦سָדIFBMUIZⴻ㹀 Ӝ IUUQ(FU)551(&5ؙٔؒأز أذ٦ةأ؝٦سָ⟃♳劢弫דIFBMUIZⴻ㹀 Ӝ UDQ4PDLFU5$14PDLFU ؝طؙءָّٝ然甧ׅלIFBMUIZⴻ㹀
http.HandleFunc("/healthy", func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("OK")) } http.ListenAndServe(":8080", nil)
3FBEJOFTT1SPCF Ӝ ؝ٝذشⰻفٗإأָؙٔؒأزח 䘔瘶דַֹ Ӝ 㣟侁ׅה4FSWJDFT鸐ׄג زٓؿ؍حؙ「⥋׃זְ 6OSFBEZ name: kuard
spec: containers: - image: gcr.io/kuar-demo/kuard-amd64:1 name: kuard ports: - containerPort: 8080 name: http protocol: TCP livenessProbe: httpGet: path: /healthy port: 8080 initialDelaySeconds: 5 timeoutSeconds: 1 periodSeconds: 10 failureThreshold: 3 readinessProbe: httpGet: path: /ready port: 8080 initialDelaySeconds: 30 timeoutSeconds: 1 periodSeconds: 10 failureThreshold: 3
4FSWJDFT Ӝ ⟎䟝*1הه٦ز Ӝ ٓكٕإؙٖةח״ 1PEךؚٕ٦ؾؚٝ Ӝ ؟٦ؽأة؎ف $MVTUFS*1 /PEF1PSU
-PBE#BMBODFS 1PE app web 1PE app web 3FQMJDB4FU 4FSWJDF VIP: 10.0.0.249 Selector: app=web
apiVersion: v1 kind: Service metadata: name: kuard spec: type: ClusterIP
selector: app: kuard ports: - protocol: TCP port: 8080 targetPort: 8080 4FSWJDFT Ӝ ⟎䟝*1הه٦ز Ӝ ٓكٕإؙٖةח״ 1PEךؚٕ٦ؾؚٝ Ӝ ؟٦ؽأة؎ف $MVTUFS*1 /PEF1PSU -PBE#BMBODFS
http.HandleFunc("/ready", func(w http.ResponseWriter, r *http.Request) { message := "" //
Check database if err := db.Ping(); err != nil { message += fmt.Sprintf("database: %s\n", err) } if len(message) > 0 { // Send 503 http.Error(w, message, http.StatusServiceUnavailable) } else { w.Write([]byte("OK")) } }) http.ListenAndServe(":8080", nil)
5FSNJOBUJOH 穄✪⚥חؙٔؒأزָֹגؒٓ٦鵤׃ג׃תֲ Ӝ ؝ٝذش(SBDFGVMTIVUEPXOׇׁ UFSNJOBUJPO(SBDF1FSJPE4FDPOET QSF4UPQؿحؙ4*(5&3.ךعٝسؚٔٝ
apiVersion: apps/v1 kind: Deployment metadata: name: kuard spec: selector: matchLabels:
app: kuard template: metadata: labels: app: kuard spec: terminationGracePeriodSeconds: 60 containers: - image: gcr.io/kuar-demo/kuard-amd64:1 name: kuard ports: - containerPort: 8080 name: http protocol: TCP livenessProbe: UFSNJOBUJPO(SBDF1FSJPE4FDPOET Ӝ 1PE(SBDFGVMח穄✪ׇׁ䗳銲ז猱侧 Ӝ 鏣㹀׃猱侧ָ穗麓ׅה؝ٝذشח4*(,*--ָ鷏⥋ׁ
apiVersion: apps/v1 kind: Deployment metadata: labels: app: nginx name: nginx
spec: selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - image: nginx:1.13.7 name: nginx lifecycle: preStop: exec: command: ["nginx", "-s", "quit"] Ӝ 1PEך穄✪ؿؑ؎ؤך剑ⴱח㹋遤ׁ 0QUJPOBM ـٗحؙ׃זֽלזזְ ず劍 ֿהח岣䠐 Ӝ QSF4UPQؿحؙ㹋遤䖓ח4*(5&3.ָ鷏⥋ׁ QSF4UPQؿحؙ
倜鋉؝طؙءّٝ 䱸竲幥؝طؙءّٝ QSF4UPQⳢ椚 4*(5&3.Ⳣ椚 1PEך穄✪㨣 0QUJPOBM QSF4UPQؿحؙ 4FSWJDFTךة٦حزַ㢩 LVCFQSPYZָJQUBCMFTٕ٦ٕ刿倜׃ծ倜鋉䱸竲ָזֻז
ֿ⟃꣬倜鋉䱸竲כזֻז QSF4UPQؿحַؙ4*(5&3.ד (SBDFGVMחؙٗ٦ؤׅ䗳銲ָ֮ (SBDF1FSJPE4FDPOET䖓 穄✪׃גְזְ㜥さ رؿٕؓز猱 4*(,*-- 4*(5&3. ,VCFSOFUFT鑫鍑1PETך穄✪2JJUB
תה
תה Ӝ #VJMEJOH$POUBJOFST كأزفؙٓذ؍أח䖞ֲ Ӝ 1PE4DIFEVMJOH 䗳銲剑⡚ꣲ䗳銲זٔا٦أ鏣㹀ׅ SFTPVSDFSFRVFTUT Ӝ
1PE3VOOJOH قٕأثؑحؙ鏣㹀ׅ -JWFOFTT3FBEJOFTTQSPCF ٔا٦أ⢪欽ꆀח♳ꣲ鏣㹀ׅ SFTPVSDFMJNJUT Ӝ 1PE5FSNJOBUJOH (SBDFGVMTIVUEPXOׇׁ QSF4UPQؿحؙ4*(5&3.عٝسؚٔٝ
8FˏSF)JSJOH IUUQT[MBCDPKQ ,VCFSOFUFT %PDLFS 1SPNFUIFVT (PMBOH $PSF04
2VFTUJPOT