-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
93 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
charts/posthog/templates/_snippet-topologySpreadConstraints.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{{/* Common topologySpreadConstraints definition */}} | ||
{{/* | ||
matchLabelsKeys are the set of unique pod labels for which the constraints are applied | ||
any missing labels are ignored. | ||
pod-template-hash is added automatically by deployments and is unique for each rollout. | ||
Including this means we don't get out of sync on rollouts as it ignores the locations | ||
of existing pods that will be terminated after the rollout is finished. | ||
*/}} | ||
{{- define "_snippet-selectors" -}} | ||
labelSelector: | ||
matchLabels: {} | ||
matchLabelKeys: | ||
- pod-template-hash | ||
- app | ||
- release | ||
- role | ||
- app.kubernetes.io/name | ||
- app.kubernetes.io/instance | ||
{{- end }} | ||
{{- define "_snippet-topologySpreadConstraints" }} | ||
{{- if (.Values.includeDefaultTopologySpreadConstraints | default false) }} | ||
topologySpreadConstraints: | ||
- maxSkew: 1 | ||
minDomains: 3 | ||
topologyKey: topology.kubernetes.io/zone | ||
whenUnsatisfiable: DoNotSchedule | ||
nodeTaintsPolicy: Honor | ||
{{- include "_snippet-selectors" . | nindent 2 }} | ||
- maxSkew: 3 | ||
topologyKey: kubernetes.io/hostname | ||
whenUnsatisfiable: ScheduleAnyway | ||
nodeTaintsPolicy: Honor | ||
{{- include "_snippet-selectors" . | nindent 2 }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
suite: _topologySpreadConstraints | ||
templates: | ||
- templates/plugins-deployment.yaml | ||
- templates/web-deployment.yaml | ||
- templates/worker-deployment.yaml | ||
# NOTE: we need to include this as it is required by the other templates | ||
- templates/secrets.yaml | ||
tests: | ||
- it: spec.template.spec.topologySpreadConstraints should be empty by default | ||
templates: | ||
- templates/plugins-deployment.yaml | ||
- templates/web-deployment.yaml | ||
- templates/worker-deployment.yaml | ||
set: | ||
cloud: local | ||
asserts: | ||
- hasDocuments: | ||
count: 1 | ||
- isEmpty: | ||
path: spec.template.spec.topologySpreadConstraints | ||
- it: spec.template.spec.topologySpreadConstraints should exist if includeDefaultTopologySpreadConstraints is set | ||
templates: | ||
- templates/plugins-deployment.yaml | ||
- templates/web-deployment.yaml | ||
- templates/worker-deployment.yaml | ||
set: | ||
cloud: local | ||
includeDefaultTopologySpreadConstraints: true | ||
asserts: | ||
- hasDocuments: | ||
count: 1 | ||
- contains: | ||
path: spec.template.spec.topologySpreadConstraints[0] | ||
content: | ||
topologyKey: topology.kubernetes.io/zone | ||
maxSkew: 1 | ||
whenUnsatisfiable: DoNotSchedule | ||
- contains: | ||
path: spec.template.spec.topologySpreadConstraints[1] | ||
content: | ||
topologyKey: topology.kubernetes.io/hostname | ||
maxSkew: 3 | ||
whenUnsatisfiable: ScheduleAnyway |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters