apiVersion: batch/v1
kind: Job
metadata:
  name: service-connection-verify
  namespace: my-project
spec:
  backoffLimit: 0
  template:
    spec:
      restartPolicy: Never
      containers:
        - name: redis-client
          image: docker.io/bitnami/redis:6.0.12-debian-10-r3
          command:
            - sh
            - -c
          args:
            - redis-cli -h "${REDIS_HOST}" -p ${REDIS_PORT} ping
          env:
            - name: REDIS_HOST
              valueFrom:
                secretKeyRef:
                  name: my-instance-credentials
                  key: endpoint
            - name: REDIS_PORT
              valueFrom:
                secretKeyRef:
                  name: my-instance-credentials
                  key: port
            - name: REDISCLI_AUTH
              valueFrom:
                secretKeyRef:
                  name: my-instance-credentials
                  key: password
