Skip to content

Commit

Permalink
enable topology spread constraints and topology aware routing (#86)
Browse files Browse the repository at this point in the history
* enable topology spread constraints and topology aware routing

* update chart-testing-action
  • Loading branch information
bueti authored Nov 24, 2023
1 parent cc4c250 commit 47156de
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
check-latest: true

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.4.0
uses: helm/chart-testing-action@v2.6.1

- name: Run chart-testing (list-changed)
id: list-changed
Expand Down
5 changes: 3 additions & 2 deletions charts/imaginary/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: "1.2.4"
description: Deploy imaginary to process pictures on the fly
name: imaginary
version: 0.1.12
version: 0.2.0
home: https://github.com/h2non/imaginary
sources:
- https://github.com/ricardo-ch/helm-charts/tree/main/charts/imaginary
Expand All @@ -15,7 +15,8 @@ keywords:
- h2non
annotations:
artifacthub.io/changes: |
- Readme template change
- Add TopologySpreadConstraints to the deployment
- Add Topology Aware Hints to the service
artifacthub.io/images: |
- name: imaginary
image: h2non/imaginary:1.2.4
4 changes: 3 additions & 1 deletion charts/imaginary/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# imaginary

![Version: 0.1.12](https://img.shields.io/badge/Version-0.1.12-informational?style=flat-square) ![AppVersion: 1.2.4](https://img.shields.io/badge/AppVersion-1.2.4-informational?style=flat-square) ![Release Status](https://github.com/ricardo-ch/helm-charts/workflows/Release%20Charts/badge.svg) [![License](https://img.shields.io/github/license/ricardo-ch/helm-charts)](https://github.com/ricardo-ch/helm-charts/blob/main/LICENSE)
![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![AppVersion: 1.2.4](https://img.shields.io/badge/AppVersion-1.2.4-informational?style=flat-square) ![Release Status](https://github.com/ricardo-ch/helm-charts/workflows/Release%20Charts/badge.svg) [![License](https://img.shields.io/github/license/ricardo-ch/helm-charts)](https://github.com/ricardo-ch/helm-charts/blob/main/LICENSE)

This chart installs [Imaginary](https://github.com/h2non/imaginary).

Expand Down Expand Up @@ -51,6 +51,8 @@ Simply add this Chart repository to Helm:
| tls.certificate | string | `""` | Base64 encoded TLS certificate file |
| tls.privateKey | string | `""` | Base64 encoded private key file for TLS certificate. |
| tolerations | list | `[]` | A toleration |
| topologyAware | string | `"auto"` | Configures Toplogy Aware Hints |
| topologyKey | string | `"topology.kubernetes.io/zone"` | Configures the key for topology spread constraints |

## Source Code

Expand Down
10 changes: 10 additions & 0 deletions charts/imaginary/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ spec:
- name: "imaginary"
image: {{ .Values.image | quote }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
topologySpreadConstraints:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- {{ .Release.Name | quote }}
maxSkew: 1
topologyKey: {{ .Values.topologyKey | quote }}
whenUnsatisfiable: DoNotSchedule
env:
- name: PORT
value: {{ .Values.httpPort | quote }}
Expand Down
2 changes: 2 additions & 0 deletions charts/imaginary/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ metadata:
release: {{ .Release.Name | quote }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
app: {{ .Release.Name | quote }}
annotations:
service.kubernetes.io/topology-aware-hints: {{ .Values.topologyAware | quote }}
spec:
selector:
app: {{ template "imaginary.fullname" . }}
Expand Down
6 changes: 6 additions & 0 deletions charts/imaginary/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,9 @@ pdb:
hpa:
minReplicas: 2
maxReplicas: 2

# -- Configures Toplogy Aware Hints
topologyAware: auto

# -- Configures the key for topology spread constraints
topologyKey: topology.kubernetes.io/zone

0 comments on commit 47156de

Please sign in to comment.