Skip to content

Commit

Permalink
make matchlablekeys in topologyspreadconstraints optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Brennan committed Jul 24, 2024
1 parent c2e448f commit cbde565
Showing 21 changed files with 16 additions and 98 deletions.
4 changes: 4 additions & 0 deletions charts/standard-application-stack/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v7.3.0] - 2024-07-24
### Changes
- Make `matchLabelKeys: pod-template-hash` in topologySpreadConstraints optional

## [v7.2.0] - 2024-07-24
### Changes
- Updated the logic of initialDelaySeconds to not be set if no value given
2 changes: 1 addition & 1 deletion charts/standard-application-stack/Chart.yaml
Original file line number Diff line number Diff line change
@@ -15,7 +15,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: 7.2.0
version: 7.3.0

dependencies:
- name: redis
4 changes: 3 additions & 1 deletion charts/standard-application-stack/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# standard-application-stack

![Version: 7.2.0](https://img.shields.io/badge/Version-7.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 7.3.0](https://img.shields.io/badge/Version-7.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

A generic chart to support most common application requirements

@@ -345,9 +345,11 @@ A generic chart to support most common application requirements
| terminationGracePeriodSeconds | int | `30` | Configure terminationGracePeriodSeconds ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/ |
| topologySpreadConstraints.enabled | bool | `true` | |
| topologySpreadConstraints.node.enabled | string | `nil` | Set this to true/false to override the default behaviour (enabled for prod only) |
| topologySpreadConstraints.node.matchlabelkeys.enabled | bool | `false` | |
| topologySpreadConstraints.node.maxSkew | int | `1` | |
| topologySpreadConstraints.specificYaml | string | `nil` | Specify custom topologySpreadConstraints yaml |
| topologySpreadConstraints.zone.enabled | bool | `true` | |
| topologySpreadConstraints.zone.matchlabelkeys.enabled | bool | `false` | |
| topologySpreadConstraints.zone.maxSkew | int | `1` | |
| useHostNetwork | bool | `false` | If true, use the host network for the main deployment. |
| verticalPodAutoscaler | object | `{"autoscalingEnabled":false,"containerPolicies":null,"enabled":true,"evictionRequirements":null,"instances":{},"minReplicas":1}` | Configuration for creating a VerticalPodAutoscaler for this app. Currently only supports recommendations-only mode. |
4 changes: 4 additions & 0 deletions charts/standard-application-stack/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -500,17 +500,21 @@ topologySpreadConstraints:
matchLabels: {{ include "mintel_common.selectorLabels" . | nindent 8 }}
maxSkew: {{ .Values.topologySpreadConstraints.zone.maxSkew | default 1 }}
topologyKey: topology.kubernetes.io/zone
{{- if .Values.topologySpreadConstraints.zone.matchlabelkeys.enabled }}
matchLabelKeys:
- pod-template-hash
{{- end }}
whenUnsatisfiable: {{ .Values.topologySpreadConstraints.zone.whenUnsatisfiable | default "DoNotSchedule" }}
{{- end }}
{{- if or (and (not (kindIs "bool" .Values.topologySpreadConstraints.node.enabled)) (or (eq .Values.global.clusterEnv "logs") (eq .Values.global.clusterEnv "prod"))) (and .Values.topologySpreadConstraints.node .Values.topologySpreadConstraints.node.enabled) }}
- labelSelector:
matchLabels: {{ include "mintel_common.selectorLabels" . | nindent 8 }}
maxSkew: {{ .Values.topologySpreadConstraints.node.maxSkew | default 1 }}
topologyKey: kubernetes.io/hostname
{{- if .Values.topologySpreadConstraints.node.matchlabelkeys.enabled }}
matchLabelKeys:
- pod-template-hash
{{- end }}
whenUnsatisfiable: {{ .Values.topologySpreadConstraints.node.whenUnsatisfiable | default "DoNotSchedule" }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -106,8 +106,6 @@ Check DynamoDB envfrom secretRef is present:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: test-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
@@ -328,8 +326,6 @@ Check DynamoDB secretName Override:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: test-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
Original file line number Diff line number Diff line change
@@ -90,8 +90,6 @@ Check celery does not pull in `main.env` values:
matchLabels:
app.kubernetes.io/component: celery
app.kubernetes.io/name: example-app-celery
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
@@ -205,8 +203,6 @@ Check default env behavior:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: example-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
@@ -322,8 +318,6 @@ Check main container combines default env and `main.env` values:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: example-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
Original file line number Diff line number Diff line change
@@ -107,8 +107,6 @@ Has a pod template that uses the host network:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: test-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
Original file line number Diff line number Diff line change
@@ -126,8 +126,6 @@ Check custom python otel extraEnv vars are added:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: test-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
@@ -259,8 +257,6 @@ Check custom sampler settings:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: test-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
@@ -390,8 +386,6 @@ Check default python otel envars are added:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: test-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
@@ -523,8 +517,6 @@ Check global otel extraEnv vars are added:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: test-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
Original file line number Diff line number Diff line change
@@ -108,8 +108,6 @@ Check default label behavior:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
@@ -223,8 +221,6 @@ Check empty application and component labels both default to name:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
Original file line number Diff line number Diff line change
@@ -119,8 +119,6 @@ Check AWS ALB lifecycle rule applied:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: example-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
@@ -245,8 +243,6 @@ Check AWS ALB lifecycle rules applied with custom delay:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: example-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
@@ -363,8 +359,6 @@ Check lifecycle rules:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: example-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
Original file line number Diff line number Diff line change
@@ -106,8 +106,6 @@ Check MariaDB envfrom secretRef is present:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: test-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
@@ -328,8 +326,6 @@ Check MariaDB secretName Override:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: test-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
Original file line number Diff line number Diff line change
@@ -106,8 +106,6 @@ Check Memcached envfrom secretRef is present:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: test-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
@@ -328,8 +326,6 @@ Check Memcached secretName Override:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: test-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
Original file line number Diff line number Diff line change
@@ -110,8 +110,6 @@ Check container extraPorts:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: example-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
@@ -229,8 +227,6 @@ Check container extraPorts are validated:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: example-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
@@ -347,8 +343,6 @@ Check container extraPorts protocol:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: example-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
@@ -460,8 +454,6 @@ Check default container main port:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: example-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
@@ -573,8 +565,6 @@ Check overridden container main port:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: example-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
Original file line number Diff line number Diff line change
@@ -107,8 +107,6 @@ Check allowSingleReplica doesn't alter strategy:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: example-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
@@ -221,8 +219,6 @@ Check allowSingleReplica set annotations:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: example-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
@@ -333,8 +329,6 @@ Check replicas unset when autoscaling is enabled:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: example-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
@@ -444,8 +438,6 @@ Check singleReplicaOnly applied:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: example-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
@@ -555,8 +547,6 @@ Check singleReplicaOnly ignore replicas value:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: example-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
Original file line number Diff line number Diff line change
@@ -106,8 +106,6 @@ Check S3 envfrom secretRef is present:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: test-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
@@ -336,8 +334,6 @@ Check S3 envfrom secretRef is present for multiple instances of TF Cloud helm ch
app.kubernetes.io/component: app
app.kubernetes.io/name: test-app
app.kubernetes.io/part-of: test-project
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
@@ -449,8 +445,6 @@ Check S3 secretName Override:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: test-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
@@ -574,8 +568,6 @@ Check S3 stakater secret reloader annotation contains correct secrets for multip
app.kubernetes.io/component: app
app.kubernetes.io/name: test-app
app.kubernetes.io/part-of: test-project
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
Original file line number Diff line number Diff line change
@@ -101,8 +101,6 @@ Check stateful set is rendered with volumeClaimTemplates:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: test-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
Original file line number Diff line number Diff line change
@@ -448,8 +448,6 @@ Check EXTRA_ALLOWED_HOSTS env var extraHosts with extraIngresses:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/name: example-app
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
Loading

0 comments on commit cbde565

Please sign in to comment.