integ/kubernetes/flux2-charts-legacy/debian/patches/0001-Include-more-template-options-for-helm-and-source-co.patch
Igor Soares 9754c90b8f Upversion Flux to v2.5.1
Specific components upversioned:
* flux2-charts: v2.13.0 -> v1.15.0
* helm-controller: v1.0.1 -> v1.2.0
* source-controller: v1.3.0 -> 1.5.0
* notification-controller (optional): v1.3.0 -> 1.5.0
* kustomize-controller (optional): v1.3.0 -> 1.5.1

Image versions were also updated in the companion commit for the Ansible
playbooks repo:
https://review.opendev.org/c/starlingx/ansible-playbooks/+/947771

This moves the charts from the previous Flux version (v2.3.0) to a
legacy package named flux2-charts-legacy intended to be used for the
platform rollback scenario.

Test plan:

AIO-SX:
PASS: fresh install
PASS: platform upgrade
PASS: backup & restore
PASS: nginx-ingress-controller successfully
      uploaded/applied/removed/deleted
PASS: cert-manager successfully uploaded/applied/removed/deleted
PASS: platform-integ-apps successfully uploaded/applied/removed/deleted
PASS: oidc-auth-apps successfully uploaded/applied/removed/deleted
PASS: dell-storage successfully uploaded/applied/removed/deleted
PASS: rook-ceph successfully uploaded/applied/removed/deleted
PASS: deployment-manager successfully uploaded/applied/removed/deleted
PASS: enable notification and kustomize controllers

AIO-DX:
PASS: fresh install
PASS: platform upgrade
PASS: backup & restore

Standard:
PASS: fresh install
PASS: check if pods are allocated to controllers

Story: 2011354
Task: 52090

Change-Id: I6ab98897ab7fb97e557c3a596dea51462631da12
Signed-off-by: Igor Soares <Igor.PiresSoares@windriver.com>
2025-05-05 11:38:56 -03:00

136 lines
6.5 KiB
Diff

