diff --git a/packages/core/platform/bundles/paas-full.yaml b/packages/core/platform/bundles/paas-full.yaml index da5a0e8a..b66e8686 100644 --- a/packages/core/platform/bundles/paas-full.yaml +++ b/packages/core/platform/bundles/paas-full.yaml @@ -17,11 +17,28 @@ releases: privileged: true dependsOn: [] +- name: fluxcd-configure + releaseName: fluxcd-configure + chart: cozy-fluxcd-configure + namespace: cozy-fluxcd + dependsOn: [fluxcd-operator] + - name: fluxcd releaseName: fluxcd chart: cozy-fluxcd namespace: cozy-fluxcd - dependsOn: [fluxcd-operator,cilium,kubeovn] + dependsOn: [fluxcd-configure,cilium,kubeovn] + valuesFrom: + - kind: ConfigMap + name: fluxcd-instance-values-override + valuesKey: artifact + targetPath: "flux-instance.instance.distribution.artifact" + optional: true + - kind: ConfigMap + name: fluxcd-instance-values-override + valuesKey: artifactPullSecret + targetPath: "flux-instance.instance.distribution.artifactPullSecret" + optional: true - name: cilium releaseName: cilium diff --git a/packages/core/platform/bundles/paas-hosted.yaml b/packages/core/platform/bundles/paas-hosted.yaml index f082b3bb..83a9d0ab 100644 --- a/packages/core/platform/bundles/paas-hosted.yaml +++ b/packages/core/platform/bundles/paas-hosted.yaml @@ -17,11 +17,21 @@ releases: privileged: true dependsOn: [] +- name: fluxcd-configure + releaseName: fluxcd-configure + chart: cozy-fluxcd-configure + namespace: cozy-fluxcd + dependsOn: [fluxcd-operator] + - name: fluxcd releaseName: fluxcd chart: cozy-fluxcd namespace: cozy-fluxcd - dependsOn: [fluxcd-operator] + dependsOn: [fluxcd-configure] + valuesFrom: + - kind: ConfigMap + name: fluxcd-instance-values + valuesKey: values.yaml - name: cert-manager-crds releaseName: cert-manager-crds diff --git a/packages/system/fluxcd-configure/.helmignore b/packages/system/fluxcd-configure/.helmignore new file mode 100644 index 00000000..d5c178e8 --- /dev/null +++ b/packages/system/fluxcd-configure/.helmignore @@ -0,0 +1,3 @@ +images +hack +.gitkeep diff --git a/packages/system/fluxcd-configure/Chart.yaml b/packages/system/fluxcd-configure/Chart.yaml new file mode 100644 index 00000000..b805f071 --- /dev/null +++ b/packages/system/fluxcd-configure/Chart.yaml @@ -0,0 +1,3 @@ +apiVersion: v2 +name: cozy-fluxcd-configure +version: 0.0.0 # Placeholder, the actual version will be automatically set during the build process diff --git a/packages/system/fluxcd-configure/templates/configmap.yaml b/packages/system/fluxcd-configure/templates/configmap.yaml new file mode 100644 index 00000000..e582ab05 --- /dev/null +++ b/packages/system/fluxcd-configure/templates/configmap.yaml @@ -0,0 +1,18 @@ +{{- $fluxcdAirgapped := lookup "v1" "ConfigMap" "cozy-system" "cozy-airgapped" }} +{{- $artifact := "" }} +{{- $artifactPullSecret := "" }} +{{- if $fluxcdAirgapped }} + {{- $artifact = index $fluxcdAirgapped.data "artifact" | default "" }} + {{- $artifactPullSecret = index $fluxcdAirgapped.data "artifactPullSecret" | default "" }} +{{- end }} + +apiVersion: v1 +kind: ConfigMap +metadata: + name: fluxcd-instance-values-override + namespace: cozy-fluxcd +data: + {{- if $artifact }} + artifact: {{ $artifact | quote }} + {{- end }} + artifactPullSecret: {{ $artifactPullSecret | quote }} diff --git a/packages/system/fluxcd-configure/values.yaml b/packages/system/fluxcd-configure/values.yaml new file mode 100644 index 00000000..e69de29b