$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Stateful Applications mit Kubernetes
Search
Nicolas Byl
September 21, 2017
Technology
0
66
Stateful Applications mit Kubernetes
Nicolas Byl
September 21, 2017
Tweet
Share
More Decks by Nicolas Byl
See All by Nicolas Byl
Platform Engineering ❤️ Developer Experience
nbyl
0
19
Die Flucht aus der Prototypen-Hölle
nbyl
0
44
Lean Prototyping for Industrial-IoT Projects
nbyl
0
55
DevSecOps - Vom Unikum zur gut geölten Maschine
nbyl
0
110
Securing your software supply chain
nbyl
0
370
Keeping-Up-WithUpstream.pdf
nbyl
0
170
Dr. Kube und der Helm - Anatomie einer CD-Pipeline
nbyl
0
130
Securing the "other" supply chain
nbyl
0
290
Kubernetes - Auf die Cluster, Fertig, Los!
nbyl
0
190
Other Decks in Technology
See All in Technology
AR Guitar: Expanding Guitar Performance from a Live House to Urban Space
ekito_station
0
230
「もしもデータ基盤開発で『強くてニューゲーム』ができたなら今の僕はどんなデータ基盤を作っただろう」
aeonpeople
0
250
Lookerで実現するセキュアな外部データ提供
zozotech
PRO
0
200
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
9.9k
Bedrock AgentCore Memoryの新機能 (Episode) を試してみた / try Bedrock AgentCore Memory Episodic functionarity
hoshi7_n
2
1.9k
AI駆動開発の実践とその未来
eltociear
2
500
20251203_AIxIoTビジネス共創ラボ_第4回勉強会_BP山崎.pdf
iotcomjpadmin
0
140
ソフトウェアエンジニアとAIエンジニアの役割分担についてのある事例
kworkdev
PRO
0
270
会社紹介資料 / Sansan Company Profile
sansan33
PRO
11
390k
投資戦略を量産せよ 2 - マケデコセミナー(2025/12/26)
gamella
0
440
Knowledge Work の AI Backend
kworkdev
PRO
0
270
通勤手当申請チェックエージェント開発のリアル
whisaiyo
3
470
Featured
See All Featured
Building AI with AI
inesmontani
PRO
1
570
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
190
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
120
A Tale of Four Properties
chriscoyier
162
23k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.3k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
0
3.4k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
410
30 Presentation Tips
portentint
PRO
1
170
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
1
1.3k
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