chart: add resourceSuffix value

Hack for resources that may conflict in parallel environments.
This commit is contained in:
Trong Huu Nguyen
2024-11-14 16:20:24 +01:00
parent ca4ebb6ef4
commit f60cf79da6
5 changed files with 19 additions and 4 deletions
+4
View File
@@ -110,3 +110,7 @@ values:
type: string
ignoreKind:
- legacy
resourceSuffix:
description: Suffix for resources that may conflict in parallel environments.
config:
type: string
+9 -3
View File
@@ -121,7 +121,13 @@ Aiven instance name.
The last part of the fully qualified name (e.g. <instance> in `redis-<namespace>-<instance>`)
*/}}
{{- define "aiven.instanceName" -}}
{{- printf "wonderwall-%s" . }}
{{- $root := .root }}
{{- $provider := .provider }}
{{- if $root.Values.resourceSuffix }}
{{- printf "wonderwall-%s-%s" $provider $root.Values.resourceSuffix }}
{{- else }}
{{- printf "wonderwall-%s" $provider }}
{{- end }}
{{- end }}
{{/*
@@ -134,7 +140,7 @@ Expects a dict with the following keys:
{{- define "aiven.redisName" -}}
{{- $root := .root }}
{{- $provider := .provider }}
{{- printf "redis-%s-%s" $root.Release.Namespace (include "aiven.instanceName" $provider) }}
{{- printf "redis-%s-%s" $root.Release.Namespace (include "aiven.instanceName" (dict "provider" $provider "root" $root)) }}
{{- end }}
{{/*
@@ -147,5 +153,5 @@ Expects a dict with the following keys:
{{- define "aiven.serviceintegrationName" -}}
{{- $root := .root }}
{{- $provider := .provider }}
{{- printf "serviceintegration-%s-%s" $root.Release.Namespace (include "aiven.instanceName" $provider) }}
{{- printf "serviceintegration-%s-%s" $root.Release.Namespace (include "aiven.instanceName" (dict "provider" $provider "root" $root)) }}
{{- end }}
+1 -1
View File
@@ -65,7 +65,7 @@ Expects a dict as input with the following keys:
{{- $provider := .provider }}
{{- $access := .access }}
{{- $secretName := .secretName -}}
{{- $instance := include "aiven.instanceName" $provider }}
{{- $instance := include "aiven.instanceName" (dict "provider" $provider "root" $root) }}
---
apiVersion: aiven.nais.io/v1
kind: AivenApplication
@@ -3,7 +3,11 @@
apiVersion: nais.io/v1
kind: AzureAdApplication
metadata:
{{- if .Values.resourceSuffix }}
name: {{ include "wonderwall.fullname" . }}-fa-{{ .Values.resourceSuffix }}
{{- else }}
name: {{ include "wonderwall.fullname" . }}-fa
{{- end }}
labels:
{{- include "wonderwall.labelsForwardAuth" . | nindent 4 }}
spec:
+1
View File
@@ -70,6 +70,7 @@ resources:
requests:
cpu: 100m
memory: 64Mi
resourceSuffix: ""
podDisruptionBudget:
maxUnavailable: 1
otel: