Configure limited admin permissions¶
Running the DataRobot platform installation with limited admin permissions requires additional setup described on this page. A dedicated Helm chart called admin-privileges creates an installer service account (typically datarobot-installer) with the necessary, but restricted, permissions.
You must perform the following steps with cluster-admin permissions.
Note
Template files for these steps are available in the limited_admin_templates folder within the DataRobot artifact tarball.
Set a DataRobot namespace¶
export NAMESPACE="DATAROBOT_NAMESPACE"
Note
Replace DATAROBOT_NAMESPACE with your DataRobot namespace.
Create a DataRobot namespace¶
You must create a namespace where the DataRobot charts will be installed.
kubectl create namespace ${NAMESPACE}
Run the admin-privileges Helm chart¶
To deploy and run the admin-privileges Helm chart, follow these steps:
-
Add the DataRobot OSS Helm repository if you haven't already:
helm repo add datarobot-oss https://datarobot-oss.github.io/helm-charts helm repo update -
Install or upgrade the
admin-privilegeschart.helm upgrade --install admin-privs datarobot-oss/admin-privileges --namespace ${NAMESPACE} --debugThe release name is
admin-privsin this example. -
(Optional) If you need to download the chart locally before installation, use the following command:
helm pull datarobot-oss/admin-privileges
Install CRDs in your cluster¶
DataRobot requires several Custom Resource Definitions (CRDs) to function properly. When using limited admin permissions, you must install these CRDs manually.
-
Extract the
CustomResourceDefinitionmanifests from the DataRobot application chart template. Replacepath/to/datarobot-chart-X.X.X.X.tgzwith the path to the DataRobot chart package andX.X.X.Xwith the correct version. This example uses the yq utility:helm template path/to/datarobot-chart-X.X.X.X.tgz | yq eval 'select(.kind == "CustomResourceDefinition")' - > crds.yaml -
Apply the extracted CRD manifests to your cluster. You must perform this step with appropriate
cluster-adminpermissions.kubectl apply -f crds.yaml -
To prevent the DataRobot Helm chart from attempting to install these CRDs again, add the following key to your
values_dr.yamlfile for the main DataRobot application chart:global: installCRDs: false
Generate generic kubeconfig¶
To generate a kubeconfig file for the datarobot-installer ServiceAccount that is portable for generic Kubernetes clusters, use the following commands:
Replace SERVICE_ACCOUNT_NAME if it differs from datarobot-installer, and SERVICE_ACCOUNT_NAMESPACE if it differs from dr-app. The kubeconfig file will be created at /tmp/datarobot-installer-kubeconfig.
CONTEXT_NAME=$(kubectl config current-context)
CURRENT_CLUSTER=$(kubectl config view -o=jsonpath="{.contexts[?(@.name==\"${CONTEXT_NAME}\")].context.cluster}")
CLUSTER_CA=$(kubectl config view --raw -o=jsonpath="{.clusters[?(@.name==\"${CURRENT_CLUSTER}\")].cluster.certificate-authority-data}")
CLUSTER_SERVER=$(kubectl config view -o=jsonpath="{.clusters[?(@.name==\"${CURRENT_CLUSTER}\")].cluster.server}")
if [ -z "$CURRENT_CLUSTER" ] || [ -z "$CLUSTER_CA" ] || [ -z "$CLUSTER_SERVER" ]; then
echo "Error: Unable to retrieve cluster information from the current context."
exit 1
fi
export SERVICE_ACCOUNT_NAME="${SERVICE_ACCOUNT_NAME:-datarobot-installer}"
export SERVICE_ACCOUNT_NAMESPACE="${SERVICE_ACCOUNT_NAMESPACE:-dr-app}"
export SERVICE_ACCOUNT_TOKEN=$(kubectl -n "$SERVICE_ACCOUNT_NAMESPACE" get secret "$SERVICE_ACCOUNT_NAME" -o jsonpath="{.data.token}" | base64 --decode)
cat << EOF > /tmp/datarobot-installer-kubeconfig
apiVersion: v1
kind: Config
current-context: ${CONTEXT_NAME}
contexts:
- name: ${CONTEXT_NAME}
context:
cluster: ${CONTEXT_NAME}
user: ${SERVICE_ACCOUNT_NAME}
namespace: ${SERVICE_ACCOUNT_NAMESPACE}
clusters:
- name: ${CONTEXT_NAME}
cluster:
certificate-authority-data: ${CLUSTER_CA}
server: ${CLUSTER_SERVER}
users:
- name: ${SERVICE_ACCOUNT_NAME}
user:
token: ${SERVICE_ACCOUNT_TOKEN}
EOF
````
To use this `kubeconfig`, make it available to your `kubectl` commands. The easiest option is to set an environment variable:
```shell
export KUBECONFIG=/tmp/datarobot-installer-kubeconfig
Generate kubeconfig for OpenShift (OCP)¶
For OpenShift Container Platform (OCP) environments, you need to grant the datarobot-installer ServiceAccount the necessary permissions within your created namespace. DataRobot recommends using the existing admin role, limited to this namespace.
Apply built-in admin role (OpenShift)¶
To apply the admin role to the datarobot-installer ServiceAccount for your DataRobot namespace, use the OpenShift CLI (oc):
oc adm policy add-role-to-user admin -z datarobot-installer -n ${NAMESPACE}
After granting permissions, you need to generate a kubeconfig file for this ServiceAccount and log in.
Generate kubeconfig and log in¶
-
Obtain the ServiceAccount token and log in to the OpenShift cluster. Replace
api.example.com:6443with your cluster's API server. Thekubeconfigwill be saved to~/.kube/datarobot-installer-kubeconfig.TOKEN=$(oc get secret -n ${NAMESPACE} datarobot-installer -o jsonpath="{.data.token}" | base64 --decode) oc login --server=api.example.com:6443 --token="$TOKEN" --kubeconfig=~/.kube/datarobot-installer-kubeconfig -
Set the
KUBECONFIGenvironment variable to use this new configuration file.export KUBECONFIG=~/.kube/datarobot-installer-kubeconfig