[Charts] Add option to pass in topology pod constraints (#262)

This commit is contained in:
Florian Piesche 2021-08-11 16:36:39 +01:00 committed by GitHub
parent c304996250
commit 5d6b8f4b12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 2 deletions

View file

@ -1,8 +1,8 @@
apiVersion: v2
name: woodpecker-agent
description: A Helm chart for Woodpecker a fork of the Drone CI system
description: A Helm chart for Woodpecker, a fork of the Drone CI system
type: application
version: 0.1.0
version: 0.1.1
appVersion: "v0.13.0-rc.3"
keywords:
- continuous-delivery

View file

@ -18,6 +18,12 @@ spec:
labels:
{{- include "woodpecker-agent.selectorLabels" . | nindent 8 }}
spec:
{{- if and (semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion) (.Values.topologySpreadConstraints) }}
{{- with .Values.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}

View file

@ -56,3 +56,15 @@ nodeSelector: {}
tolerations: []
affinity: {}
## Using topology spread constraints, you can ensure that there is at least one agent
## pod for each topology zone, e.g. one per arch for for multi-architecture clusters
## or one for each region for geographically distributed cloud-hosted clusters.
## Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
topologySpreadConstraints: []
# - maxSkew: 1
# topologyKey: "beta.kubernetes.io/arch"
# whenUnsatisfiable: "DoNotSchedule"
# labelSelector:
# matchLabels:
# "app.kubernetes.io/name": woodpecker-agent