kind: Deployment
apiVersion: apps/v1
metadata:
  name: testapp
spec:
  selector:
    matchLabels:
      app: testapp
  template:
    metadata:
      labels:
        app: testapp
    spec:
      containers:
        - name: testapp
          image: ghcr.io/benc-uk/java-cassandra-test:latest
          imagePullPolicy: Always

          resources:
            limits:
              memory: "256Mi"
              cpu: "500m"

          ports:
            - containerPort: 8080

          env:
            - name: QUARKUS_CASSANDRA_AUTH_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: cassdb-cassandra
                  key: cassandra-password

          livenessProbe:
            httpGet:
              path: /health
              port: 8080
            initialDelaySeconds: 15
          readinessProbe:
            httpGet:
              path: /health
              port: 8080

          volumeMounts:
            - name: app-config
              mountPath: "/deployments/config"
              readOnly: true

      volumes:
        - name: app-config
          configMap:
            name: testapp-config
            items:
              - key: application.properties
                path: application.properties
