Skip to content

Commit e5bdc51

Browse files
authored
Merge pull request #9 from red-hat-data-services/main
Sync rhai-helm-chart branch
2 parents c0f27ac + 4f00693 commit e5bdc51

47 files changed

Lines changed: 19809 additions & 142 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.

charts/README.md

Lines changed: 63 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -202,28 +202,81 @@ kubectl annotate validatingwebhookconfiguration istio-validator-istio-system sai
202202

203203
### Operator charts (bundle-derived)
204204

205-
The operator charts include an `update-bundle.sh` script that extracts fresh manifests from Red Hat operator bundles:
205+
Each operator chart under `charts/dependencies/` includes an `update-bundle.sh` script that extracts fresh manifests from Red Hat operator bundles.
206+
207+
**Prerequisites:** `podman`, `python3`, `pyyaml`, and registry authentication:
206208

207209
```bash
208-
# Requires: podman, python3, pyyaml
209-
# Requires: podman login registry.redhat.io
210+
podman login registry.redhat.io
211+
```
210212

211-
./charts/cert-manager-operator/scripts/update-bundle.sh v1.15.2
212-
./charts/lws-operator/scripts/update-bundle.sh 1.0
213-
./charts/sail-operator/scripts/update-bundle.sh 3.2.1
213+
**Update commands:**
214+
215+
```bash
216+
./charts/dependencies/cert-manager-operator/scripts/update-bundle.sh v1.18.1
217+
./charts/dependencies/lws-operator/scripts/update-bundle.sh 1.0
218+
./charts/dependencies/sail-operator/scripts/update-bundle.sh 3.2.1
214219
```
215220

