Adding users or changing password
To setup new credentials for a user or adding a new user follow these steps:
Step 1. Dump the current content of the htpasswd ‘users.txt’ file.
# Make sure to connect to kfuse cluster. rm users.txt # ignore this if there's no such file currently. kubectl get secret -n kfuse kfuse-auth-users -o json | jq -r '.data."users.txt"' | base64 -d > users.txt
Step 2. If changing the password of a user, then remove existing entry for that user from users.txt file. Otherwise go to step 3.
Step 3. create or change password for the user (following example uses
testuser
as the user. For admin user useadmin
):htpasswd -Bn testuser >> users.txt cat users.txt | base64
Step 4. create a kubernetes secret called
kfuse-auth-users
(or update the existing one). Use the output ofcat users.txt| base64
as the value of users.txt entry in the secret as shown below. Use the following command if you are editing the existing secret.
kubectl edit secret kfuse-auth-users
Step 5. Skip to Step 6 if adding new user or updating password for existing user. Otherwise, update your custom values.yaml to point to
kfuse-auth-users
secret as below:Step 6. restart kfuse-auth deployment.