Skip to content

Commit e033b00

Browse files
feat: add rhai-operator chart (opendatahub-io#37)
* feat(RHOAIENG-49675): create rhaii-helm-chart * feat: update rhaii-helm-chart with correct env var configurations * feat: update rhaii-helm-chart with correct env var configurations and job which creates resources * feat(rhaii-helm-chart): add support to related images into the operator * fix: various fixes and docs improvements * secutity: improve hook job definition * docs: update docs
1 parent 9587ecc commit e033b00

48 files changed

Lines changed: 12943 additions & 487 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
scripts/

charts/rhaii-helm-chart/Chart.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: rhaii-helm-chart
3+
description: Red Hat OpenShift AI Operator Helm chart (non-OLM installation)
4+
type: application
5+
version: 0.1.0
6+
appVersion: "3.4.0-ea.2"

charts/rhaii-helm-chart/README.md

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# RHAII Helm Chart
2+
3+
Red Hat OpenShift AI Operator Helm chart for non-OLM installation.
4+
5+
This chart installs the RHAI operator and its cloud manager components. Exactly one cloud provider (Azure or CoreWeave) must be enabled.
6+
7+
## Prerequisites
8+
9+
- Kubernetes cluster
10+
- Helm 3.x
11+
- Cluster-admin privileges (the chart creates CRDs, ClusterRoles, and namespaces)
12+
13+
## Installation
14+
15+
### Azure
16+
17+
```bash
18+
helm upgrade rhaii ./charts/rhaii-helm-chart/ \
19+
--install --create-namespace \
20+
--namespace rhaii \
21+
--set azure.enabled=true
22+
```
23+
24+
### CoreWeave
25+
26+
```bash
27+
helm upgrade rhaii ./charts/rhaii-helm-chart/ \
28+
--install --create-namespace \
29+
--namespace rhaii \
30+
--set coreweave.enabled=true
31+
```
32+
33+
> **Note:** `helm install --wait` (or `helm upgrade --install --wait` the first time) is not supported at this stage. The chart uses post-install hooks (Jobs) to create Custom Resources after the operators are deployed. These hooks require the CRDs to be registered, but without the Custom Resource the rhods-operator will not start correctly because it needs the cert-manager, which means the `--wait` flag may cause the installation to time out or fail.
34+
35+
## What the Chart Installs
36+
37+
The chart deploys the following resources:
38+
39+
1. **RHAI Operator** — Deployment, ServiceAccount, RBAC, webhooks, and CRDs in the operator namespace
40+
2. **Cloud Manager** (Azure or CoreWeave) — Deployment, ServiceAccount, RBAC, and CRDs for the selected cloud provider
41+
3. **Post-install Job** — A Helm hook that automatically creates the required Custom Resources (Kserve, AzureKubernetesEngine, or CoreWeaveKubernetesEngine) after install/upgrade
42+
43+
### Custom Resources Created by Post-install Hook
44+
45+
The post-install Job creates the following CRs (configurable via values):
46+
47+
- **Kserve** — Created when `components.kserve.enabled=true` (default)
48+
- **AzureKubernetesEngine** — Created when `azure.enabled=true` and `azure.kubernetesEngine.enabled=true` (default)
49+
- **CoreWeaveKubernetesEngine** — Created when `coreweave.enabled=true` and `coreweave.kubernetesEngine.enabled=true` (default)
50+
51+
You can customize the spec of each CR through values. For example:
52+
53+
```yaml
54+
azure:
55+
enabled: true
56+
kubernetesEngine:
57+
spec:
58+
dependencies:
59+
certManager:
60+
managementPolicy: Unmanaged
61+
```
62+
63+
Set `managementPolicy: Unmanaged` for any dependency you want to manage yourself.
64+
65+
## Configuration
66+
67+
| Parameter | Description | Default |
68+
| --- | --- | --- |
69+
| `enabled` | Enable/disable all resource creation | `true` |
70+
| `installCRDs` | Install CRDs with the chart | `true` |
71+
| `labels` | Common labels applied to all resources | `{}` |
72+
| `imagePullSecrets` | Image pull secrets for private registries | `[]` |
73+
| **RHAI Operator** | | |
74+
| `rhaiOperator.namespace` | Operator namespace | `redhat-ods-operator` |
75+
| `rhaiOperator.applicationsNamespace` | Applications namespace | `redhat-ods-applications` |
76+
| `rhaiOperator.image` | Operator container image | `quay.io/opendatahub/opendatahub-operator:latest` |
77+
| `rhaiOperator.relatedImages` | Related images env vars (`RELATED_IMAGE_*`) | `{}` |
78+
| **Components** | | |
79+
| `components.kserve.enabled` | Create Kserve CR via post-install hook | `true` |
80+
| `components.kserve.spec` | Kserve CR spec | `{}` |
81+
| **Azure** | | |
82+
| `azure.enabled` | Enable Azure cloud provider | `false` |
83+
| `azure.cloudManager.namespace` | Azure Cloud Manager namespace | `rhai-cloudmanager-system` |
84+
| `azure.cloudManager.image` | Azure Cloud Manager image | `quay.io/opendatahub/opendatahub-operator:latest` |
85+
| `azure.kubernetesEngine.enabled` | Create AzureKubernetesEngine CR via post-install hook | `true` |
86+
| `azure.kubernetesEngine.spec` | AzureKubernetesEngine CR spec | See [values.yaml](values.yaml) |
87+
| **CoreWeave** | | |
88+
| `coreweave.enabled` | Enable CoreWeave cloud provider | `false` |
89+
| `coreweave.cloudManager.namespace` | CoreWeave Cloud Manager namespace | `rhai-cloudmanager-system` |
90+
| `coreweave.cloudManager.image` | CoreWeave Cloud Manager image | `quay.io/opendatahub/opendatahub-operator:latest` |
91+
| `coreweave.kubernetesEngine.enabled` | Create CoreWeaveKubernetesEngine CR via post-install hook | `true` |
92+
| `coreweave.kubernetesEngine.spec` | CoreWeaveKubernetesEngine CR spec | See [values.yaml](values.yaml) |
93+
94+
## Testing with kind
95+
96+
You can test the chart locally using [kind](https://kind.sigs.k8s.io/).
97+
98+
### Create a cluster
99+
100+
```bash
101+
kind create cluster --name rhoai --config ./kind.config.yaml
102+
```
103+
104+
An example `kind.config.yaml` that uses local container registry credentials:
105+
106+
```yaml
107+
kind: Cluster
108+
apiVersion: kind.x-k8s.io/v1alpha4
109+
nodes:
110+
- role: control-plane
111+
extraMounts:
112+
- hostPath: /path/to/your/auth.json
113+
containerPath: /var/lib/kubelet/config.json
114+
```
115+
116+
This mounts a local `auth.json` into the kind node so it can pull images from private registries. Set `hostPath` to the actual path of your container credentials file (e.g. `$HOME/.config/containers/auth.json` or `$XDG_RUNTIME_DIR/containers/auth.json`, depending on your system).
117+
118+
Alternatively, the chart supports `imagePullSecrets` — see the [Configuration](#configuration) section.
119+
120+
### Install the chart
121+
122+
```bash
123+
helm upgrade rhaii ./charts/rhaii-helm-chart/ \
124+
--install --create-namespace \
125+
--namespace rhaii \
126+
--set azure.enabled=true
127+
```
128+
129+
## Uninstall
130+
131+
```bash
132+
helm uninstall rhaii -n rhaii
133+
```
134+
135+
CRDs are **not** removed on uninstall (`helm.sh/resource-policy: keep`). To remove them manually:
136+
137+
```bash
138+
kubectl delete crd kserves.components.platform.opendatahub.io
139+
kubectl delete crd azurekubernetesengines.infrastructure.opendatahub.io
140+
kubectl delete crd coreweavekubernetesengines.infrastructure.opendatahub.io
141+
```
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# rhaii-helm-chart
2+
3+
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.4.0-ea.2](https://img.shields.io/badge/AppVersion-3.4.0--ea.2-informational?style=flat-square)
4+
5+
Red Hat OpenShift AI Operator Helm chart (non-OLM installation)
6+
7+
## Values
8+
9+
| Key | Type | Default | Description |
10+
|-----|------|---------|-------------|
11+
| azure.cloudManager.image | string | `"quay.io/opendatahub/opendatahub-operator:latest"` | |
12+
| azure.cloudManager.namespace | string | `"rhai-cloudmanager-system"` | |
13+
| azure.enabled | bool | `false` | |
14+
| azure.kubernetesEngine.enabled | bool | `true` | |
15+
| azure.kubernetesEngine.spec.dependencies.certManager.configuration | object | `{}` | |
16+
| azure.kubernetesEngine.spec.dependencies.certManager.managementPolicy | string | `"Managed"` | |
17+
| azure.kubernetesEngine.spec.dependencies.gatewayAPI.configuration | object | `{}` | |
18+
| azure.kubernetesEngine.spec.dependencies.gatewayAPI.managementPolicy | string | `"Managed"` | |
19+
| azure.kubernetesEngine.spec.dependencies.lws.configuration | object | `{}` | |
20+
| azure.kubernetesEngine.spec.dependencies.lws.managementPolicy | string | `"Managed"` | |
21+
| azure.kubernetesEngine.spec.dependencies.sailOperator.configuration | object | `{}` | |
22+
| azure.kubernetesEngine.spec.dependencies.sailOperator.managementPolicy | string | `"Managed"` | |
23+
| components.kserve.enabled | bool | `true` | |
24+
| components.kserve.spec | object | `{}` | |
25+
| coreweave.cloudManager.image | string | `"quay.io/opendatahub/opendatahub-operator:latest"` | |
26+
| coreweave.cloudManager.namespace | string | `"rhai-cloudmanager-system"` | |
27+
| coreweave.enabled | bool | `false` | |
28+
| coreweave.kubernetesEngine.enabled | bool | `true` | |
29+
| coreweave.kubernetesEngine.spec.dependencies.certManager.configuration | object | `{}` | |
30+
| coreweave.kubernetesEngine.spec.dependencies.certManager.managementPolicy | string | `"Managed"` | |
31+
| coreweave.kubernetesEngine.spec.dependencies.gatewayAPI.configuration | object | `{}` | |
32+
| coreweave.kubernetesEngine.spec.dependencies.gatewayAPI.managementPolicy | string | `"Managed"` | |
33+
| coreweave.kubernetesEngine.spec.dependencies.lws.configuration | object | `{}` | |
34+
| coreweave.kubernetesEngine.spec.dependencies.lws.managementPolicy | string | `"Managed"` | |
35+
| coreweave.kubernetesEngine.spec.dependencies.sailOperator.configuration | object | `{}` | |
36+
| coreweave.kubernetesEngine.spec.dependencies.sailOperator.managementPolicy | string | `"Managed"` | |
37+
| enabled | bool | `true` | |
38+
| imagePullSecrets | list | `[]` | |
39+
| installCRDs | bool | `true` | |
40+
| labels | object | `{}` | |
41+
| rhaiOperator.applicationsNamespace | string | `"redhat-ods-applications"` | |
42+
| rhaiOperator.image | string | `"quay.io/opendatahub/opendatahub-operator:latest"` | |
43+
| rhaiOperator.namespace | string | `"redhat-ods-operator"` | |
44+
| rhaiOperator.relatedImages | object | `{}` | |
45+
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# helmtemplate-generator configuration for cloudmanager resources
2+
#
3+
# Placeholders (replaced by update-bundle.sh via sed):
4+
# CLOUD_NAME - cloud name (azure or coreweave)
5+
# CLOUD_DIR - output subdirectory (cloudmanager/azure or cloudmanager/coreweave)
6+
7+
rules:
8+
# Replace namespace references with Helm template
9+
- match:
10+
excludeKinds:
11+
- CustomResourceDefinition
12+
- Namespace
13+
- ClusterRole
14+
- ClusterRoleBinding
15+
changes:
16+
- path: .metadata.namespace
17+
value: '{{ .Values.CLOUD_NAME.cloudManager.namespace }}'
18+
19+
# Replace Namespace resource name
20+
- match:
21+
kinds:
22+
- Namespace
23+
changes:
24+
- path: .metadata.name
25+
value: '{{ .Values.CLOUD_NAME.cloudManager.namespace }}'
26+
27+
# Replace namespace in RoleBinding/ClusterRoleBinding subjects
28+
- match:
29+
kinds:
30+
- RoleBinding
31+
- ClusterRoleBinding
32+
changes:
33+
- path: .subjects[0].namespace
34+
value: '{{ .Values.CLOUD_NAME.cloudManager.namespace }}'
35+
36+
# Replace container image with Helm value
37+
- match:
38+
kinds:
39+
- Deployment
40+
changes:
41+
- path: .spec.template.spec.containers[0].image
42+
value: '{{ .Values.CLOUD_NAME.cloudManager.image }}'
43+
- path: .spec.template.spec.containers[name=manager].env[name=RHAI_OPERATOR_NAMESPACE].value
44+
value: '{{ .Values.rhaiOperator.namespace }}'
45+
46+
# Wrap all resources with cloud enabled conditional
47+
- wrap:
48+
before: '{{- if .Values.CLOUD_NAME.enabled }}'
49+
after: '{{- end }}'
50+
51+
- match:
52+
kinds:
53+
- CustomResourceDefinition
54+
changes:
55+
- path: .metadata.annotations["helm.sh/resource-policy"]
56+
value: keep
57+
58+
output:
59+
splitByDocument: true
60+
directoryRules:
61+
- match:
62+
kinds:
63+
- CustomResourceDefinition
64+
directory: CLOUD_DIR/crds
65+
- match:
66+
kinds:
67+
- Role
68+
- RoleBinding
69+
- ClusterRole
70+
- ClusterRoleBinding
71+
- ServiceAccount
72+
directory: CLOUD_DIR/rbac
73+
- match:
74+
kinds:
75+
- Deployment
76+
- Namespace
77+
directory: CLOUD_DIR/manager
78+
- match:
79+
kinds:
80+
- ValidatingWebhookConfiguration
81+
- MutatingWebhookConfiguration
82+
directory: CLOUD_DIR/webhooks
83+
- match:
84+
kinds:
85+
- Service
86+
names:
87+
- '*webhook*'
88+
directory: CLOUD_DIR/webhooks
89+
- match:
90+
kinds:
91+
- Service
92+
directory: CLOUD_DIR/manager

0 commit comments

Comments
 (0)