Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions charts/kagenti-operator/templates/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ rules:
- update
- watch
- apiGroups:
- mlflow.opendatahub.io
- mlflow.kubeflow.org
resources:
- mlflowexperiments
- experiments
verbs:
- get
- list
Expand Down
4 changes: 2 additions & 2 deletions kagenti-operator/config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ rules:
- list
- watch
- apiGroups:
- mlflow.opendatahub.io
- mlflow.kubeflow.org
resources:
- mlflowexperiments
- experiments
verbs:
- get
- list
Expand Down
2 changes: 1 addition & 1 deletion kagenti-operator/docs/mlflow-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ The MLflow controller uses Kubernetes namespace-scoped authentication with least
1. **Operator access**: The controller-manager's ServiceAccount is bound (via a ClusterRoleBinding shipped in the Helm chart / kustomize) to the broad `mlflow-operator-mlflow-integration` ClusterRole. This lets the operator call the MLflow REST API to create experiments. The `X-MLFLOW-WORKSPACE` header is set to the agent's namespace, scoping the experiment to that workspace.

2. **Agent access (scoped)**: For each agent Deployment the controller creates:
- A **Role** named `kagenti-mlflow-<deployment-name>` with `get` and `update` on the `mlflowexperiments` resource, scoped to the agent's own experiment via `resourceNames`. This means agents **cannot** create/delete experiments or access `registeredmodels` or `gatewayendpoints`.
- A **Role** named `kagenti-mlflow-<deployment-name>` with `get` and `update` on the `experiments` resource (API group `mlflow.kubeflow.org`), scoped to the agent's own experiment via `resourceNames`. This means agents **cannot** create/delete experiments or access `registeredmodels` or `gatewayendpoints`.
- A **RoleBinding** with the same name that binds the agent's ServiceAccount to the scoped Role.

The agent authenticates to MLflow using its projected SA token at `/var/run/secrets/kubernetes.io/serviceaccount/token`.
Expand Down
12 changes: 6 additions & 6 deletions kagenti-operator/internal/controller/mlflow_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ import (
)

const (
// MLflowExperimentsAPIGroup is the API group used by the MLflow Kubernetes
// authorization plugin for SubjectAccessReview checks.
MLflowExperimentsAPIGroup = "mlflow.opendatahub.io"
// MLflowExperimentsAPIGroup is the API group used by the MLflow gateway's
// Kubernetes authorization plugin for SubjectAccessReview checks.
MLflowExperimentsAPIGroup = "mlflow.kubeflow.org"

// MLflowExperimentsResource is the virtual resource the MLflow gateway checks
// when authorizing experiment-level operations.
MLflowExperimentsResource = "mlflowexperiments"
// when authorizing experiment-level operations via SubjectAccessReview.
MLflowExperimentsResource = "experiments"

// MLflow annotation keys stored on the PodTemplateSpec.
AnnotationMLflowExperimentID = "mlflow.kagenti.io/experiment-id"
Expand Down Expand Up @@ -77,7 +77,7 @@ type MLflowReconciler struct {
}

// +kubebuilder:rbac:groups=mlflow.opendatahub.io,resources=mlflows,verbs=create;get;list;update;watch
// +kubebuilder:rbac:groups=mlflow.opendatahub.io,resources=mlflowexperiments,verbs=get;list;watch;update
// +kubebuilder:rbac:groups=mlflow.kubeflow.org,resources=experiments,verbs=get;list;watch;update
// +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=roles,verbs=create;get;list;watch;update
// +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=rolebindings,verbs=create;get;list;watch;update
// +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;update;patch
Expand Down
Loading