Changing Default Root User and Admin Role in Helm Deployment

Original Slack Thread

How to change default root user in helm deployment? I follow the doc, but when log in, user doesn’t have Admin role.

Hey there! :wave:

<@U06TM7M40RK> Can you help with the questions in this thread?

:information_source: Please continue to tag RunLLM (e.g <@U06TM7M40RK>) to have it continue generating responses!

To change the default root user in a Helm deployment and ensure that the user has Admin role, you can follow these steps:

  1. Create a user.props File: This file should contain the username and password for the DataHub user. For example:

    datahub:SomePassword123
    
  2. Create a Kubernetes Secret: Use the user.props file to create a Kubernetes secret. This secret will be used to configure the DataHub frontend.

    kubectl create secret generic datahub-users-secret --from-file=user.props=./path-to-your-user.props
    
  3. Update the values.yaml File: Modify your values.yaml file to mount the secret as a volume in the datahub-frontend container. This ensures that the DataHub frontend uses the credentials from the user.props file.

    datahub-frontend:
      ...
      extraVolumes:
        - name: datahub-users
          secret:
            defaultMode: 0444
            secretName: datahub-users-secret
      extraVolumeMounts:
        - name: datahub-users
          mountPath: /datahub-frontend/conf/user.props
          subPath: user.props
    
  4. Apply the Updated Helm Chart: Use the following command to upgrade your Helm deployment with the updated values.yaml:

    helm upgrade datahub datahub/datahub --values path-to-values.yaml
    
  5. Assign Admin Role: After logging in with the datahub user, you can assign the Admin role to other users. Navigate to Settings > Users & Groups > Users, and assign the Admin role to the desired user.

If the datahub user does not have Admin permissions, you may need to manually update the role membership in the MySQL database where DataHub stores its metadata. You can do this by inserting the roleMembership aspect for the datahub user with the Admin role.

For more detailed instructions, you can refer to the <https://datahubproject.io/docs/0.13.1/authentication/changing-default-credentials|Changing the default user credentials> guide.

Would you like more detailed steps or further assistance on this?

Sources:

can I change the user to something else except “datahub”?

<@U06TM7M40RK> can I change the user to something else except “datahub”?

Yes, you can change the default user to something other than “datahub” by modifying the user.props file. However, it’s important to ensure that the new user has the necessary permissions and roles assigned. Here’s how you can do it:

  1. Create a user.props File: Define the new username and password in the user.props file. For example, if you want to change the user to “newuser”:

    newuser:NewPassword123
    
  2. Create a Kubernetes Secret: Use the user.props file to create a Kubernetes secret.

    kubectl create secret generic datahub-users-secret --from-file=user.props=./path-to-your-user.props
    
  3. Update the values.yaml File: Modify your values.yaml file to mount the secret as a volume in the datahub-frontend container.

    datahub-frontend:
      ...
      extraVolumes:
        - name: datahub-users
          secret:
            defaultMode: 0444
            secretName: datahub-users-secret
      extraVolumeMounts:
        - name: datahub-users
          mountPath: /datahub-frontend/conf/user.props
          subPath: user.props
    
  4. Apply the Updated Helm Chart: Upgrade your Helm deployment with the updated values.yaml.

    helm upgrade datahub datahub/datahub --values path-to-values.yaml
    
  5. Assign Admin Role: After logging in with the new user, ensure that the user has the Admin role. You may need to manually update the role membership in the MySQL database if the new user does not automatically have Admin permissions.

It’s crucial to ensure that the new user is correctly configured with the necessary roles and permissions. If you encounter issues with permissions, you may need to manually adjust the role assignments in the backend database.

Would you like more detailed instructions on any specific part of this process?

Sources:

<@U06TM7M40RK> how to change role membership in database?