Skip to content

Commit 3deff65

Browse files
authored
chore(t8s-cluster/flux): use centralised HelmRepositories instead of per-instance (#1758)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Centralized Helm chart sources to a fixed namespace (flux-system) and replaced per-release dynamic repository names with stable names. * Standardized chart resolution by adding a repository namespace to chart specs and removing release-name prepending. * **New Features** * Added explicit repository URL support and automatic detection of OCI-style registry URLs. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent b3c412d commit 3deff65

6 files changed

Lines changed: 21 additions & 18 deletions

File tree

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
{{- range $name, $config := .Values.global.helmRepositories }}
2-
{{- $create := true -}}
3-
{{- if $config.condition -}}
4-
{{- $create = eq (include "common.tplvalues.render" (dict "value" $config.condition "context" (deepCopy $))) "true" -}}
5-
{{- end -}}
6-
{{- if $create -}}
1+
# just for artifacthub image resolving
2+
{{ if eq .Release.Namespace "default" -}}
3+
{{- range $name, $config := .Values.global.helmRepositories -}}
4+
{{- $create := true -}}
5+
{{- if $config.condition -}}
6+
{{- $create = eq (include "common.tplvalues.render" (dict "value" $config.condition "context" (deepCopy $))) "true" -}}
7+
{{- end -}}
8+
{{- if $create -}}
79
apiVersion: source.toolkit.fluxcd.io/v1
810
kind: HelmRepository
911
metadata:
10-
name: {{ printf "%s-%s" $.Release.Name $name | quote }}
11-
namespace: {{ $.Release.Namespace }}
12+
name: {{ $name | quote }}
13+
namespace: flux-system
1214
labels: {{- include "common.labels.standard" $ | nindent 4 }}
1315
spec:
1416
interval: 5m
@@ -17,5 +19,6 @@ spec:
1719
type: oci
1820
{{- end }}
1921
---
20-
{{ end -}}
21-
{{- end }}
22+
{{ end -}}
23+
{{- end }}
24+
{{- end -}}

charts/t8s-cluster/templates/workload-cluster/_helmRelease.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ spec:
1414
version: 0.1.1
1515
sourceRef:
1616
kind: HelmRepository
17-
name: {{ printf "%s-cetic" .Release.Name }}
18-
namespace: {{ .Release.Namespace }}
17+
name: cetic
18+
namespace: flux-system
1919
interval: 1h
2020
driftDetection:
2121
mode: enabled

charts/t8s-cluster/templates/workload-cluster/cinder-csi-plugin/cinder-csi-plugin.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ spec:
1313
chart: openstack-cinder-csi
1414
sourceRef:
1515
kind: HelmRepository
16-
name: {{ printf "%s-cloud-provider-openstack" .Release.Name }}
17-
namespace: {{ .Release.Namespace }}
16+
name: cloud-provider-openstack
17+
namespace: flux-system
1818
version: {{ $selectedVersion | quote }}
1919
interval: 1h
2020
driftDetection:

charts/t8s-cluster/templates/workload-cluster/cloud-controller-manager.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ spec:
1212
chart: openstack-cloud-controller-manager
1313
sourceRef:
1414
kind: HelmRepository
15-
name: {{ printf "%s-cloud-provider-openstack" .Release.Name }}
16-
namespace: {{ .Release.Namespace }}
15+
name: cloud-provider-openstack
16+
namespace: flux-system
1717
version: {{ $selectedVersion | quote }}
1818
interval: 1h
1919
driftDetection:

charts/t8s-cluster/templates/workload-cluster/cni-cilium.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
labels: {{- include "common.labels.standard" . | nindent 4 }}
88
spec:
99
chart:
10-
spec: {{- include "common.helm.chartSpec" (dict "repo" "cilium" "prependReleaseName" true "chart" "cilium" "context" $) | nindent 6 }}
10+
spec: {{- include "common.helm.chartSpec" (dict "repo" "cilium" "repoNamespace" "flux-system" "chart" "cilium" "context" $) | nindent 6 }}
1111
interval: 1h
1212
driftDetection:
1313
mode: enabled

charts/t8s-cluster/templates/workload-cluster/gpu-operator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
labels: {{- include "common.labels.standard" . | nindent 4 }}
88
spec:
99
chart:
10-
spec: {{- include "common.helm.chartSpec" (dict "repo" "nvidia" "prependReleaseName" true "chart" "gpu-operator" "context" $) | nindent 6 }}
10+
spec: {{- include "common.helm.chartSpec" (dict "repo" "nvidia" "repoNamespace" "flux-system" "chart" "gpu-operator" "context" $) | nindent 6 }}
1111
interval: 1h
1212
driftDetection:
1313
mode: enabled

0 commit comments

Comments
 (0)