apiVersion: batch/v1
kind: Job
metadata:
  name: aurora-client
  namespace: default
spec:
  template:
    spec:
      containers:
      - name: client
        image: postgres:10
        command: ['psql']
        args: ['-c', 'SELECT current_database();']
        env:
        - name: PGDATABASE
          value: test
        - name: PGHOST
          valueFrom:
            secretKeyRef:
              name: test-aurora-serverless
              key: endpoint
        - name: PGUSER
          valueFrom:
            secretKeyRef:
              name: test-aurora-serverless
              key: username
        - name: PGPASSWORD
          valueFrom:
            secretKeyRef:
              name: test-aurora-serverless
              key: password
        - name: PGPORT
          value: "5432"
      restartPolicy: Never