Skip to content

Commit

Permalink
Merge pull request #340 from mintel/INFRA-26871_topology_template_hash
Browse files Browse the repository at this point in the history
Infra 26871 topology template hash
  • Loading branch information
easterbrennan authored Jul 23, 2024
2 parents 82b0ed5 + 7629463 commit c032320
Show file tree
Hide file tree
Showing 20 changed files with 105 additions and 2 deletions.
3 changes: 3 additions & 0 deletions charts/standard-application-stack/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ 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.1.0] - 2024-07-19
### Added
- Always add `matchLabelKeys: pod-template-hash` to topologySpreadConstraints

## [v7.0.0] - 2024-07-17
### Added
Expand Down
2 changes: 1 addition & 1 deletion charts/standard-application-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.0.0
version: 7.1.0

dependencies:
- name: redis
Expand Down
2 changes: 1 addition & 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.0.0](https://img.shields.io/badge/Version-7.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 7.1.0](https://img.shields.io/badge/Version-7.1.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

Expand Down
4 changes: 4 additions & 0 deletions charts/standard-application-stack/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -500,13 +500,17 @@ topologySpreadConstraints:
matchLabels: {{ include "mintel_common.selectorLabels" . | nindent 8 }}
maxSkew: {{ .Values.topologySpreadConstraints.zone.maxSkew | default 1 }}
topologyKey: topology.kubernetes.io/zone
matchLabelKeys:
- pod-template-hash
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
matchLabelKeys:
- pod-template-hash
whenUnsatisfiable: {{ .Values.topologySpreadConstraints.node.whenUnsatisfiable | default "DoNotSchedule" }}
{{- end }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ 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
Expand Down Expand Up @@ -332,6 +334,8 @@ 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
Expand Up @@ -90,6 +90,8 @@ 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
Expand Down Expand Up @@ -205,6 +207,8 @@ 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
Expand Down Expand Up @@ -322,6 +326,8 @@ 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
Expand Up @@ -109,6 +109,8 @@ 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
Expand Up @@ -128,6 +128,8 @@ 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
Expand Down Expand Up @@ -261,6 +263,8 @@ 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
Expand Down Expand Up @@ -392,6 +396,8 @@ 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
Expand Down Expand Up @@ -525,6 +531,8 @@ 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
Expand Up @@ -110,6 +110,8 @@ 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
Expand Down Expand Up @@ -225,6 +227,8 @@ 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
Expand Up @@ -121,6 +121,8 @@ 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
Expand Down Expand Up @@ -247,6 +249,8 @@ 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
Expand Down Expand Up @@ -365,6 +369,8 @@ 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
Expand Up @@ -108,6 +108,8 @@ 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
Expand Down Expand Up @@ -332,6 +334,8 @@ 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
Expand Up @@ -108,6 +108,8 @@ 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
Expand Down Expand Up @@ -332,6 +334,8 @@ 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
Expand Up @@ -112,6 +112,8 @@ 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
Expand Down Expand Up @@ -231,6 +233,8 @@ 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
Expand Down Expand Up @@ -349,6 +353,8 @@ 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
Expand Down Expand Up @@ -462,6 +468,8 @@ 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
Expand Down Expand Up @@ -575,6 +583,8 @@ 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
Expand Up @@ -109,6 +109,8 @@ 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
Expand Down Expand Up @@ -223,6 +225,8 @@ 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
Expand Down Expand Up @@ -335,6 +339,8 @@ 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
Expand Down Expand Up @@ -446,6 +452,8 @@ 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
Expand Down Expand Up @@ -557,6 +565,8 @@ 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
Expand Up @@ -108,6 +108,8 @@ 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
Expand Down Expand Up @@ -340,6 +342,8 @@ 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
Expand Down Expand Up @@ -453,6 +457,8 @@ 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
Expand Down Expand Up @@ -578,6 +584,8 @@ 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
Expand Up @@ -103,6 +103,8 @@ 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ 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
Expand Down
Loading

0 comments on commit c032320

Please sign in to comment.