apiVersion: apps/v1
kind: Deployment
metadata:
  name: cassandra-deployment
spec:
  selector:
    matchLabels:
      app: cassandra
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: cassandra
    spec:
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: cassandra
      containers:
      - name: cassandra
        image: bitnami/cassandra:latest
        env:
        - name: CASSANDRA_USER
          valueFrom:
            secretKeyRef:
              name: cassandra-root
              key: user
        - name: CASSANDRA_PASSWORD
          valueFrom:
            secretKeyRef:
              name: cassandra-root
              key: password
        ports:
        - containerPort: 7000
          name: intra-node
        - containerPort: 7001
          name: tls-intra-node
        - containerPort: 7199
          name: jmx
        - containerPort: 9042
          name: cql
        volumeMounts:
        - name: data # must match the volume name, above
          mountPath: "/bitnami"
          
