integ/kubernetes/flux2-charts/debian/patches/0002-Add-template-option-to-allow-enabling-disabling-the-.patch
Igor Soares f07a14f46a Introduce flux2-charts package
Add FluxCD charts package in replacement to the manifests available
under the ansible-playbooks repository.

The existing manifests will be removed by the following review:
https://review.opendev.org/c/starlingx/ansible-playbooks/+/940832

This is part of a larger effort to move the FluxCD installation method
from a pure Ansible approach to a Helm-based method. This will ensure
tighter control over StarlingX required customizations via overrides
and make FluxCD uprev tasks simpler.

Test plan:
PASS: SX fresh install
PASS: DX fresh install
PASS: SX platform upgrade from previous version
PASS: DX platform upgrade from previous version
PASS: SX backup and restore
PASS: DX backup and restore

Story: 2011354
Task: 51691

Change-Id: Ib2da283a071b9dfb1de11aaf06446e30acf815d6
Signed-off-by: Igor Soares <Igor.PiresSoares@windriver.com>
2025-02-21 13:04:09 -03:00

67 lines
2.3 KiB
Diff

From 4d2eb3b9f265bcb4b80ff7d335a430560a29b234 Mon Sep 17 00:00:00 2001
From: Igor Soares <Igor.PiresSoares@windriver.com>
Date: Wed, 19 Feb 2025 10:19:02 -0300
Subject: [PATCH 2/2] Add template option to allow enabling/disabling the
pre-install job
Add the .Values.preInstallJob.create option to allow enabling/disabling
the pre-install job.
The service account related to the pre-install job will be
enabled/disabled accordingly as well.
This is required because in certain scenarios, such as platform
upgrades, we need to skip the Kubernetes version check.
Signed-off-by: Igor Soares <Igor.PiresSoares@windriver.com>
---
charts/flux2/templates/pre-install-job-serviceaccount.yaml | 2 ++
charts/flux2/templates/pre-install-job.yaml | 2 ++
charts/flux2/values.yaml | 3 +++
3 files changed, 7 insertions(+)
diff --git a/charts/flux2/templates/pre-install-job-serviceaccount.yaml b/charts/flux2/templates/pre-install-job-serviceaccount.yaml
index f634869..14b35fd 100644
--- a/charts/flux2/templates/pre-install-job-serviceaccount.yaml
+++ b/charts/flux2/templates/pre-install-job-serviceaccount.yaml
@@ -1,3 +1,4 @@
+{{- if and .Values.preInstallJob.create}}
apiVersion: v1
kind: ServiceAccount
metadata:
@@ -12,3 +13,4 @@ metadata:
"helm.sh/hook": pre-install
"helm.sh/hook-weight": "-10"
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
+{{- end }}
\ No newline at end of file
diff --git a/charts/flux2/templates/pre-install-job.yaml b/charts/flux2/templates/pre-install-job.yaml
index 2c2541f..59bfa32 100644
--- a/charts/flux2/templates/pre-install-job.yaml
+++ b/charts/flux2/templates/pre-install-job.yaml
@@ -1,3 +1,4 @@
+{{- if and .Values.preInstallJob.create}}
apiVersion: batch/v1
kind: Job
metadata:
@@ -70,3 +71,4 @@ spec:
{{- with .Values.cli.tolerations }}
tolerations: {{ toYaml . | nindent 8 }}
{{- end }}
+{{- end }}
\ No newline at end of file
diff --git a/charts/flux2/values.yaml b/charts/flux2/values.yaml
index 6a023c7..9277f13 100644
--- a/charts/flux2/values.yaml
+++ b/charts/flux2/values.yaml
@@ -325,3 +325,6 @@ prometheus:
- sourceLabels: [__meta_kubernetes_pod_phase]
action: keep
regex: Running
+
+preInstallJob:
+ create: true
--
2.34.1