Skip to content

Instantly share code, notes, and snippets.

@bprashanth
Created April 11, 2016 17:55
Show Gist options
  • Save bprashanth/2b5721335c535e9ca4078a63b869663e to your computer and use it in GitHub Desktop.
Save bprashanth/2b5721335c535e9ca4078a63b869663e to your computer and use it in GitHub Desktop.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment