apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: cassandra-${n}
    tier: prod
  name: cassandra-${n}
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cassandra-${n}
      tier: prod
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: cassandra-${n}
        tier: prod
    spec:
      containers:
        - image: cassandra:3.11.4
          name: cassandra-${n}
          resources:
            limits:
              cpu: 500m
              memory: 1.5Gi
            requests:
              cpu: 50m
              memory: 500Mi
          env:
            - name: MAX_HEAP_SIZE
              value: 512M
            - name: HEAP_NEWSIZE
              value: 100M
          volumeMounts:
            - mountPath: /var/lib/cassandra/data
              name: sharder-data-pvc-${n}
              subPath: cassandra
      imagePullSecrets:
        - name: regcred
      restartPolicy: Always
      volumes:
        - name: sharder-data-pvc-${n}
          persistentVolumeClaim:
            claimName: sharder-data-pvc-${n}
