diff --git a/charts/service/Chart.yaml b/charts/service/Chart.yaml index 53e12b3..225fdd3 100644 --- a/charts/service/Chart.yaml +++ b/charts/service/Chart.yaml @@ -20,7 +20,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.3 +version: 0.5.4 home: https://github.com/Breadfast/helm-chart sources: diff --git a/charts/service/README.md b/charts/service/README.md index 06676c0..5932a8f 100644 --- a/charts/service/README.md +++ b/charts/service/README.md @@ -1,6 +1,6 @@ # service -![Version: 0.5.3](https://img.shields.io/badge/Version-0.5.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) +![Version: 0.5.4](https://img.shields.io/badge/Version-0.5.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) A Helm chart for Kubernetes. @@ -122,6 +122,7 @@ networkPolicy.internetOnly.ipBlock.except when they are outside the defaults. | podAntiAffinity | object | `{}` | | | podLabels | object | `{}` | | | podSecurityContext | object | `{}` | | +| priorityClassName | string | `""` | Name of an existing PriorityClass. Empty means cluster default (priority 0). | | readinessProbe | object | `{}` | | | replicaCount | int | `1` | | | resources | object | `{}` | | @@ -137,6 +138,7 @@ networkPolicy.internetOnly.ipBlock.except when they are outside the defaults. | serviceAccount.create | bool | `false` | If true, creates service account | | serviceAccount.name | string | `""` | | | startupProbe | object | `{}` | | +| topologySpreadConstraints | list | `[]` | Spread replicas across nodes or zones. See the comment above for how this differs from podAntiAffinity. | | vaultAgent | bool | `{"enabled":false}` | If true, It will inject Vault Agent to get secrets from Vault | | virtualService.enabled | bool | `false` | | | virtualService.hosts | list | `[]` | | diff --git a/charts/service/templates/argo-rollouts.yaml b/charts/service/templates/argo-rollouts.yaml index f1aceb8..0e077e7 100644 --- a/charts/service/templates/argo-rollouts.yaml +++ b/charts/service/templates/argo-rollouts.yaml @@ -114,10 +114,17 @@ spec: podAntiAffinity: {{- toYaml . | nindent 10 }} {{- end }} + {{- with .Values.topologySpreadConstraints }} + topologySpreadConstraints: + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.nodeSelectorLabels }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.priorityClassName }} + priorityClassName: {{ . }} + {{- end }} {{- with .Values.hostAliases }} hostAliases: {{- toYaml . | nindent 8 }} diff --git a/charts/service/templates/deployment.yaml b/charts/service/templates/deployment.yaml index b59762f..9e28310 100644 --- a/charts/service/templates/deployment.yaml +++ b/charts/service/templates/deployment.yaml @@ -55,10 +55,17 @@ spec: podAntiAffinity: {{- toYaml . | nindent 10 }} {{- end }} + {{- with .Values.topologySpreadConstraints }} + topologySpreadConstraints: + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.nodeSelectorLabels }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.priorityClassName }} + priorityClassName: {{ . }} + {{- end }} {{- with .Values.hostAliases }} hostAliases: {{- toYaml . | nindent 8 }} diff --git a/charts/service/values.yaml b/charts/service/values.yaml index 560be53..3ef374d 100644 --- a/charts/service/values.yaml +++ b/charts/service/values.yaml @@ -253,6 +253,48 @@ entrypointOverride: podAffinity: {} podAntiAffinity: {} +# Prefer this over podAntiAffinity when spreading replicas across nodes. +# +# Skew is evaluated across the topology domains actually eligible for the pod, so +# `maxSkew: 1` lands a 5-replica Deployment 3/2 across two usable nodes. A +# `required` podAntiAffinity instead demands one node per replica and leaves the +# rest Pending, which on a saturated pool forces continuous autoscaler scale-up. +# +# whenUnsatisfiable: ScheduleAnyway keeps it advisory but still skew-aware; +# DoNotSchedule makes it a hard guarantee within the maxSkew tolerance. +# +# Example: +# topologySpreadConstraints: +# - maxSkew: 1 +# topologyKey: kubernetes.io/hostname +# whenUnsatisfiable: DoNotSchedule +# labelSelector: +# matchLabels: +# app.kubernetes.io/name: my-service +# +# Docs: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/ +# -- (list) Spread replicas across nodes or zones. See the comment above for how this differs from podAntiAffinity. +topologySpreadConstraints: [] + +# Assign a PriorityClass so the scheduler knows which pods matter when the cluster +# is short on room. Unset means priority 0 — the same as every workload today, +# since no PriorityClass in this cluster sets globalDefault. +# +# The PriorityClass must already exist in the cluster; `kubectl get priorityclasses` +# lists them. Raising a workload's priority lets the scheduler PREEMPT (evict) +# lower-priority pods to make room for it, so treat a value above 0 as a decision +# about which of your OWN services get displaced, not a free win. Use +# preemptionPolicy: Never on the PriorityClass to get ordering without eviction. +# +# WATCH OUT: a name that does not exist fails LATE and quietly. The Deployment is +# accepted by the API (verified against the live 1.35 apiserver), so ArgoCD reports +# Synced/Healthy, but every Pod is then rejected with +# forbidden: no PriorityClass with name was found +# so the new ReplicaSet sits at 0 replicas while maxUnavailable keeps the old pods +# serving. Confirm the name with `kubectl get priorityclasses` before setting it. +# -- (string) Name of an existing PriorityClass. Empty means cluster default (priority 0). +priorityClassName: "" + # -- (bool) If true, Creates CronJob resource cronJob: create: false