Skip to content

Instantly share code, notes, and snippets.

@azhuox
Created November 29, 2020 21:21
Show Gist options
  • Save azhuox/d9e5769435321f5cf006f51ae6e10239 to your computer and use it in GitHub Desktop.
Save azhuox/d9e5769435321f5cf006f51ae6e10239 to your computer and use it in GitHub Desktop.
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: zoo-keepr
# StatefulSet spec
spec:
serviceName: zk-hs
selector:
matchLabels:
app: zk
replicas: 3
volumeClaimTemplates:
- metadata:
name: datadir
spec:
storageClassName: standard
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 10Gi
# Pod spec
template:
metadata:
labels:
app: zk
spec:
containers:
- name: k8szk
image: gcr.io/google_samples/k8szk:v3
...
volumeMounts:
- name: datadir
mountPath: /var/lib/zookeeper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment