Petset
apiVersion: extensions/v1beta1
kind: PetSet
metadata:
name: foo
spec:
replicas: 3
template:
metadata:
labels:
app: zookeeper
spec:
containers:
- name: zookeeper
image: jplock/zookeeper
ports:
- containerPort: 8080
volumeMounts:
# These volume mounts are persistent. They're like inline claims,
# but not exactly because the names need to match exactly one of
# the pet volumes.
- name: datadir
mountPath: /tmp/zookeeper
- name: conf
mountPath: /opt/zookeeper/conf
# This volume mount is destroyed with the pod
- name: home
mountPath: /home
ports:
- containerPort: 2888
name: peer
- containerPort: 3888
name: leader-election
# TODO: add a config-sidecar.
volumes:
- name: home
hostPath:
path: /tmp/zookeeper_home
volumeClaims:
# These are converted to volume claims by the controller
# and mounted at the paths mentioned above.
- metadata:
name: datadir
spec:
resources:
requests:
storage: 20Gi
- metadata:
name: conf
spec:
resources:
requests:
storage: 10Gi