Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Stateful Applications mit Kubernetes
Search
Nicolas Byl
September 21, 2017
Technology
74
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Stateful Applications mit Kubernetes
Nicolas Byl
September 21, 2017
More Decks by Nicolas Byl
See All by Nicolas Byl
Platform Engineering ❤️ Developer Experience
nbyl
0
71
Die Flucht aus der Prototypen-Hölle
nbyl
0
65
Lean Prototyping for Industrial-IoT Projects
nbyl
0
87
DevSecOps - Vom Unikum zur gut geölten Maschine
nbyl
0
130
Securing your software supply chain
nbyl
0
410
Keeping-Up-WithUpstream.pdf
nbyl
0
200
Dr. Kube und der Helm - Anatomie einer CD-Pipeline
nbyl
0
160
Securing the "other" supply chain
nbyl
0
350
Kubernetes - Auf die Cluster, Fertig, Los!
nbyl
0
230
Other Decks in Technology
See All in Technology
1つのリクエストを追って理解する - llm-dのP/D分離
akhino
1
150
go-sqletch
moznion
0
140
実体験から学ぶ分析エージェントの開発と運⽤
recruitengineers
PRO
8
2.4k
Refining Active Record
shugo
0
150
子育てエンジニアの可処分時間が減っても成長を諦めない戦い方
sudoakiy
6
4.6k
hackers_champloo_2026_tidb
makocchi
0
160
自作バイナリを動かす「入口」8選
puhitaku
2
1.3k
パスキーの自動テストはどこまでいけるのか
teamlab
PRO
0
180
脆弱性診断って、何をしているの? 〜弱点を見つけて、会社の改善につなげるまで〜
keeg
0
920
OptunaHub: ブラックボックス最適化のためのプラットフォーム
pfn
PRO
0
130
Claude Code本は、どのように執筆チームで書かれたか
oikon48
1
370
Metadata - Section 1: HTML Basics
mohab1
0
110
Featured
See All Featured
Scaling GitHub
holman
464
140k
Building Applications with DynamoDB
mza
96
7.2k
Technical Leadership for Architectural Decision Making
baasie
3
600
Designing for Timeless Needs
cassininazir
1
520
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Darren the Foodie - Storyboard
khoart
PRO
4
4k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Product Roadmaps are Hard
iamctodd
55
13k
A designer walks into a library…
pauljervisheath
211
25k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
280
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Transcript
STATEFUL APPLICATIONS MIT KUBERNETES BED-CON 2017 Nicolas Byl, codecentric AG
1
2
PERSISTENT APPLICATION STATE 3 . 1
GOALS Scalable Highly Available Fault Tolerance 3 . 2
EXAMPLE ARCHITECTURE 3 . 3
CANDIDATES MySQL PostgreSQL Cassandra MongoDB Kafka … 3 . 4
KUBERNETES 4 . 1
DESIGN PHILOSOPHY portable: public, private, hybrid, multi-cloud extensible: modular, pluggable,
hookable, composable self-healing: auto-placement, auto-restart, auto-replication, auto-scaling 4 . 2
PODS 4 . 3
SERVICES 4 . 4
PERSISTENT VOLUMES 5 . 1
5 . 2
GCEPersistentDisk CephFS AWSElasticBlockStore Cinder (OpenStack block storage) AzureFile Glusterfs AzureDisk
VsphereVolume FC (Fibre Channel) Quobyte Volumes FlexVolume HostPath Flocker VMware Photon
NFS vPortworx Volumes iSCSI ScaleIO Volumes RBD (Ceph Block Device)
StorageOS 5 . 3
ACCESS MODES ReadWriteOnce – the volume can be mounted as
read-write by a single node ReadOnlyMany – the volume can be mounted read-only by many nodes ReadWriteMany – the volume can be mounted as read-write by many nodes 5 . 4
USAGE Provision Disk Create Persistent Volume Create Persistent Volume Claim
Mount Claim in Pod 5 . 5
PERSISTENT VOLUME apiVersion: v1 kind: PersistentVolume metadata: name: pv0003 spec:
capacity: storage: 5Gi accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Recycle nfs: path: /tmp server: 172.17.0.2 5 . 6
PERSISTENT VOLUME CLAIM kind: PersistentVolumeClaim apiVersion: v1 metadata: name: myclaim
spec: accessModes: - ReadWriteOnce resources: requests: storage: 8Gi 5 . 7
MOUNTING A PVC kind: Pod apiVersion: v1 metadata: name: mypod
spec: containers: - name: mydatabase image: mysql:5.7 volumeMounts: - mountPath: "/var/lib/mysql" name: mypd volumes: - name: mypd persistentVolumeClaim: claimName: myclaim 5 . 8
COMMON PITFALLS The abstraction is leaky. Local storage vs. SAN
storage vs. Network Filesystems 5 . 9
AUTO-PROVISIONING 6 . 1
AUTO-PROVISIONING Manual creation of Persistent Volumes is error-prone. Does not
scale well. 6 . 2
STORAGECLASS kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: name: standard provisioner: kubernetes.io/aws-ebs
parameters: type: gp2 6 . 3
USING A STORAGECLASS kind: PersistentVolumeClaim apiVersion: v1 metadata: name: myclaim
spec: accessModes: - ReadWriteOnce resources: requests: storage: 8Gi storageClassName: standard 6 . 4
SUPPORTED PROVISIONERS default volume plugins (in-tree provisioners) out-of-tree provisioners community
provisioners: write your own: https://github.com/kubernetes- incubator/external-storage https://github.com/kubernetes- incubator/external- storage/tree/master/docs/demo/hostpath-provisioner 6 . 5
SCALING 7 . 1
ARCHITECTURE REVISITED 7 . 2
SHARING PVCS Need different paths per Pod. Share needs to
be available on every host. Corruption of file system affects all database nodes. Sharing a Persistent Volume Claim is not a good idea. 7 . 3
STATEFUL SETS 8 . 1
STATEFULSETS Pod template mechanism Hostnames are atomically increased: pod-0 pod-1
… Volume Claims can be provisioned on-the-fly 8 . 2
STATEFULSET EXAMPLE apiVersion: apps/v1beta1 kind: StatefulSet metadata: name: web spec:
serviceName: "nginx" replicas: 2 template: metadata: labels: app: nginx spec: containers: - name: nginx image: gcr.io/google_containers/nginx-slim:0.8 ports: - containerPort: 80 name: web volumeMounts: 8 . 3
ARCHITECTURE STATEFULSETS 8 . 4
WRAP UP 9 . 1
LINKS Persistent Volumes: Tutorial StatefulSet: Demos: https://kubernetes.io/docs/concepts/storage/persistent- volumes https://kubernetes.io/docs/tutorials/stateful-application/basic- stateful-set/
https://goo.gl/NCnzq8 9 . 2
THE END Copyright 2017 @NicolasByl 9 . 3