Add user and profile(namespace) to kubeflow with dex

less than 1 minute read

You can create custom user and profile(namespace) on kubeflow and dex with this walkthrough.

Test Environment

  • Provisioning machine - Ubuntu 18.04
  • Node machines - Ubuntu 20.04
  • deepops - 22.08
  • kubernetes - 1.23.7
  • kubeflow - 1.6.1

Walkthrough

0. Prerequisition

  • Kubeflow installed on Kubernetes

1. Add user

Before add a new user to your Kubeflow server, get a hash value for the password of the user to be added.

python3 -c 'from passlib.hash import bcrypt; import getpass; print(bcrypt.using(rounds=12, ident="2y").hash(getpass.getpass()))'

Then, edit the dex configmap

kubectl edit cm -n auth dex -o yaml
# Add user information to 'staticPasswords' block
'''
    - email: newuser@mydomain.com
      hash: YOUR_HASH_VALUE
      username: newuser
'''

2. Add profile

A profile owns a Kubernetes namespace of the same name. Users have view and modify access to their primary profiles.

kubectl apply -f - <<EOF
apiVersion: kubeflow.org/v1beta1
kind: Profile
metadata:
  name: kubeflow-newuser-mydomain-com 
spec:
  owner:
    kind: User
    name: newuser@mydomain.com
EOF

kubectl get profile

Also, you can share access to your profile with another user in the system. share_profile

99. FAQ

*

Leave a comment