From 84b2ec2215807f522a6069fc12da519b2fe75ffd Mon Sep 17 00:00:00 2001
From: Igor Soares <Igor.PiresSoares@windriver.com>
Date: Wed, 19 Feb 2025 09:26:17 -0300
Subject: [PATCH 1/2] Include more template options for helm and source
controllers
Options added to the helm-controller deployment:
* readinessProbe.timeoutSeconds
* livenessProbe.timeoutSeconds
* terminationGracePeriodSeconds
Options added to the source-controller deployment:
* readinessProbe.timeoutSeconds
* livenessProbe.timeoutSeconds
Added as a global option and included in both controllers:
* logEncoding
In addition, the container.additionalArgs option was modified
to allow output redirection for both controllers.
Signed-off-by: Igor Soares <Igor.PiresSoares@windriver.com>
---
charts/flux2/templates/helm-controller.yaml | 25 +++++++------------
charts/flux2/templates/source-controller.yaml | 21 ++++++----------
2 files changed, 17 insertions(+), 29 deletions(-)
diff --git a/charts/flux2/templates/helm-controller.yaml b/charts/flux2/templates/helm-controller.yaml
index 0811c15..85c4c15 100644
--- a/charts/flux2/templates/helm-controller.yaml
+++ b/charts/flux2/templates/helm-controller.yaml
@@ -38,21 +38,8 @@ spec:
{{- toYaml .Values.helmController.initContainers | nindent 8}}
{{- end}}
containers:
- - args:
- {{- if .Values.multitenancy.enabled }}
- - --no-cross-namespace-refs=true
- - --default-service-account={{ .Values.multitenancy.defaultServiceAccount | default "default" }}
- {{- end}}
- {{- if .Values.notificationController.create }}
- - --events-addr=http://notification-controller.$(RUNTIME_NAMESPACE).svc.{{ .Values.clusterDomain | default "cluster.local" }}.
- {{- end}}
- - --watch-all-namespaces={{ .Values.watchAllNamespaces }}
- - --log-level={{ .Values.logLevel | default "info" }}
- - --log-encoding=json
- - --enable-leader-election
- {{- range .Values.helmController.container.additionalArgs }}
- - {{ . }}
- {{- end}}
+ - command: ["/bin/sh"]
+ args: ["-c", "helm-controller {{- if .Values.multitenancy.enabled }} --no-cross-namespace-refs=true --default-service-account={{ .Values.multitenancy.defaultServiceAccount | default "default" }} {{- end}} {{- if .Values.notificationController.create }} --events-addr=http://notification-controller.$(RUNTIME_NAMESPACE).svc.{{ .Values.clusterDomain | default "cluster.local" }}. {{- end}} --watch-all-namespaces={{ .Values.watchAllNamespaces }} --log-level={{ .Values.logLevel | default "info" }} --log-encoding={{ .Values.logEncoding | default "json" }} --enable-leader-election {{ .Values.helmController.container.additionalArgs }}"]
env:
- name: RUNTIME_NAMESPACE
valueFrom:
@@ -71,6 +58,9 @@ spec:
httpGet:
path: /healthz
port: healthz
+ {{- if and .Values.helmController.livenessProbe .Values.helmController.livenessProbe.timeoutSeconds }}
+ timeoutSeconds: {{ .Values.helmController.livenessProbe.timeoutSeconds }}
+ {{- end }}
name: manager
ports:
- containerPort: 8080
@@ -82,6 +72,9 @@ spec:
httpGet:
path: /readyz
port: healthz
+ {{- if and .Values.helmController.readinessProbe .Values.helmController.readinessProbe.timeoutSeconds }}
+ timeoutSeconds: {{ .Values.helmController.readinessProbe.timeoutSeconds }}
+ {{- end }}
{{- with .Values.helmController.resources }}
resources: {{ toYaml . | nindent 10 }}
{{- end }}
@@ -114,7 +107,7 @@ spec:
{{- if .Values.imagePullSecrets }}
imagePullSecrets: {{ toYaml .Values.imagePullSecrets | nindent 6 }}
{{- end }}
- terminationGracePeriodSeconds: 600
+ terminationGracePeriodSeconds: {{ .Values.helmController.terminationGracePeriodSeconds | default 600 }}
volumes:
- emptyDir: {}
name: temp
diff --git a/charts/flux2/templates/source-controller.yaml b/charts/flux2/templates/source-controller.yaml
index 46c7cfe..2bd2eea 100644
--- a/charts/flux2/templates/source-controller.yaml
+++ b/charts/flux2/templates/source-controller.yaml
@@ -36,19 +36,8 @@ spec:
{{- toYaml .Values.sourceController.initContainers | nindent 8}}
{{- end}}
containers:
- - args:
- {{- if .Values.notificationController.create }}
- - --events-addr=http://notification-controller.$(RUNTIME_NAMESPACE).svc.{{ .Values.clusterDomain | default "cluster.local" }}.
- {{- end}}
- - --watch-all-namespaces={{ .Values.watchAllNamespaces }}
- - --log-level={{ .Values.logLevel | default "info" }}
- - --log-encoding=json
- - --enable-leader-election
- - --storage-path=/data
- - --storage-adv-addr=source-controller.$(RUNTIME_NAMESPACE).svc.{{ .Values.clusterDomain | default "cluster.local" }}.
- {{- range .Values.sourceController.container.additionalArgs }}
- - {{ . }}
- {{- end}}
+ - command: ["/bin/sh"]
+ args: ["-c", "source-controller {{- if .Values.notificationController.create }} --events-addr=http://notification-controller.$(RUNTIME_NAMESPACE).svc.{{ .Values.clusterDomain | default "cluster.local" }}. {{- end}} --watch-all-namespaces={{ .Values.watchAllNamespaces }} --log-level={{ .Values.logLevel | default "info" }} --log-encoding={{ .Values.logEncoding | default "json" }} --enable-leader-election --storage-path=/data --storage-adv-addr=source-controller.$(RUNTIME_NAMESPACE).svc.{{ .Values.clusterDomain | default "cluster.local" }}. {{ .Values.sourceController.container.additionalArgs }}"]
env:
- name: RUNTIME_NAMESPACE
valueFrom:
@@ -67,6 +56,9 @@ spec:
httpGet:
path: /healthz
port: healthz
+ {{- if and .Values.sourceController.livenessProbe .Values.sourceController.livenessProbe.timeoutSeconds }}
+ timeoutSeconds: {{ .Values.sourceController.livenessProbe.timeoutSeconds }}
+ {{- end }}
name: manager
ports:
- containerPort: 9090
@@ -82,6 +74,9 @@ spec:
httpGet:
path: /
port: http
+ {{- if and .Values.sourceController.readinessProbe .Values.sourceController.readinessProbe.timeoutSeconds }}
+ timeoutSeconds: {{ .Values.sourceController.readinessProbe.timeoutSeconds }}
+ {{- end }}
{{- with .Values.sourceController.resources }}
resources: {{ toYaml . | nindent 10 }}
{{- end }}
--
2.34.1