From 3537161cdf2e5fbf5952fc84a0e7e3d30181cb5e Mon Sep 17 00:00:00 2001 From: Marco Franssen Date: Tue, 16 May 2023 20:10:10 +0200 Subject: [PATCH 1/3] Allow to configure affinity for tornjak-frontend Signed-off-by: Marco Franssen --- charts/spire/README.md | 1 + charts/spire/charts/tornjak-frontend/README.md | 1 + .../spire/charts/tornjak-frontend/templates/deployment.yaml | 4 ++++ charts/spire/charts/tornjak-frontend/values.yaml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/charts/spire/README.md b/charts/spire/README.md index 9d63c91..de36056 100644 --- a/charts/spire/README.md +++ b/charts/spire/README.md @@ -365,6 +365,7 @@ Kubernetes: `>=1.21.0-0` | spire-server.upstreamAuthority.disk.secret.create | bool | `true` | If disabled requires you to create a secret with the given keys (certificate, key and optional bundle) yourself. | | spire-server.upstreamAuthority.disk.secret.data | object | `{"bundle":"","certificate":"","key":""}` | If secret creation is enabled, will create a secret with following certificate info | | spire-server.upstreamAuthority.disk.secret.name | string | `"spiffe-upstream-ca"` | If secret creation is disabled, the secret with this name will be used. | +| tornjak-frontend.affinity | object | `{}` | | | tornjak-frontend.apiServerURL | string | `"http://localhost:10000/"` | URL of the Tornjak APIs (backend) Since Tornjak Frontend runs in the browser, this URL must be accessible from the machine running a browser. | | tornjak-frontend.fullnameOverride | string | `""` | | | tornjak-frontend.image.pullPolicy | string | `"IfNotPresent"` | | diff --git a/charts/spire/charts/tornjak-frontend/README.md b/charts/spire/charts/tornjak-frontend/README.md index b8a254f..9bf6e65 100644 --- a/charts/spire/charts/tornjak-frontend/README.md +++ b/charts/spire/charts/tornjak-frontend/README.md @@ -49,6 +49,7 @@ port forwarding. See the chart NOTES output for more details. | Key | Type | Default | Description | |-----|------|---------|-------------| +| affinity | object | `{}` | | | apiServerURL | string | `"http://localhost:10000/"` | URL of the Tornjak APIs (backend) Since Tornjak Frontend runs in the browser, this URL must be accessible from the machine running a browser. | | fullnameOverride | string | `""` | | | image.pullPolicy | string | `"IfNotPresent"` | | diff --git a/charts/spire/charts/tornjak-frontend/templates/deployment.yaml b/charts/spire/charts/tornjak-frontend/templates/deployment.yaml index 8566a31..68aac56 100644 --- a/charts/spire/charts/tornjak-frontend/templates/deployment.yaml +++ b/charts/spire/charts/tornjak-frontend/templates/deployment.yaml @@ -55,6 +55,10 @@ spec: nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} volumes: - name: cache emptyDir: {} diff --git a/charts/spire/charts/tornjak-frontend/values.yaml b/charts/spire/charts/tornjak-frontend/values.yaml index e17d532..9b7a48e 100644 --- a/charts/spire/charts/tornjak-frontend/values.yaml +++ b/charts/spire/charts/tornjak-frontend/values.yaml @@ -45,6 +45,8 @@ service: nodeSelector: kubernetes.io/arch: amd64 +affinity: {} + # -- Provide minimal resources to prevent accidental crashes due to resource exhaustion # resources: # requests: From 5cc26d3142eb691bea6d5d4bb1736bf4045382da Mon Sep 17 00:00:00 2001 From: Marco Franssen Date: Tue, 16 May 2023 20:10:54 +0200 Subject: [PATCH 2/3] Allow to configure tolerations for tornjak-frontend Signed-off-by: Marco Franssen --- charts/spire/README.md | 1 + charts/spire/charts/tornjak-frontend/README.md | 1 + .../spire/charts/tornjak-frontend/templates/deployment.yaml | 4 ++++ charts/spire/charts/tornjak-frontend/values.yaml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/charts/spire/README.md b/charts/spire/README.md index de36056..f98eb92 100644 --- a/charts/spire/README.md +++ b/charts/spire/README.md @@ -386,5 +386,6 @@ Kubernetes: `>=1.21.0-0` | tornjak-frontend.serviceAccount.create | bool | `true` | Specifies whether a service account should be created | | tornjak-frontend.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 | | tornjak-frontend.spireHealthCheck.enabled | bool | `true` | Enables the SPIRE Healthchecker indicator | +| tornjak-frontend.tolerations | list | `[]` | | ---------------------------------------------- diff --git a/charts/spire/charts/tornjak-frontend/README.md b/charts/spire/charts/tornjak-frontend/README.md index 9bf6e65..baa3c7e 100644 --- a/charts/spire/charts/tornjak-frontend/README.md +++ b/charts/spire/charts/tornjak-frontend/README.md @@ -70,4 +70,5 @@ port forwarding. See the chart NOTES output for more details. | serviceAccount.create | bool | `true` | 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 | | spireHealthCheck.enabled | bool | `true` | Enables the SPIRE Healthchecker indicator | +| tolerations | list | `[]` | | ---------------------------------------------- diff --git a/charts/spire/charts/tornjak-frontend/templates/deployment.yaml b/charts/spire/charts/tornjak-frontend/templates/deployment.yaml index 68aac56..b404a63 100644 --- a/charts/spire/charts/tornjak-frontend/templates/deployment.yaml +++ b/charts/spire/charts/tornjak-frontend/templates/deployment.yaml @@ -59,6 +59,10 @@ spec: affinity: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} volumes: - name: cache emptyDir: {} diff --git a/charts/spire/charts/tornjak-frontend/values.yaml b/charts/spire/charts/tornjak-frontend/values.yaml index 9b7a48e..08faf8e 100644 --- a/charts/spire/charts/tornjak-frontend/values.yaml +++ b/charts/spire/charts/tornjak-frontend/values.yaml @@ -47,6 +47,8 @@ nodeSelector: affinity: {} +tolerations: [] + # -- Provide minimal resources to prevent accidental crashes due to resource exhaustion # resources: # requests: From 391f093ae92e730804f8528dcbc54d11c69f053a Mon Sep 17 00:00:00 2001 From: Marco Franssen Date: Tue, 16 May 2023 20:11:29 +0200 Subject: [PATCH 3/3] Allow to configure topologySpreadConstraints for tornjak-frontend Signed-off-by: Marco Franssen --- charts/spire/README.md | 1 + charts/spire/charts/tornjak-frontend/README.md | 1 + .../spire/charts/tornjak-frontend/templates/deployment.yaml | 4 ++++ charts/spire/charts/tornjak-frontend/values.yaml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/charts/spire/README.md b/charts/spire/README.md index f98eb92..7b493f8 100644 --- a/charts/spire/README.md +++ b/charts/spire/README.md @@ -387,5 +387,6 @@ Kubernetes: `>=1.21.0-0` | tornjak-frontend.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 | | tornjak-frontend.spireHealthCheck.enabled | bool | `true` | Enables the SPIRE Healthchecker indicator | | tornjak-frontend.tolerations | list | `[]` | | +| tornjak-frontend.topologySpreadConstraints | list | `[]` | | ---------------------------------------------- diff --git a/charts/spire/charts/tornjak-frontend/README.md b/charts/spire/charts/tornjak-frontend/README.md index baa3c7e..e706d15 100644 --- a/charts/spire/charts/tornjak-frontend/README.md +++ b/charts/spire/charts/tornjak-frontend/README.md @@ -71,4 +71,5 @@ port forwarding. See the chart NOTES output for more details. | 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 | | spireHealthCheck.enabled | bool | `true` | Enables the SPIRE Healthchecker indicator | | tolerations | list | `[]` | | +| topologySpreadConstraints | list | `[]` | | ---------------------------------------------- diff --git a/charts/spire/charts/tornjak-frontend/templates/deployment.yaml b/charts/spire/charts/tornjak-frontend/templates/deployment.yaml index b404a63..cef0fab 100644 --- a/charts/spire/charts/tornjak-frontend/templates/deployment.yaml +++ b/charts/spire/charts/tornjak-frontend/templates/deployment.yaml @@ -63,6 +63,10 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.topologySpreadConstraints }} + topologySpreadConstraints: + {{- toYaml . | nindent 8 }} + {{- end }} volumes: - name: cache emptyDir: {} diff --git a/charts/spire/charts/tornjak-frontend/values.yaml b/charts/spire/charts/tornjak-frontend/values.yaml index 08faf8e..5abc2e8 100644 --- a/charts/spire/charts/tornjak-frontend/values.yaml +++ b/charts/spire/charts/tornjak-frontend/values.yaml @@ -49,6 +49,8 @@ affinity: {} tolerations: [] +topologySpreadConstraints: [] + # -- Provide minimal resources to prevent accidental crashes due to resource exhaustion # resources: # requests: