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のPetSetsの話
Search
Kazuto Kusama
September 16, 2016
Technology
1
220
KubernetesのPetSetsの話
社内コンテナ勉強会で喋った機能。
PetSetsを使うことで、従来のStatefulなアプリケーションもKubernetes上で動かしやすくなります
Kazuto Kusama
September 16, 2016
Tweet
Share
More Decks by Kazuto Kusama
See All by Kazuto Kusama
2024/10 PagerDuty機能アップデート
jacopen
1
32
ゲームから学ぶ、いちばん速いインシデント対応
jacopen
1
57
PEK2024 Recap
jacopen
2
130
クラウドネイティブの本質から考える、生産性と信頼性の両立
jacopen
3
840
「責任ある開発」を!フルサービスオーナーシップが変えるエンジニアリング文化
jacopen
11
2k
手を動かさないインシデント対応〜自動化で迅速・正確な運用を目指す〜
jacopen
3
430
エンジニアとしてのキャリアを支える自宅サーバー
jacopen
12
7.3k
Grafana x PagerDuty Better Together
jacopen
1
710
「共通基盤」を超えよ! 今、Platform Engineeringに取り組むべき理由
jacopen
27
10k
Other Decks in Technology
See All in Technology
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
940
なぜ今 AI Agent なのか _近藤憲児
kenjikondobai
4
1.4k
Security-JAWS【第35回】勉強会クラウドにおけるマルウェアやコンテンツ改ざんへの対策
4su_para
0
180
Amazon Personalizeのレコメンドシステム構築、実際何するの?〜大体10分で具体的なイメージをつかむ〜
kniino
1
100
Terraform Stacks入門 #HashiTalks
msato
0
350
Platform Engineering for Software Developers and Architects
syntasso
1
520
Shopifyアプリ開発における Shopifyの機能活用
sonatard
4
250
Exadata Database Service on Dedicated Infrastructure(ExaDB-D) UI スクリーン・キャプチャ集
oracle4engineer
PRO
2
3.2k
CysharpのOSS群から見るModern C#の現在地
neuecc
2
3.4k
社内で最大の技術的負債のリファクタリングに取り組んだお話し
kidooonn
1
550
Introduction to Works of ML Engineer in LY Corporation
lycorp_recruit_jp
0
120
Taming you application's environments
salaboy
0
190
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
40
2.4k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
890
Navigating Team Friction
lara
183
14k
Code Review Best Practice
trishagee
64
17k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Transcript
LTͷ1FU4FUTͷ
Kazuto Kusama @jacopen
࠷ۙͷ ࠷ۙͷ͕ͬͯΔϓϩδΣΫτͰɺͳΜͱ͔ελοΫͷͳΜͱ͔ ͍ͬͯ͏ͭΛ͍ͬͯΔͷͰɺRabbitMQ͕ඞཁʹͳͬͨ ӡ༻ج൫ʹk8sΛ͍ͬͯΔΜͰɺRabbitMQΫϥελΛk8sʹ͏
k8sͰී௨ʹ্͛ͨ߹ (Deployments, Replication Controller) kind: Deployment metadata: name: rabbitmq spec:
replicas: 3 template: metadata: labels: app: rabbitmq spec: containers: - name: rabbitmq image: rabbitmq:latest
k8sͰී௨ʹ্͛ͨ߹ (Deployments, Replication Controller) jacopen@ssh2:~/kubernetes$ kubectl get pods NAME READY
STATUS RESTARTS AGE rabbitmq-4239234776-8bs65 1/1 Running 0 2m rabbitmq-4239234776-amzjt 1/1 Running 0 2m rabbitmq-4239234776-wq6s4 1/1 Running 0 2m
MQ MQ MQ 3ඖͷRabbitMQ
MQ MQ MQ 3ඖͷRabbitMQ ΫϥελΛΜͰΈΑ͏
$ rabbitmqctl join_cluster rabbit@rabbitmq-0 OR rabbitmq.config [ { rabbit, [
{loopback_users, []}, {cluster_nodes, {[‘rabbit@rabbitmq-0', 'rabbit@rabbitmq-1'], ram}} ] } ].
MQ MQ MQ ΄ɺϗετ໊ɾɾɾ rabbitmq-4239234776-8bs65 rabbitmq-4239234776-amzjt rabbitmq-4239234776-wq6s4 ܾ·ͬͨϗετ໊ʹͳΒͳ্͍ʹɺ૬ޓͷ௨৴खஈ͕ͳ͍
MQ MQ MQ ແཧཧk8sͰ࣮ݱ rabbitmq-4239234776-8bs65 rabbitmq-4239234776-amzjt rabbitmq-4239234776-wq6s4 Service rabbitmq-0 Service
rabbitmq-1 Service rabbitmq-2
MQ MQ MQ ແཧཧk8sͰ࣮ݱ rabbitmq-4239234776-8bs65 rabbitmq-4239234776-amzjt rabbitmq-4239234776-wq6s4 Service rabbitmq-0 Service
rabbitmq-1 Service rabbitmq-2
MQ MQ MQ yamlࠈ rabbitmq-4239234776-8bs65 rabbitmq-4239234776-amzjt rabbitmq-4239234776-wq6s4 Service rabbitmq-0 Service
rabbitmq-1 Service rabbitmq-2 yaml yaml yaml yaml yaml yaml
MQ MQ MQ ϝϯςͷͨΊʹఀࢭ͠Α͏ $ kubectl delete -f … rabbitmq-4239234776-8bs65
rabbitmq-4239234776-amzjt rabbitmq-4239234776-wq6s4 Service rabbitmq-0 Service rabbitmq-1 Service rabbitmq-2 yaml yaml yaml yaml yaml yaml
ϝϯςͷͨΊʹఀࢭ͠Α͏ rabbitmq-4239234776-8bs65 rabbitmq-4239234776-amzjt rabbitmq-4239234776-wq6s4
$BUUMF Ոச
Cattle or Pets • εέʔϧ͢ΔΞʔΩςΫνϟͷͨΊʹɺ֤ϊʔυΛՈசͷΑ ͏ʹѻ͏ඞཁ͕͋Δ • ΫϥυωΠςΟϒͳੈքͰׂͱ;ͭʔ • ͱ͍͑ɺશͯͷΞϓϦ͕ͦ͏࡞ΕΔΘ͚͡Όͳ͍
PetSets is Կ • ݱߦͷk8s 1.3ͰΞϧϑΝ൛͕࣮͞Εͨػೳ • ΫϥυωΠςΟϒͰͳ͍;ͭʔͷΞϓϦέʔγϣϯΛ k8sͰಈ͔͘͢͠͠Α͏ͥ ɹͱ͍͏ػೳ
PetSetͰ্͛ͨ߹ jacopen@ssh2:~/kubernetes$ kubectl get pods NAME READY STATUS RESTARTS AGE
rabbitmq-0 1/1 Running 0 18s rabbitmq-1 1/1 Running 0 12s rabbitmq-2 1/1 Running 0 7s
root@rabbitmq-0:/# hostname rabbitmq-0 root@rabbitmq-0:/# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu
65536 qdisc noqueue state UNKNOWN group default qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 727: eth0@if728: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1350 qdisc noqueue state UP group default link/ether 02:42:ac:20:52:11 brd ff:ff:ff:ff:ff:ff inet 172.32.82.17/24 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::42:acff:fe20:5211/64 scope link tentative dadfailed valid_lft forever preferred_lft forever root@rabbitmq-0:/# ping rabbitmq-1.rabbitmq PING rabbitmq-1.rabbitmq.petset.svc.cluster.local (172.32.41.13) 56(84) bytes of data. 64 bytes from 172.32.41.13: icmp_seq=1 ttl=62 time=0.575 ms 64 bytes from 172.32.41.13: icmp_seq=2 ttl=62 time=0.752 ms
0 1 2 0൪͔Βॱ൪ʹ্͛ͯ͘ΕΔ
0 1 2 େ͖͍൪߸͔Βॱʹམͱͯ͘͠ΕΔ ŋŋŋͣ
http://kubernetes.io/docs/user-guide/petset/
ॴײ • ·ͩ·ͩαͳͷͰ͓͔͠ͳಈ͖ଟ͠ • ࣮ઓೖ·ͩແཧɻ1.41.5͋ͨΓʹظ • ͱ͍͑ɺStateless͚ͩͰͳ͘Statefulαϙʔτ͢ΔྲྀΕ ແࢹग़དྷͳ͍Ͷ