diff --git a/charts/mirrorbits-parent/Chart.lock b/charts/mirrorbits-parent/Chart.lock index 7dad1e983..209210df6 100644 --- a/charts/mirrorbits-parent/Chart.lock +++ b/charts/mirrorbits-parent/Chart.lock @@ -1,12 +1,12 @@ dependencies: - name: mirrorbits-lite repository: https://jenkins-infra.github.io/helm-charts - version: 0.2.1 + version: 0.3.0 - name: httpd repository: https://jenkins-infra.github.io/helm-charts version: 0.1.0 - name: rsyncd repository: https://jenkins-infra.github.io/helm-charts - version: 1.3.1 -digest: sha256:9582d38aad0e4036c979fd219de612b0311df580eb0a65536ab5c3e1a357ee32 -generated: "2023-09-26T07:21:06.778448542Z" + version: 1.3.2 +digest: sha256:9cf11370cdbed50b554291fd4bfffd79b55a6e26c8147c7e29373d4c4f002e24 +generated: "2023-10-02T16:05:56.833429193Z" diff --git a/charts/mirrorbits-parent/Chart.yaml b/charts/mirrorbits-parent/Chart.yaml index 132a0683d..e2a708346 100644 --- a/charts/mirrorbits-parent/Chart.yaml +++ b/charts/mirrorbits-parent/Chart.yaml @@ -2,12 +2,12 @@ apiVersion: v2 name: mirrorbits-parent description: A mirrorbits parent chart for Kubernetes type: application -version: 0.2.3 +version: 0.2.4 dependencies: - name: mirrorbits-lite condition: mirrorbits-lite.enabled repository: https://jenkins-infra.github.io/helm-charts - version: 0.2.1 + version: 0.3.0 - name: httpd condition: httpd.enabled repository: https://jenkins-infra.github.io/helm-charts @@ -15,4 +15,4 @@ dependencies: - name: rsyncd condition: rsyncd.enabled repository: https://jenkins-infra.github.io/helm-charts - version: 1.3.1 + version: 1.3.2 diff --git a/charts/mirrorbits/Chart.yaml b/charts/mirrorbits/Chart.yaml index 069becfaf..17393c34c 100644 --- a/charts/mirrorbits/Chart.yaml +++ b/charts/mirrorbits/Chart.yaml @@ -5,4 +5,4 @@ maintainers: - email: jenkins-infra-team@googlegroups.com name: jenkins-infra-team name: mirrorbits -version: 0.70.2 +version: 1.0.0 diff --git a/charts/mirrorbits/templates/_helpers.tpl b/charts/mirrorbits/templates/_helpers.tpl index e24d301d2..d31d17c03 100644 --- a/charts/mirrorbits/templates/_helpers.tpl +++ b/charts/mirrorbits/templates/_helpers.tpl @@ -31,13 +31,20 @@ 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 "mirrorbits.selectorLabels" -}} +app.kubernetes.io/name: {{ include "mirrorbits.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + {{/* Common labels */}} {{- define "mirrorbits.labels" -}} -app.kubernetes.io/name: {{ include "mirrorbits.name" . }} +{{ include "mirrorbits.selectorLabels" . }} helm.sh/chart: {{ include "mirrorbits.chart" . }} -app.kubernetes.io/instance: {{ .Release.Name }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} diff --git a/charts/mirrorbits/templates/deployment.files.yaml b/charts/mirrorbits/templates/deployment.files.yaml index 3cc51ab1a..cb67fcf9f 100644 --- a/charts/mirrorbits/templates/deployment.files.yaml +++ b/charts/mirrorbits/templates/deployment.files.yaml @@ -49,7 +49,7 @@ spec: nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.affinity }} + {{- with .Values.affinity.files }} affinity: {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/mirrorbits/templates/deployment.rsyncd.yaml b/charts/mirrorbits/templates/deployment.rsyncd.yaml index b1cb89840..864bf2c43 100644 --- a/charts/mirrorbits/templates/deployment.rsyncd.yaml +++ b/charts/mirrorbits/templates/deployment.rsyncd.yaml @@ -58,7 +58,7 @@ spec: nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.affinity }} + {{- with .Values.affinity.rsyncd }} affinity: {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/mirrorbits/templates/deployment.yaml b/charts/mirrorbits/templates/deployment.yaml index 2c0f4f4a6..f8b071afa 100644 --- a/charts/mirrorbits/templates/deployment.yaml +++ b/charts/mirrorbits/templates/deployment.yaml @@ -96,7 +96,7 @@ spec: nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.affinity }} + {{- with .Values.affinity.mirrorbits }} affinity: {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/mirrorbits/tests/custom_values_test.yaml b/charts/mirrorbits/tests/custom_values_test.yaml index b18e22040..28d8909c5 100644 --- a/charts/mirrorbits/tests/custom_values_test.yaml +++ b/charts/mirrorbits/tests/custom_values_test.yaml @@ -22,6 +22,46 @@ set: volume: persistentVolumeClaim: claimName: foobar + affinity: + mirrorbits: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: "app.kubernetes.io/name" + operator: In + values: + - mirrorbits + topologyKey: "kubernetes.io/hostname" + files: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: "app.kubernetes.io/name" + operator: In + values: + - mirrorbits-files + topologyKey: "kubernetes.io/hostname" + rsyncd: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: "app.kubernetes.io/name" + operator: In + values: + - mirrorbits-rsyncd + topologyKey: "kubernetes.io/hostname" + poddisruptionbudget: + mirrorbits: + minAvailable: 1 + mirrorbitsFiles: + minAvailable: 1 + mirrorbitsRsyncd: + minAvailable: 1 + + templates: - deployment.yaml - deployment.files.yaml @@ -71,6 +111,9 @@ tests: - equal: path: "spec.template.spec.containers[*].imagePullPolicy" value: Never + - equal: + path: spec.template.spec.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].topologyKey + value: "kubernetes.io/hostname" - it: should define a customized "mirrorbits" deployment template: deployment.yaml asserts: @@ -94,6 +137,9 @@ tests: - equal: path: spec.template.spec.containers[0].volumeMounts[2].mountPath value: /var/log/mirrorbits + - equal: + path: spec.template.spec.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].topologyKey + value: "kubernetes.io/hostname" - it: should create ingress with pathType set to the specified custom value by default template: ingress.yaml asserts: @@ -111,6 +157,9 @@ tests: count: 1 - isKind: of: Deployment + - equal: + path: spec.template.spec.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].topologyKey + value: "kubernetes.io/hostname" - it: should create rsyncd service if rsyncd is enabled template: service.rsyncd.yaml asserts: diff --git a/charts/mirrorbits/tests/defaults_test.yaml b/charts/mirrorbits/tests/defaults_test.yaml index 28b841300..67cd2f50b 100644 --- a/charts/mirrorbits/tests/defaults_test.yaml +++ b/charts/mirrorbits/tests/defaults_test.yaml @@ -88,3 +88,5 @@ tests: - equal: path: spec.template.spec.containers[0].volumeMounts[2].mountPath value: /var/log/mirrorbits + - notExists: + path: spec.template.spec.affinity diff --git a/charts/mirrorbits/values.yaml b/charts/mirrorbits/values.yaml index 1f65e753f..378c2088b 100644 --- a/charts/mirrorbits/values.yaml +++ b/charts/mirrorbits/values.yaml @@ -69,7 +69,10 @@ resources: {} # memory: 128Mi nodeSelector: {} tolerations: [] -affinity: {} +affinity: + mirrorbits: {} + files: {} + rsyncd: {} geoipupdate: image: repository: maxmindinc/geoipupdate