apiVersion: apps/v1
kind: Deployment
metadata:
  name: "springcontainerms-deployment"
spec:
  replicas: 1
  revisionHistoryLimit: 1
  selector:
    matchLabels:
      app: springcontainerms-selector
  template:
    metadata:
      labels:
        app: "springcontainerms-selector"
        version: "current"
    spec:
      serviceAccountName: default
      containers:
      - name: "springcontainerms"
        image: "eventingapps/spring-container-ms"
        imagePullPolicy: IfNotPresent
        readinessProbe:
          httpGet:
            path: /actuator/health
            port: 8080
          initialDelaySeconds: 20
        resources:
          requests:
            cpu: "200m"
            memory: "300Mi"
        env:
          - name: APPLICATION_NAME
            value: "springcontainerms"
          - name: POSTGRESQL_URL
            valueFrom:
              secretKeyRef:
                name: "postgresql"
                key: url
          - name: POSTGRESQL_USER
            valueFrom:
              secretKeyRef:
                name: "postgresql"
                key: user
          - name: POSTGRESQL_PWD
            valueFrom:
              secretKeyRef:
                name: "postgresql"
                key: password  
