apiVersion: apps/v1
kind: Deployment
metadata:
  name: spring
spec:
  selector:
    matchLabels:
      app: spring
  replicas: 1
  template:
    metadata:
      labels:
        tier: frontend
        component: web
        app: spring
    spec:
      containers:
        - name: spring
          image: yurak/spring:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 8080
          resources:
            limits:
              memory: 600Mi
              cpu: 500m
            requests:
              memory: 100Mi
              cpu: 100m
          livenessProbe:
            httpGet:
              port: 8080
              path: /actuator/health/liveness
            initialDelaySeconds: 30
            periodSeconds: 10
            failureThreshold: 5
            timeoutSeconds: 30
          readinessProbe:
            httpGet:
              port: 8080
              path: /actuator/health/readiness
            initialDelaySeconds: 30
            periodSeconds: 10
          env:
            - name: MYSQL_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: spring-secret
                  key: mysql-password
            - name: PG_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: spring-secret
                  key: pg-password
            - name: ARTEMIS_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: spring-secret
                  key: artemis-password
            - name: RABBITMQ_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: spring-secret
                  key: rabbitmq-password
