apiVersion: apps/v1
kind: Deployment
metadata:
  name: crud-simple-deployment
spec:
  replicas: 3
  selector:
    matchLabels:
      app: crud-simple-label
  template:
    metadata:
      labels:
        app: crud-simple-label
    spec:
      containers:
        - name: crud-simple-container
          image: geracimov/crud-simple:1.0
          env:
            - name: DATASOURCE_URI
              valueFrom:
                configMapKeyRef:
                  name: crud-simple-config
                  key: DATASOURCE_URI
            - name: DATASOURCE_USERNAME
              valueFrom:
                secretKeyRef:
                  name: crud-simple-secret
                  key: DATASOURCE_USERNAME
            - name: DATASOURCE_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: crud-simple-secret
                  key: DATASOURCE_PASSWORD
          ports:
            - name: http
              containerPort: 8080
          startupProbe:
            httpGet:
              path: /actuator/health
              port: 8080
            initialDelaySeconds: 12
            failureThreshold: 3
            periodSeconds: 10
          readinessProbe:
            httpGet:
              path: /actuator/health
              port: 8080
            initialDelaySeconds: 15
            periodSeconds: 10
          livenessProbe:
            httpGet:
              path: /actuator/health
              port: 8080
            initialDelaySeconds: 15
            periodSeconds: 5
