---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: postgres
  name: postgres
spec:
  selector:
    matchLabels:
      app: postgres
  template:
    metadata:
      labels:
        app: postgres
      name: postgres
    spec:
      containers:
      - env:
        - name: POSTGRES_PASSWORD
          value: password
        image: postgres:12-alpine
        name: main
        ports:
        - containerPort: 5432
        readinessProbe:
          exec:
            command:
            - psql
            - -U
            - postgres
            - -c
            - SELECT 1
          initialDelaySeconds: 15
          timeoutSeconds: 2
      nodeSelector:
        kubernetes.io/os: linux
