Add Users
After installing Kloudfuse, add users and manage their credentials.
|
The user appears in the Admin > Users tab after they log in for the first time. |
Follow these steps:
-
Connect to your Kloudfuse kubernetes cluster.
-
Drop the content of the
users.txtfile.If it exists, the file is in
htpasswordformat.rm -f users.txt -
Retrieve the
users.txtfile in thekfuse-auth-userssecret, and save it locally. Otherwise, create ausers.txtfile.kubectl get secret -n kfuse kfuse-auth-users -o json | jq -r '.data."users.txt"' | base64 -d > users.txt -
(Optional) If changing the password of a user, then remove existing entry for that user from
users.txtfile. -
Create or change the user’s password.
This example is for user
testuser. For an admin user, useadmin.htpasswd -Bn testuser >> users.txt -
Ensure that the
users.txtfile does not have empty lines between users.sed -i '' '/^$/d' users.txt -
If the
users.txtfile does not end with a new line, ensure that it does by running the following command.echo "" >> users.txt -
Encode the
users.txtfile usingbase64format.cat users.txt | base64 -
Use the following command to edit the existing
kfuse-auth-userssecret.kubectl edit secret kfuse-auth-users -
Otherwise, create a new Kubernetes secret,
kfuse-auth-users.kubectl apply -f kfuse-auth-usersbash -
Use the output of
cat users.txt| base64as the value ofusers.txtentry in the secret.apiVersion: v1 data: users.txt: |- <base64-encoded-value> kind: Secret metadata: name: kfuse-auth-users type: Opaqueyaml -
For fresh installations, update your
custom-values.yamlto point to thekfuse-auth-userssecret.kfuse-auth: oauth2-proxy: htpasswdFile: existingSecret: kfuse-auth-usersyamlSkip this step if adding a new user or updating the password for an existing user.
-
Restart
kfuse-authdeployment.kubectl -n kfuse rollout restart deployment kfuse-auth -
After you log in with the new user/password credentials for the first time, these appear in the Admin > Users interface.