apiVersion: apps/v1
kind: Deployment
metadata:
  name: ping-pong-dep
  namespace: logping-namespace
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ping-pong
  template:
    metadata:
      labels:
        app: ping-pong
    spec:
      containers:
        - name: ping-pong
          image: rikusarlin/ping-pong:version9
          readinessProbe:
            initialDelaySeconds: 10
            periodSeconds: 10
            httpGet:
               path: /readyz
               port: 3002
          livenessProbe:
            initialDelaySeconds: 20
            periodSeconds: 5
            httpGet:
               path: /readyz
               port: 3002
          env:
          - name: POSTGRE_HOST
            valueFrom:
              configMapKeyRef:
                name: ping-pong-configmap
                key: postgre_host
          - name: POSTGRE_PORT
            valueFrom:
              configMapKeyRef:
                name: ping-pong-configmap
                key: postgre_port
          - name: POSTGRE_DB
            valueFrom:
              configMapKeyRef:
                name: ping-pong-configmap
                key: postgre_db
          - name: POSTGRE_USER
            valueFrom:
              configMapKeyRef:
                name: ping-pong-configmap
                key: postgre_user
          - name: POSTGRE_PASSWORD
            valueFrom:
              configMapKeyRef:
                name: ping-pong-configmap
                key: postgre_password
          - name: PORT
            valueFrom:
              configMapKeyRef:
                name: ping-pong-configmap
                key: port
