Skip to content

Commit

Permalink
[common] Add topologySpreadConstraints to Common Chart (k8s-at-home#66)
Browse files Browse the repository at this point in the history
* Feature: Add topologySpreadConstraints to common chart

* Feature: Bump common chart version to 3.1.2

* Feature: Bump common chart version to 3.2.0 instead

* Update charts/stable/common/values.yaml

Thanks for the suggestion @rwaltr

Co-authored-by: Ryan Walter <[email protected]>

Co-authored-by: Ryan Walter <[email protected]>
  • Loading branch information
wrmilling and rwaltr authored Jun 16, 2021
1 parent f662b39 commit 5c93f1a
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/stable/common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: common
description: Function library for k8s-at-home charts
type: library
version: 3.1.1
version: 3.2.0
kubeVersion: ">=1.16.0-0"
keywords:
- k8s-at-home
Expand Down
11 changes: 10 additions & 1 deletion charts/stable/common/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# common

![Version: 3.1.1](https://img.shields.io/badge/Version-3.1.1-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square)
![Version: 3.2.0](https://img.shields.io/badge/Version-3.2.0-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square)

Function library for k8s-at-home charts

Expand Down Expand Up @@ -206,6 +206,7 @@ N/A
| serviceAccount.create | bool | `false` | Specifies whether a service account should be created |
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
| tolerations | list | `[]` | Specify taint tolerations [[ref]](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) |
| topologySpreadConstraints | list | `[]` | Defines topologySpreadConstraint rules. [[ref]](https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/) |
| volumeClaimTemplates | list | `[]` | Used in conjunction with `controller.type: statefulset` to create individual disks for each instance. |

## Changelog
Expand All @@ -215,6 +216,12 @@ All notable changes to this library Helm chart 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).

### [3.2.0]

#### Added

- Support for specifying [topologySpreadConstraints](https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/) for a pod.

### [3.1.1]

#### Fixed
Expand Down Expand Up @@ -381,6 +388,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- The `command` and `args` values now properly support both string and list values.

[3.2.0]: #3.2.0
[3.1.1]: #3.1.1
[3.1.0]: #3.1.0
[3.0.2]: #3.0.2
[3.0.1]: #3.0.1
Expand Down
8 changes: 8 additions & 0 deletions charts/stable/common/README_CHANGELOG.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ All notable changes to this library Helm chart 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).

### [3.2.0]

#### Added

- Support for specifying [topologySpreadConstraints](https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/) for a pod.

### [3.1.1]

#### Fixed
Expand Down Expand Up @@ -176,6 +182,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- The `command` and `args` values now properly support both string and list values.

[3.2.0]: #3.2.0
[3.1.1]: #3.1.1
[3.1.0]: #3.1.0
[3.0.2]: #3.0.2
[3.0.1]: #3.0.1
Expand Down
4 changes: 4 additions & 0 deletions charts/stable/common/templates/lib/controller/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ nodeSelector:
affinity:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- with .Values.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 2 }}
Expand Down
8 changes: 8 additions & 0 deletions charts/stable/common/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,14 @@ nodeSelector: {}
# [[ref]](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity)
affinity: {}

# -- Defines topologySpreadConstraint rules.
# [[ref]](https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/)
topologySpreadConstraints: []
# - maxSkew: <integer>
# topologyKey: <string>
# whenUnsatisfiable: <string>
# labelSelector: <object>

# -- Specify taint tolerations
# [[ref]](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)
tolerations: []
Expand Down

0 comments on commit 5c93f1a

Please sign in to comment.