diff options
author | Andreas Geissler <andreas-geissler@telekom.de> | 2024-03-11 17:26:53 +0100 |
---|---|---|
committer | Andreas Geissler <andreas-geissler@telekom.de> | 2024-03-11 17:31:04 +0100 |
commit | 060bc378e32c2ffba34f890c53cc359eb9ee64d0 (patch) | |
tree | 8bb7de0ab8445dc7fbbc8831f2ad6a09e9c83381 /kubernetes/cds/components | |
parent | 9964927d8766c5c396ef2caf6f7aeb7494db279e (diff) |
[COMMON] Update MariaDB readinessChecks to fix Operator issues
Give different readinessCheck rules depending on the usage
of mariaDB Operator and local/global DB setup
Apply these changes to CDS, NBI, SO, SDNC, Policy
Issue-ID: OOM-3280
Change-Id: I4e6f584558ffebb6ab602db88a73c2f02891902e
Signed-off-by: Andreas Geissler <andreas-geissler@telekom.de>
Diffstat (limited to 'kubernetes/cds/components')
-rwxr-xr-x | kubernetes/cds/components/cds-blueprints-processor/templates/deployment.yaml | 14 | ||||
-rwxr-xr-x | kubernetes/cds/components/cds-blueprints-processor/values.yaml | 24 |
2 files changed, 35 insertions, 3 deletions
diff --git a/kubernetes/cds/components/cds-blueprints-processor/templates/deployment.yaml b/kubernetes/cds/components/cds-blueprints-processor/templates/deployment.yaml index a6e3a52bf7..761b031770 100755 --- a/kubernetes/cds/components/cds-blueprints-processor/templates/deployment.yaml +++ b/kubernetes/cds/components/cds-blueprints-processor/templates/deployment.yaml @@ -37,7 +37,19 @@ spec: metadata: {{- include "common.templateMetadata" . | nindent 6 }} spec: initContainers: - {{ include "common.readinessCheck.waitFor" . | nindent 6 }} + {{- if .Values.global.mariadbGalera.localCluster }} + {{- if .Values.global.mariadbGalera.useOperator }} + {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_local_operator ) | indent 6 | trim }} + {{ else }} + {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_local ) | indent 6 | trim }} + {{- end }} + {{ else }} + {{- if .Values.global.mariadbGalera.useOperator }} + {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_global_operator ) | indent 6 | trim }} + {{ else }} + {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_global ) | indent 6 | trim }} + {{- end }} + {{- end }} - command: - sh args: diff --git a/kubernetes/cds/components/cds-blueprints-processor/values.yaml b/kubernetes/cds/components/cds-blueprints-processor/values.yaml index 3d931d3d65..a32afb0db3 100755 --- a/kubernetes/cds/components/cds-blueprints-processor/values.yaml +++ b/kubernetes/cds/components/cds-blueprints-processor/values.yaml @@ -18,6 +18,17 @@ # Global configuration defaults. ################################################################# global: + mariadbGalera: &mariadbGalera + # flag to enable the DB creation via mariadb-operator + useOperator: true + #This flag allows NBI to instantiate its own mariadb-galera cluster + #When changing it to "true", also set "globalCluster: false" + #as the dependency check will not work otherwise (Chart.yaml) + localCluster: true + globalCluster: false + service: mariadb-galera + internalPort: 3306 + nameOverride: mariadb-galera # image pull policy pullPolicy: Always persistence: @@ -218,9 +229,18 @@ resources: unlimited: {} readinessCheck: - wait_for: + wait_for_global_operator: + pods: + - '{{ .Values.global.mariadbGalera.nameOverride }}-0' + wait_for_local_operator: + pods: + - '{{ .Values.config.cdsDB.dbServer }}-0' + wait_for_global: apps: - - cds-db + - '{{ .Values.global.mariadbGalera.nameOverride }}' + wait_for_local: + apps: + - '{{ .Values.config.cdsDB.dbServer }}' #Pods Service Account serviceAccount: |