Local Authentication :: Kloudfuse Docs

Local Authentication

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:

  1. Connect to your Kloudfuse Kubernetes cluster.

  2. Remove any existing local copy of the users.txt file:

rm -f users.txt
  1. Retrieve the current users.txt from the kfuse-auth-users secret and save it locally. The file uses htpasswd format.
kubectl get secret -n kfuse kfuse-auth-users -o json | jq -r '.data."users.txt"' | base64 -d > users.txt

If the secret does not exist yet, create a new empty users.txt file.

  1. (Optional) If changing the password of an existing user, remove that user’s entry from users.txt.

  2. Create or update the user’s password.

This example is for user testuser. For the admin user, use admin.

htpasswd -Bn testuser >> users.txt
htpasswd accepts empty passwords. Ensure that you provide a non-empty password when prompted after running the above command.
  1. Ensure that users.txt has no blank lines between entries:
sed -i '' '/^$/d' users.txt
  1. Ensure that users.txt ends with a newline:
echo "" >> users.txt
  1. Encode users.txt in base64:
cat users.txt | base64
  1. Update the kfuse-auth-users Kubernetes secret with the base64-encoded value:
kubectl edit secret kfuse-auth-users

Set the users.txt field to the output of the previous step.

If the secret does not exist, create it:

apiVersion: v1
data:
     users.txt: |-
       <base64-encoded-value>
kind: Secret
metadata:
     name: kfuse-auth-users
type: Opaque
  1. For fresh installations, update your custom-values.yaml to reference the kfuse-auth-users secret:
kfuse-auth:
     oauth2-proxy:
       htpasswdFile:
         existingSecret: kfuse-auth-users

Skip this step when adding a new user or updating the password of an existing user.

  1. Restart the kfuse-auth deployment to apply the changes:
kubectl -n kfuse rollout restart deployment kfuse-auth
  1. After logging in with the new credentials for the first time, the user appears in the Admin > Users interface.