Introduction
This article walks you through how to change authentication mechanism type in Kots based On Prem
Process
Step 1: You will need to get your DB password through the below command.
kubectl get secret -n kots mongodb-replicaset-chart-admin -o jsonpath={.data.password} | base64 --decode | awk ‘{print $1}’
Step 2: Exec into the primary mongo pod
kubectl exec mongodb-replicaset-chart-0 -n kots -it – bin/bashx
Step 3: Enter into Mongo Shell
mongo
Step 4: Select admin
use admin
Step 5: Login into admin using the DB password you got in step 1
db.auth('admin’,’password’)
Step 6: Now switch to the harness collections
use harness
Step 7: Check details of account collection
db.accounts.find().pretty()
Step 8: Update the authentication mechanism for Local Login or as per your requirement
db.accounts.update({“_id” : “id-you-got-in-step7”},{$set: {authenticationMechanism: “USER_PASSWORD”}})