apiVersion: batch/v1
kind: Job
metadata:
  name: ${FQDN}-reset-admin-pass
  namespace: ${NS}
spec:
  template:
    spec:
      restartPolicy: Never
      containers:
        - name: wrench
          image: libresh/wrench
          args:
            - rc
            - user
            - pass
            - --mongo-url=$(MONGO_URL)
            - $(ADMIN_USER)
            - $(ADMIN_PASS)
          env:
            - name: MONGO_URL
              valueFrom:
                secretKeyRef:
                  key: MONGO_URL
                  name: ${FQDN}-app
            - name: ADMIN_USER
              valueFrom:
                configMapKeyRef:
                  key: ADMIN_USERNAME
                  name: ${FQDN}-config
            - name: ADMIN_PASS
              valueFrom:
                secretKeyRef:
                  key: ADMIN_PASS
                  name: ${FQDN}-app
