Add Users
After installing Kloudfuse, add users and manage their credentials.
The user appears in the Admin > Users interface after they log in for the first time. |
Follow these steps:
-
Connect to your Kloudfuse kubernetes cluster.
-
Drop the content of the htpasswd
users.txt
file, if it exits.rm -f users.txt
-
Generate a secret for the user.
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.txt
file. -
Ensure that the
users.txt
file ends with a new line.echo "" >> users.txt
-
Create or change password for the user.
This example is for user
testuser
. For admin user, useadmin
.htpasswd -Bn testuser >> users.txt
Be sure to add each user on a separate line of the `users.txt` file.
-
Create a
base64
encoding for the contents of theusers.txt
file.cat users.txt | base64
-
Create a Kubernetes secret and call it
kfuse-auth-users
.Use the output of
cat users.txt| base64
as the value ofusers.txt
entry in the secret, as we demonstrate in the following example. Use the following command if you are editing the existing secret.apiVersion: v1 data: users.txt: |- <base64-encoded-value> kind: Secret metadata: name: kfuse-auth-users type: Opaque
Alternatively, update the existing secret.
kubectl edit secret kfuse-auth-users
-
(Optional): Skip this step if adding a new user or updating the password for an existing user.
Update your
custom-values.yaml
to point to thekfuse-auth-users
secret.kfuse-auth: oauth2-proxy: htpasswdFile: existingSecret: kfuse-auth-users
-
Restart
kfuse-auth
deployment.kubectl -n kfuse rollout restart deployment kfuse-auth