216221
The scripts:
217222
1. Pull the operator bundle image from `registry.redhat.io`
218-
2. Extract manifests using `olm-extractor`
219-
3. Split into CRDs (`crds/`) and templates (`templates/`)
223+
2. Extract manifests using [`olm-extractor`](https://github.com/lburgazzoli/olm-extractor)
224+
3. Split into CRDs (`crds/`) and templates (`templates/`), templatizing namespace references
220225
4. Update `bundle.version` in `values.yaml`
221226

227+
**After updating**, review the generated manifests and verify with:
228+
229+
```bash
230+
helm lint charts/dependencies/<chart-name>/
231+
make chart-snapshots
232+
```
233+
222234
### Gateway API chart (CRDs only)
223235

224236
The `gateway-api` chart contains cluster-scoped CRDs downloaded directly from GitHub (not from an operator bundle). Use `update-crds.sh` to update:
225237

226238
```bash
227-
./charts/gateway-api/scripts/update-crds.sh v1.4.0
228-
./charts/gateway-api/scripts/update-crds.sh v1.4.0 experimental # for experimental channel
239+
./charts/dependencies/gateway-api/scripts/update-crds.sh v1.4.0
240+
./charts/dependencies/gateway-api/scripts/update-crds.sh v1.4.0 experimental # for experimental channel
241+
```
242+
243+
The script downloads CRDs from the [kubernetes-sigs/gateway-api](https://github.com/kubernetes-sigs/gateway-api) repository and updates both `values.yaml` and `Chart.yaml` with the new version.
244+
245+
**After updating**, review the generated manifests and verify with:
246+
247+
```bash
248+
helm lint charts/dependencies/gateway-api/
249+
make chart-snapshots
250+
```
251+
252+
### RHAII Helm Chart
253+
254+
The `rhaii-helm-chart` generates its templates from the [opendatahub-operator](https://github.com/opendatahub-io/opendatahub-operator) repository using kustomize and [helmtemplate-generator](https://github.com/davidebianchi/helmtemplate-generator). It also generates cloud-specific (Azure, CoreWeave) cloudmanager templates.
255+
256+
**Prerequisites:** `go`, `kustomize`, and SSH access to the opendatahub-operator repo.
257+
258+
**Update from the default branch (main):**
259+
260+
```bash
261+
./charts/rhaii-helm-chart/scripts/update-bundle.sh v2.19.0
229262
```
263+
264+
**Update from a specific branch:**
265+
266+
```bash
267+
./charts/rhaii-helm-chart/scripts/update-bundle.sh v2.19.0 --branch feat/my-branch
268+
```
269+
270+
**Update from a local opendatahub-operator checkout** (skips cloning):
271+
272+
```bash
273+
./charts/rhaii-helm-chart/scripts/update-bundle.sh v2.19.0 --odh-operator-dir /path/to/opendatahub-operator
274+
```
275+
276+
The script:
277+
278+
1. Clones (or uses a local) opendatahub-operator repo and runs `make manifests-all`
279+
2. Builds kustomize manifests from `config/rhaii/rhoai/default/`
280+
3. Pipes them through `helmtemplate-generator` to produce Helm templates
281+
4. Repeats for each cloudmanager target (Azure, CoreWeave) from `config/cloudmanager/<cloud>/rhoai/`
282+
5. Updates `Chart.yaml` with the new `appVersion`

charts/dependencies/cert-manager-operator/api-docs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Red Hat cert-manager Operator for vanilla Kubernetes (without OLM)
1515
| Key | Type | Default | Description |
1616
|-----|------|---------|-------------|
1717
| bundle.version | string | `"v1.18.1"` | |
18+
| imagePullSecrets[0].name | string | `"rhaii-pull-secret"` | |
1819
| operandNamespace | string | `"cert-manager"` | |
1920
| operatorNamespace | string | `"cert-manager-operator"` | |
2021

charts/dependencies/cert-manager-operator/scripts/update-bundle.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ echo "[2/3] Cleaning old manifests..."
6666
find "$CHART_DIR/crds" -name "*.yaml" -delete 2>/dev/null || true
6767
find "$CHART_DIR/templates" -name "*.yaml" \
6868
! -name "namespace.yaml" \
69+
! -name "serviceaccount-cert-manager.yaml" \
6970
-delete 2>/dev/null || true
7071

7172
# Split manifests into CRDs and templates, templatize namespace references
@@ -136,6 +137,9 @@ for doc in docs:
136137
content = doc.strip()
137138
content = content.replace('namespace: cert-manager-operator', 'namespace: {{ .Values.operatorNamespace }}')
138139
content = content.replace('namespace: cert-manager', 'namespace: {{ .Values.operandNamespace }}')
140+
# Add imagePullSecrets to ServiceAccounts
141+
if kind == 'ServiceAccount':
142+
content += '\n{{- with .Values.imagePullSecrets }}\nimagePullSecrets:\n {{- toYaml . | nindent 2 }}\n{{- end }}'
139143
with open(filepath, 'w') as out:
140144
out.write(content + '\n')
141145

charts/dependencies/cert-manager-operator/templates/serviceaccount-cert-manager-operator-controller-manager.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ kind: ServiceAccount
33
metadata:
44
name: cert-manager-operator-controller-manager
55
namespace: {{ .Values.operatorNamespace }}
6+
{{- with .Values.imagePullSecrets }}
7+
imagePullSecrets:
8+
{{- toYaml . | nindent 2 }}
9+
{{- end }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{{- if .Values.imagePullSecrets }}
2+
{{- $serviceAccounts := list "cert-manager" "cert-manager-cainjector" "cert-manager-webhook" }}
3+
{{- range $serviceAccounts }}
4+
---
5+
apiVersion: v1
6+
kind: ServiceAccount
7+
metadata:
8+
name: {{ . }}
9+
namespace: {{ $.Values.operandNamespace }}
10+
{{- with $.Values.imagePullSecrets }}
11+
imagePullSecrets:
12+
{{- toYaml . | nindent 2 }}
13+
{{- end }}
14+
{{- end }}
15+
{{- end }}

0 commit comments

Comments
 (0)