From 4c3a9bf4a2f7ac82e68aa9fe7844735cebed3e26 Mon Sep 17 00:00:00 2001 From: "Jenkins Infra Bot (updatecli)" <60776566+jenkins-infra-bot@users.noreply.github.com> Date: Thu, 28 Sep 2023 00:20:39 +0000 Subject: [PATCH 01/11] chore: Update accountapp helm chart MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Made with ❤️️ by updatecli --- charts/accountapp/Chart.yaml | 2 +- charts/accountapp/values.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/accountapp/Chart.yaml b/charts/accountapp/Chart.yaml index 2317d5414..cc30bb6b6 100644 --- a/charts/accountapp/Chart.yaml +++ b/charts/accountapp/Chart.yaml @@ -3,4 +3,4 @@ description: A Helm chart for accounts.jenkins.io maintainers: - name: timja name: accountapp -version: 0.7.3 +version: 0.7.4 diff --git a/charts/accountapp/values.yaml b/charts/accountapp/values.yaml index 6ecf4a23b..e3b585227 100644 --- a/charts/accountapp/values.yaml +++ b/charts/accountapp/values.yaml @@ -4,7 +4,7 @@ replicaCount: 1 image: repository: jenkinsciinfra/account-app - tag: 0.4.50 + tag: 0.4.51 pullPolicy: IfNotPresent imagePullSecrets: [] nameOverride: "" From a72a24d49299321a6b6dc90ddf070b9f781df86a Mon Sep 17 00:00:00 2001 From: smerle33 Date: Thu, 28 Sep 2023 09:43:26 +0200 Subject: [PATCH 02/11] feat(account-app): adding a PodDisruptionBudget --- charts/accountapp/templates/_helpers.tpl | 8 ++++++++ charts/accountapp/templates/pdb.yaml | 18 ++++++++++++++++++ .../accountapp/tests/custom_values_test.yaml | 16 ++++++++++++++++ charts/accountapp/tests/defaults_test.yaml | 6 ++++++ charts/accountapp/values.yaml | 2 ++ 5 files changed, 50 insertions(+) create mode 100644 charts/accountapp/templates/pdb.yaml diff --git a/charts/accountapp/templates/_helpers.tpl b/charts/accountapp/templates/_helpers.tpl index 6093258d6..b0cad3a31 100644 --- a/charts/accountapp/templates/_helpers.tpl +++ b/charts/accountapp/templates/_helpers.tpl @@ -44,3 +44,11 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} app.kubernetes.io/managed-by: {{ .Release.Service }} jenkins.io/maintainer: {{ (index .Chart.Maintainers 0).Name }} {{- end -}} + +{{/* +Selector labels +*/}} +{{- define "accountapp.selectorLabels" -}} +app.kubernetes.io/name: {{ include "accountapp.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/charts/accountapp/templates/pdb.yaml b/charts/accountapp/templates/pdb.yaml new file mode 100644 index 000000000..7110d0208 --- /dev/null +++ b/charts/accountapp/templates/pdb.yaml @@ -0,0 +1,18 @@ +{{- if (gt (int .Values.replicaCount) 1) }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "accountapp.fullname" . }} + labels: + {{- include "accountapp.labels" . | nindent 4 }} +spec: + {{- with .Values.poddisruptionbudget.minAvailable }} + minAvailable: {{ . }} + {{- end }} + {{- with .Values.poddisruptionbudget.maxUnavailable }} + maxUnavailable: {{ . }} + {{- end }} + selector: + matchLabels: + {{- include "accountapp.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/charts/accountapp/tests/custom_values_test.yaml b/charts/accountapp/tests/custom_values_test.yaml index 5deeb477a..efd80ec10 100644 --- a/charts/accountapp/tests/custom_values_test.yaml +++ b/charts/accountapp/tests/custom_values_test.yaml @@ -3,6 +3,7 @@ templates: - deployment.yaml - ingress.yaml - secret.yaml # Direct dependency of deployment.yaml + - pdb.yaml tests: - it: should create a Secret with the correct value set: @@ -51,3 +52,18 @@ tests: - equal: path: spec.template.spec.containers[0].resources.requests.cpu value: 500m + - it: should ensure the pdb has correct spec + template: pdb.yaml + set: + replicaCount: 2 + poddisruptionbudget.minAvailable: 2 + poddisruptionbudget.maxUnavailable: 1 + asserts: + - isKind: + of: PodDisruptionBudget + - equal: + path: spec.minAvailable + value: 2 + - equal: + path: spec.selector.matchLabels['app.kubernetes.io/name'] + value: "accountapp" diff --git a/charts/accountapp/tests/defaults_test.yaml b/charts/accountapp/tests/defaults_test.yaml index d663044bd..93507623d 100644 --- a/charts/accountapp/tests/defaults_test.yaml +++ b/charts/accountapp/tests/defaults_test.yaml @@ -3,6 +3,7 @@ templates: - deployment.yaml - ingress.yaml - secret.yaml # Direct dependency of deployment.yaml + - pdb.yaml tests: - it: should create an ingress by default template: ingress.yaml @@ -21,3 +22,8 @@ tests: value: IfNotPresent - notExists: path: spec.template.spec.containers[0].resources + - it: should not generate any pdb with default values + template: pdb.yaml + asserts: + - hasDocuments: + count: 0 diff --git a/charts/accountapp/values.yaml b/charts/accountapp/values.yaml index 6ecf4a23b..75cad7f48 100644 --- a/charts/accountapp/values.yaml +++ b/charts/accountapp/values.yaml @@ -66,3 +66,5 @@ election: close: 1970-01-02 logDir: /var/log/accountapp/elections candidates: bob,alice +poddisruptionbudget: + minAvailable: 1 From 55bfc89507fd1d442ffb6456ced9a89ab38ffcac Mon Sep 17 00:00:00 2001 From: smerle33 Date: Thu, 28 Sep 2023 14:09:18 +0200 Subject: [PATCH 03/11] fixup --- charts/accountapp/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/accountapp/Chart.yaml b/charts/accountapp/Chart.yaml index 2317d5414..4c48cbf34 100644 --- a/charts/accountapp/Chart.yaml +++ b/charts/accountapp/Chart.yaml @@ -3,4 +3,4 @@ description: A Helm chart for accounts.jenkins.io maintainers: - name: timja name: accountapp -version: 0.7.3 +version: 0.8.0 From 759391593abb9d72d91234f6a9658470e64dc054 Mon Sep 17 00:00:00 2001 From: smerle33 Date: Thu, 28 Sep 2023 14:22:39 +0200 Subject: [PATCH 04/11] unit test for labels --- charts/accountapp/tests/defaults_test.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/charts/accountapp/tests/defaults_test.yaml b/charts/accountapp/tests/defaults_test.yaml index 93507623d..9db42b55b 100644 --- a/charts/accountapp/tests/defaults_test.yaml +++ b/charts/accountapp/tests/defaults_test.yaml @@ -22,6 +22,12 @@ tests: value: IfNotPresent - notExists: path: spec.template.spec.containers[0].resources + - equal: + path: metadata.labels["app.kubernetes.io/name"] + value: accountapp + - equal: + path: metadata.labels["app.kubernetes.io/managed-by"] + value: Helm - it: should not generate any pdb with default values template: pdb.yaml asserts: From a2f3b3b77db776d0c9b0a9d604ccc971ed99b55c Mon Sep 17 00:00:00 2001 From: smerle33 Date: Thu, 28 Sep 2023 11:48:47 +0200 Subject: [PATCH 05/11] encapsulation --- charts/accountapp/templates/_helpers.tpl | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/charts/accountapp/templates/_helpers.tpl b/charts/accountapp/templates/_helpers.tpl index b0cad3a31..4ac303e71 100644 --- a/charts/accountapp/templates/_helpers.tpl +++ b/charts/accountapp/templates/_helpers.tpl @@ -31,24 +31,23 @@ Create chart name and version as used by the chart label. {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{/* +Selector labels +*/}} +{{- define "accountapp.selectorLabels" -}} +app.kubernetes.io/name: {{ include "accountapp.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + {{/* Common labels */}} {{- define "accountapp.labels" -}} -app.kubernetes.io/name: {{ include "accountapp.name" . }} +{{ include "accountapp.selectorLabels" . }} helm.sh/chart: {{ include "accountapp.chart" . }} -app.kubernetes.io/instance: {{ .Release.Name }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} jenkins.io/maintainer: {{ (index .Chart.Maintainers 0).Name }} {{- end -}} - -{{/* -Selector labels -*/}} -{{- define "accountapp.selectorLabels" -}} -app.kubernetes.io/name: {{ include "accountapp.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} From 9349f6bd4f204043d436f3317b119e5f8ae42fe4 Mon Sep 17 00:00:00 2001 From: smerle33 Date: Thu, 28 Sep 2023 14:44:01 +0200 Subject: [PATCH 06/11] feat(ACP): add PDB --- charts/artifact-caching-proxy/Chart.yaml | 2 +- .../tests/custom_values_test.yaml | 17 +++++++++++++++++ .../tests/defaults_test.yaml | 12 ++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/charts/artifact-caching-proxy/Chart.yaml b/charts/artifact-caching-proxy/Chart.yaml index 7450319dd..2c7dae32c 100644 --- a/charts/artifact-caching-proxy/Chart.yaml +++ b/charts/artifact-caching-proxy/Chart.yaml @@ -2,4 +2,4 @@ apiVersion: v2 description: artifact-caching-proxy is a Nginx caching proxy in front of repo.jenkins-ci.org name: artifact-caching-proxy type: application -version: 0.14.0 +version: 0.15.0 diff --git a/charts/artifact-caching-proxy/tests/custom_values_test.yaml b/charts/artifact-caching-proxy/tests/custom_values_test.yaml index 4230e35be..9bc7e1bca 100644 --- a/charts/artifact-caching-proxy/tests/custom_values_test.yaml +++ b/charts/artifact-caching-proxy/tests/custom_values_test.yaml @@ -2,6 +2,7 @@ suite: Tests with custom values templates: - ingress-health.yaml - ingress.yaml + - pdb.yaml tests: - it: Should set a custom health check path when specified by values template: ingress.yaml @@ -50,3 +51,19 @@ tests: path: metadata.annotations value: a-custom/annotation: "hello world" + + - it: should ensure the pdb has correct spec + template: pdb.yaml + set: + replicaCount: 2 + poddisruptionbudget.minAvailable: 2 + poddisruptionbudget.maxUnavailable: 1 + asserts: + - isKind: + of: PodDisruptionBudget + - equal: + path: spec.minAvailable + value: 2 + - equal: + path: spec.selector.matchLabels['app.kubernetes.io/name'] + value: "artifact-caching-proxy" diff --git a/charts/artifact-caching-proxy/tests/defaults_test.yaml b/charts/artifact-caching-proxy/tests/defaults_test.yaml index a9cbdd25d..f1c2e4c96 100644 --- a/charts/artifact-caching-proxy/tests/defaults_test.yaml +++ b/charts/artifact-caching-proxy/tests/defaults_test.yaml @@ -5,6 +5,7 @@ templates: - nginx-proxy-configmap.yaml - nginx-default-configmap.yaml - statefulset.yaml + - pdb.yaml tests: - it: should not generate any ingress with default values template: ingress.yaml @@ -36,3 +37,14 @@ tests: of: StatefulSet - notExists: path: spec.affinity + - equal: + path: metadata.labels["app.kubernetes.io/name"] + value: artifact-caching-proxy + - equal: + path: metadata.labels["app.kubernetes.io/managed-by"] + value: Helm + - it: should not generate any pdb with default values + template: pdb.yaml + asserts: + - hasDocuments: + count: 0 From a9a7de8fdb310a86f19d840a5fff423f3262fe6c Mon Sep 17 00:00:00 2001 From: smerle33 Date: Thu, 28 Sep 2023 15:02:04 +0200 Subject: [PATCH 07/11] forgot the pdb file --- .../artifact-caching-proxy/templates/pdb.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 charts/artifact-caching-proxy/templates/pdb.yaml diff --git a/charts/artifact-caching-proxy/templates/pdb.yaml b/charts/artifact-caching-proxy/templates/pdb.yaml new file mode 100644 index 000000000..aa564df5f --- /dev/null +++ b/charts/artifact-caching-proxy/templates/pdb.yaml @@ -0,0 +1,18 @@ +{{- if (gt (int .Values.replicaCount) 1) }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "artifact-caching-proxy.fullname" . }} + labels: + {{- include "artifact-caching-proxy.labels" . | nindent 4 }} +spec: + {{- with .Values.poddisruptionbudget.minAvailable }} + minAvailable: {{ . }} + {{- end }} + {{- with .Values.poddisruptionbudget.maxUnavailable }} + maxUnavailable: {{ . }} + {{- end }} + selector: + matchLabels: + {{- include "artifact-caching-proxy.selectorLabels" . | nindent 6 }} +{{- end }} From e5dbb653b63b3a82a3e75c888bdcea120b0cde12 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Thu, 28 Sep 2023 17:22:35 +0200 Subject: [PATCH 08/11] fix(jenkinsio) ensure default values are valid. Closes #658. Signed-off-by: Damien Duportal --- charts/jenkinsio/Chart.yaml | 2 +- charts/jenkinsio/tests/custom_values.yaml | 30 +++++++++++++++++++ .../jenkinsio/tests/defaults_values_test.yaml | 27 +++++++++++++++++ charts/jenkinsio/values.yaml | 4 ++- 4 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 charts/jenkinsio/tests/custom_values.yaml create mode 100644 charts/jenkinsio/tests/defaults_values_test.yaml diff --git a/charts/jenkinsio/Chart.yaml b/charts/jenkinsio/Chart.yaml index 5975fd52c..ccdc217b1 100644 --- a/charts/jenkinsio/Chart.yaml +++ b/charts/jenkinsio/Chart.yaml @@ -4,4 +4,4 @@ maintainers: - name: timja - name: dduportal name: jenkinsio -version: 0.6.0 +version: 0.6.1 diff --git a/charts/jenkinsio/tests/custom_values.yaml b/charts/jenkinsio/tests/custom_values.yaml new file mode 100644 index 000000000..46ed08623 --- /dev/null +++ b/charts/jenkinsio/tests/custom_values.yaml @@ -0,0 +1,30 @@ +suite: Test with custom values +# templates: +# - deployment.yaml +# - ingress.yaml +# - nginx-configmap.yaml # Direct dependency of deployment.yaml +tests: +# - it: should create an ingress when ingress.enabled is true +# set: +# ingress: +# enabled: true +# template: ingress.yaml +# asserts: +# - hasDocuments: +# count: 1 +# - it: should mount the html volume when htmlVolume is set +# template: deployment.yaml +# set: +# htmlVolume: +# hostPath: /host +# asserts: +# - hasDocuments: +# count: 1 +# - isKind: +# of: Deployment +# - equal: +# path: spec.template.spec.volumes[0].name +# value: html +# - equal: +# path: spec.template.spec.volumes[0].hostPath +# value: /host diff --git a/charts/jenkinsio/tests/defaults_values_test.yaml b/charts/jenkinsio/tests/defaults_values_test.yaml new file mode 100644 index 000000000..f2efcd983 --- /dev/null +++ b/charts/jenkinsio/tests/defaults_values_test.yaml @@ -0,0 +1,27 @@ +suite: Test with default values +templates: + - deployment.yaml + - zh-deployment.yaml + - zh-configmap.yaml + - nginx-configmap.yaml +tests: + - it: should create a deployment for jenkins.io with default values + template: deployment.yaml + asserts: + - hasDocuments: + count: 1 + - isKind: + of: Deployment + - equal: + path: metadata.name + value: RELEASE-NAME-jenkinsio + - it: should create a deployment for zh.jenkins.io with default values + template: zh-deployment.yaml + asserts: + - hasDocuments: + count: 1 + - isKind: + of: Deployment + - equal: + path: metadata.name + value: RELEASE-NAME-jenkinsio-zh diff --git a/charts/jenkinsio/values.yaml b/charts/jenkinsio/values.yaml index ed7c161a4..82fc6480c 100644 --- a/charts/jenkinsio/values.yaml +++ b/charts/jenkinsio/values.yaml @@ -35,7 +35,7 @@ ingress: # - secretName: plugins-tls # hosts: # - plugins.jenkins.io -resources: +resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little # resources, such as Minikube. If you do want to specify resources, uncomment the following @@ -50,5 +50,7 @@ nodeSelector: {} tolerations: [] affinity: {} htmlVolume: + emptyDir: {} zhHtmlVolume: + emptyDir: {} forceJenkinsIoHost: false From c0063d8243c72e524f08f68641e7cf2fbfcf8168 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Thu, 28 Sep 2023 18:03:25 +0200 Subject: [PATCH 09/11] fix(jenkinsio) do not break html volume specification (bug introduced in 0.6.1) Signed-off-by: Damien Duportal --- charts/jenkinsio/Chart.yaml | 2 +- charts/jenkinsio/templates/deployment.yaml | 6 ++- charts/jenkinsio/templates/zh-deployment.yaml | 6 ++- charts/jenkinsio/tests/custom_values.yaml | 30 -------------- .../jenkinsio/tests/custom_values_test.yaml | 41 +++++++++++++++++++ .../jenkinsio/tests/defaults_values_test.yaml | 5 +++ charts/jenkinsio/values.yaml | 6 +-- 7 files changed, 59 insertions(+), 37 deletions(-) delete mode 100644 charts/jenkinsio/tests/custom_values.yaml create mode 100644 charts/jenkinsio/tests/custom_values_test.yaml diff --git a/charts/jenkinsio/Chart.yaml b/charts/jenkinsio/Chart.yaml index ccdc217b1..69b77a989 100644 --- a/charts/jenkinsio/Chart.yaml +++ b/charts/jenkinsio/Chart.yaml @@ -4,4 +4,4 @@ maintainers: - name: timja - name: dduportal name: jenkinsio -version: 0.6.1 +version: 0.6.2 diff --git a/charts/jenkinsio/templates/deployment.yaml b/charts/jenkinsio/templates/deployment.yaml index a10808ad0..3a388f395 100644 --- a/charts/jenkinsio/templates/deployment.yaml +++ b/charts/jenkinsio/templates/deployment.yaml @@ -67,7 +67,11 @@ spec: {{- end }} volumes: - name: html -{{ toYaml .Values.htmlVolume | indent 10 }} +{{- if .Values.htmlVolume -}} +{{- toYaml .Values.htmlVolume | nindent 10 }} +{{- else }} + emptyDir: {} +{{- end }} - name: config configMap: name: jenkinsio diff --git a/charts/jenkinsio/templates/zh-deployment.yaml b/charts/jenkinsio/templates/zh-deployment.yaml index e23cd04f7..9a0929e8e 100644 --- a/charts/jenkinsio/templates/zh-deployment.yaml +++ b/charts/jenkinsio/templates/zh-deployment.yaml @@ -66,7 +66,11 @@ spec: {{- end }} volumes: - name: html -{{ toYaml .Values.zhHtmlVolume | indent 10 }} +{{- if .Values.zhHtmlVolume -}} +{{- toYaml .Values.zhHtmlVolume | nindent 10 }} +{{- else }} + emptyDir: {} +{{- end }} - name: config configMap: name: jenkinsio diff --git a/charts/jenkinsio/tests/custom_values.yaml b/charts/jenkinsio/tests/custom_values.yaml deleted file mode 100644 index 46ed08623..000000000 --- a/charts/jenkinsio/tests/custom_values.yaml +++ /dev/null @@ -1,30 +0,0 @@ -suite: Test with custom values -# templates: -# - deployment.yaml -# - ingress.yaml -# - nginx-configmap.yaml # Direct dependency of deployment.yaml -tests: -# - it: should create an ingress when ingress.enabled is true -# set: -# ingress: -# enabled: true -# template: ingress.yaml -# asserts: -# - hasDocuments: -# count: 1 -# - it: should mount the html volume when htmlVolume is set -# template: deployment.yaml -# set: -# htmlVolume: -# hostPath: /host -# asserts: -# - hasDocuments: -# count: 1 -# - isKind: -# of: Deployment -# - equal: -# path: spec.template.spec.volumes[0].name -# value: html -# - equal: -# path: spec.template.spec.volumes[0].hostPath -# value: /host diff --git a/charts/jenkinsio/tests/custom_values_test.yaml b/charts/jenkinsio/tests/custom_values_test.yaml new file mode 100644 index 000000000..2c7f713e3 --- /dev/null +++ b/charts/jenkinsio/tests/custom_values_test.yaml @@ -0,0 +1,41 @@ +suite: Test with custom values +templates: + - deployment.yaml + - zh-deployment.yaml + - zh-configmap.yaml + - nginx-configmap.yaml +set: + htmlVolume: + azureFile: + secretName: jenkinsio + shareName: jenkinsio + readOnly: true +tests: + - it: should create a deployment for jenkins.io with specified custom values + template: deployment.yaml + asserts: + - hasDocuments: + count: 1 + - isKind: + of: Deployment + - equal: + path: metadata.name + value: RELEASE-NAME-jenkinsio + - equal: + path: spec.template.spec.volumes[0].name + value: html + - notExists: + path: spec.template.spec.volumes[0].emptyDir + - equal: + path: spec.template.spec.volumes[0].azureFile.shareName + value: jenkinsio + - it: should create a deployment for zh.jenkins.io with specified custom values + template: zh-deployment.yaml + asserts: + - hasDocuments: + count: 1 + - isKind: + of: Deployment + - equal: + path: metadata.name + value: RELEASE-NAME-jenkinsio-zh diff --git a/charts/jenkinsio/tests/defaults_values_test.yaml b/charts/jenkinsio/tests/defaults_values_test.yaml index f2efcd983..368bff7c6 100644 --- a/charts/jenkinsio/tests/defaults_values_test.yaml +++ b/charts/jenkinsio/tests/defaults_values_test.yaml @@ -15,6 +15,11 @@ tests: - equal: path: metadata.name value: RELEASE-NAME-jenkinsio + - equal: + path: spec.template.spec.volumes[0].name + value: html + - exists: + path: spec.template.spec.volumes[0].emptyDir - it: should create a deployment for zh.jenkins.io with default values template: zh-deployment.yaml asserts: diff --git a/charts/jenkinsio/values.yaml b/charts/jenkinsio/values.yaml index 82fc6480c..88dad1ec7 100644 --- a/charts/jenkinsio/values.yaml +++ b/charts/jenkinsio/values.yaml @@ -49,8 +49,6 @@ resources: {} nodeSelector: {} tolerations: [] affinity: {} -htmlVolume: - emptyDir: {} -zhHtmlVolume: - emptyDir: {} +htmlVolume: {} +zhHtmlVolume: {} forceJenkinsIoHost: false From 401e07d176f9752473b2291761e6576101c75150 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Thu, 28 Sep 2023 17:40:25 +0200 Subject: [PATCH 10/11] =?UTF-8?q?feat!(jenkinsio)=20=F0=9F=92=A5=20allow?= =?UTF-8?q?=20specifying=20custom=20affinities=20per=20deployment.=20BREAK?= =?UTF-8?q?ING=20CHANGE.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Damien Duportal --- charts/jenkinsio/Chart.yaml | 2 +- charts/jenkinsio/templates/deployment.yaml | 2 +- charts/jenkinsio/templates/zh-deployment.yaml | 2 +- .../jenkinsio/tests/custom_values_test.yaml | 27 +++++++++++++++++++ .../jenkinsio/tests/defaults_values_test.yaml | 4 +++ charts/jenkinsio/values.yaml | 4 ++- 6 files changed, 37 insertions(+), 4 deletions(-) diff --git a/charts/jenkinsio/Chart.yaml b/charts/jenkinsio/Chart.yaml index 69b77a989..07c8591da 100644 --- a/charts/jenkinsio/Chart.yaml +++ b/charts/jenkinsio/Chart.yaml @@ -4,4 +4,4 @@ maintainers: - name: timja - name: dduportal name: jenkinsio -version: 0.6.2 +version: 1.0.0 diff --git a/charts/jenkinsio/templates/deployment.yaml b/charts/jenkinsio/templates/deployment.yaml index 3a388f395..2bbf5abab 100644 --- a/charts/jenkinsio/templates/deployment.yaml +++ b/charts/jenkinsio/templates/deployment.yaml @@ -57,7 +57,7 @@ spec: nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.affinity }} + {{- with .Values.affinity.jenkinsio }} affinity: {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/jenkinsio/templates/zh-deployment.yaml b/charts/jenkinsio/templates/zh-deployment.yaml index 9a0929e8e..3e4cdb095 100644 --- a/charts/jenkinsio/templates/zh-deployment.yaml +++ b/charts/jenkinsio/templates/zh-deployment.yaml @@ -56,7 +56,7 @@ spec: nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.affinity }} + {{- with index .Values.affinity "jenkinsio-zh" }} affinity: {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/jenkinsio/tests/custom_values_test.yaml b/charts/jenkinsio/tests/custom_values_test.yaml index 2c7f713e3..d92f71f06 100644 --- a/charts/jenkinsio/tests/custom_values_test.yaml +++ b/charts/jenkinsio/tests/custom_values_test.yaml @@ -10,6 +10,27 @@ set: secretName: jenkinsio shareName: jenkinsio readOnly: true + affinity: + jenkinsio: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: "app.kubernetes.io/name" + operator: In + values: + - jenkinsio + topologyKey: "kubernetes.io/hostname" + jenkinsio-zh: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: "app.kubernetes.io/name" + operator: In + values: + - jenkinsio-zh + topologyKey: "kubernetes.io/hostname" tests: - it: should create a deployment for jenkins.io with specified custom values template: deployment.yaml @@ -29,6 +50,9 @@ tests: - equal: path: spec.template.spec.volumes[0].azureFile.shareName value: jenkinsio + - equal: + path: spec.template.spec.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].labelSelector.matchExpressions[0].values[0] + value: jenkinsio - it: should create a deployment for zh.jenkins.io with specified custom values template: zh-deployment.yaml asserts: @@ -39,3 +63,6 @@ tests: - equal: path: metadata.name value: RELEASE-NAME-jenkinsio-zh + - equal: + path: spec.template.spec.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].labelSelector.matchExpressions[0].values[0] + value: jenkinsio-zh diff --git a/charts/jenkinsio/tests/defaults_values_test.yaml b/charts/jenkinsio/tests/defaults_values_test.yaml index 368bff7c6..57b51de02 100644 --- a/charts/jenkinsio/tests/defaults_values_test.yaml +++ b/charts/jenkinsio/tests/defaults_values_test.yaml @@ -20,6 +20,8 @@ tests: value: html - exists: path: spec.template.spec.volumes[0].emptyDir + - notExists: + path: spec.template.spec.affinity - it: should create a deployment for zh.jenkins.io with default values template: zh-deployment.yaml asserts: @@ -30,3 +32,5 @@ tests: - equal: path: metadata.name value: RELEASE-NAME-jenkinsio-zh + - notExists: + path: spec.template.spec.affinity diff --git a/charts/jenkinsio/values.yaml b/charts/jenkinsio/values.yaml index 88dad1ec7..d36d594d9 100644 --- a/charts/jenkinsio/values.yaml +++ b/charts/jenkinsio/values.yaml @@ -48,7 +48,9 @@ resources: {} # memory: 128Mi nodeSelector: {} tolerations: [] -affinity: {} +affinity: + jenkinsio: {} + jenkinsio-zh: {} htmlVolume: {} zhHtmlVolume: {} forceJenkinsIoHost: false From da7d6c10fb542cdad149b731f14c2e0ba9dfe0fc Mon Sep 17 00:00:00 2001 From: "Jenkins Infra Bot (updatecli)" <60776566+jenkins-infra-bot@users.noreply.github.com> Date: Fri, 29 Sep 2023 04:21:29 +0000 Subject: [PATCH 11/11] chore: Update wiki helm chart MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Made with ❤️️ by updatecli --- charts/wiki/Chart.yaml | 2 +- charts/wiki/values.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/wiki/Chart.yaml b/charts/wiki/Chart.yaml index 3bd6cb1e7..5596056cf 100644 --- a/charts/wiki/Chart.yaml +++ b/charts/wiki/Chart.yaml @@ -3,4 +3,4 @@ appVersion: 0.0.7 description: A Helm chart for wiki static content name: wiki type: application -version: 0.6.2 +version: 0.6.3 diff --git a/charts/wiki/values.yaml b/charts/wiki/values.yaml index 069e86e1c..b9c3c233c 100644 --- a/charts/wiki/values.yaml +++ b/charts/wiki/values.yaml @@ -6,7 +6,7 @@ image: repository: jenkinsciinfra/wiki pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: 0.1.9 + tag: 0.1.10 imagePullSecrets: [] nameOverride: "" fullnameOverride: ""