apiVersion: batch/v1 kind: Job metadata: name: ${FQDN}-mongo-upgrade namespace: ${NS} spec: template: spec: restartPolicy: Never containers: - name: mongo image: mongo imagePullPolicy: Always command: - bash - -c - 'mongosh "mongodb+srv://$(MONGODB_CLUSTER_ADMIN_USER):$(MONGODB_CLUSTER_ADMIN_PASSWORD)@${FQDN}-rs0.${NS}.svc.cluster.local?authSource=admin&replicaSet=rs0&w=majority&ssl=false" --eval "db.adminCommand({setFeatureCompatibilityVersion: \"4.4\"})"' envFrom: - secretRef: name: ${FQDN}-mongodb-users