diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/configmap-etc.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/configmap-etc.yaml index 70593e8..6004320 100755 --- a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/configmap-etc.yaml +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/configmap-etc.yaml @@ -6,13 +6,8 @@ {{- if empty .Values.conf.fm.database.connection -}} {{- $connection := tuple "oslo_db" "internal" "fm" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" -}} -{{- if and .Values.manifests.certificates .Values.endpoints.oslo_db.auth.admin.secret.tls.internal -}} -{{- $_ := (printf "%s?charset=utf8&ssl_ca=/etc/mysql/certs/ca.crt&ssl_key=/etc/mysql/certs/tls.key&ssl_cert=/etc/mysql/certs/tls.crt&ssl_verify_cert" $connection ) | set .Values.conf.fm.database "connection" -}} -{{- else -}} {{- $_ := set .Values.conf.fm.database "connection" $connection -}} {{- end -}} -{{- end -}} - {{- if empty .Values.conf.fm.DEFAULT.sql_connection -}} {{- $_ := tuple "oslo_db" "internal" "fm" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup"| set .Values.conf.fm.DEFAULT "sql_connection" -}} {{- end -}} diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/deployment.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/deployment.yaml index ae3fd9c..ba15f17 100755 --- a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/deployment.yaml +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/deployment.yaml @@ -64,10 +64,7 @@ spec: mountPath: /etc/fm/events.yaml readOnly: true #faultmanagement -{{- if and $envAll.Values.manifests.certificates $envAll.Values.endpoints.oslo_db.auth.admin.secret.tls.internal }} -{{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_db.auth.admin.secret.tls.internal "path" "/etc/mysql/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }} -{{- end }} -{{- dict "enabled" .Values.manifests.certificates "name" .Values.secrets.tls.faultmanagement.fm_api.internal | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }} +{{- dict "enabled" .Values.manifests.certificates "name" .Values.secrets.tls.faultmanagement.fm_api.public | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }} {{ dict "envAll" . "component" "fm_rest_api" "container" "default" "type" "liveness" "probeTemplate" (include "fmRestApiLivenessProbeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }} command: - /tmp/fm-rest-api.sh @@ -101,8 +98,5 @@ spec: hostPath: path: /etc/fm/events.yaml type: File -{{- if and $envAll.Values.manifests.certificates $envAll.Values.endpoints.oslo_db.auth.admin.secret.tls.internal }} -{{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_db.auth.admin.secret.tls.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }} -{{- end }} -{{- dict "enabled" .Values.manifests.certificates "name" .Values.secrets.tls.faultmanagement.fm_api.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }} +{{- dict "enabled" .Values.manifests.certificates "name" .Values.secrets.tls.faultmanagement.fm_api.public | include "helm-toolkit.snippets.tls_volume" | indent 8 }} {{- end }} diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-db-drop.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-db-drop.yaml index 1b154d4..4de0152 100755 --- a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-db-drop.yaml +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-db-drop.yaml @@ -6,9 +6,6 @@ {{- if .Values.manifests.job_db_drop }} {{- $dbDropJob := dict "envAll" . "serviceName" "fm" -}} -{{- if and .Values.manifests.certificates .Values.endpoints.oslo_db.auth.admin.secret.tls.internal -}} -{{- $_ := set $dbDropJob "dbAdminTlsSecret" .Values.endpoints.oslo_db.auth.admin.secret.tls.internal -}} -{{- end -}} {{- if .Values.pod.tolerations.fm.enabled -}} {{- $_ := set $dbDropJob "tolerationsEnabled" true -}} {{- end -}} diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-db-init.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-db-init.yaml index 4c362ae..9432558 100755 --- a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-db-init.yaml +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-db-init.yaml @@ -6,9 +6,6 @@ {{- if .Values.manifests.job_db_init }} {{- $dbInitJob := dict "envAll" . "serviceName" "fm" -}} -{{- if and .Values.manifests.certificates .Values.endpoints.oslo_db.auth.admin.secret.tls.internal -}} -{{- $_ := set $dbInitJob "dbAdminTlsSecret" .Values.endpoints.oslo_db.auth.admin.secret.tls.internal -}} -{{- end -}} {{- if .Values.pod.tolerations.fm.enabled -}} {{- $_ := set $dbInitJob "tolerationsEnabled" true -}} {{- end -}} diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-db-sync.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-db-sync.yaml index 1f04056..d602c44 100755 --- a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-db-sync.yaml +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-db-sync.yaml @@ -6,9 +6,6 @@ {{- if .Values.manifests.job_db_sync }} {{- $dbSyncJob := dict "envAll" . "serviceName" "fm" -}} -{{- if .Values.manifests.certificates -}} -{{- $_ := set $dbSyncJob "dbAdminTlsSecret" .Values.endpoints.oslo_db.auth.admin.secret.tls.internal -}} -{{- end -}} {{- if .Values.pod.tolerations.fm.enabled -}} {{- $_ := set $dbSyncJob "tolerationsEnabled" true -}} {{- end -}} diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-ks-endpoints.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-ks-endpoints.yaml index b05bcb8..eade77a 100755 --- a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-ks-endpoints.yaml +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-ks-endpoints.yaml @@ -7,7 +7,7 @@ {{- if .Values.manifests.job_ks_endpoints }} {{- $ksServiceJob := dict "envAll" . "serviceName" "fm" "serviceTypes" ( tuple "faultmanagement" ) -}} {{- if .Values.manifests.certificates -}} -{{- $_ := set $ksServiceJob "tlsSecret" .Values.secrets.tls.faultmanagement.fm_api.internal -}} +{{- $_ := set $ksServiceJob "tlsSecret" .Values.secrets.tls.faultmanagement.fm_api.public -}} {{- end -}} {{- if .Values.pod.tolerations.fm.enabled -}} {{- $_ := set $ksServiceJob "tolerationsEnabled" true -}} diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-ks-service.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-ks-service.yaml index 7d5ec49..fa753ad 100755 --- a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-ks-service.yaml +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-ks-service.yaml @@ -7,7 +7,7 @@ {{- if .Values.manifests.job_ks_service }} {{- $ksServiceJob := dict "envAll" . "serviceName" "fm" "serviceTypes" ( tuple "faultmanagement" ) -}} {{- if .Values.manifests.certificates -}} -{{- $_ := set $ksServiceJob "tlsSecret" .Values.secrets.tls.faultmanagement.fm_api.internal -}} +{{- $_ := set $ksServiceJob "tlsSecret" .Values.secrets.tls.faultmanagement.fm_api.public -}} {{- end -}} {{- if .Values.pod.tolerations.fm.enabled -}} {{- $_ := set $ksServiceJob "tolerationsEnabled" true -}} diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-ks-user.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-ks-user.yaml index 718ab0c..9d77657 100755 --- a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-ks-user.yaml +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-ks-user.yaml @@ -10,7 +10,7 @@ {{- $_ := set $ksUserJob "tolerationsEnabled" true -}} {{- end -}} {{- if .Values.manifests.certificates -}} -{{- $_ := set $ksUserJob "tlsSecret" .Values.secrets.tls.faultmanagement.fm_api.internal -}} +{{- $_ := set $ksUserJob "tlsSecret" .Values.secrets.tls.faultmanagement.fm_api.public -}} {{- end -}} {{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }} {{- end }} diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/secret-db.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/secret-db.yaml index 715dbba..bf5bda7 100755 --- a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/secret-db.yaml +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/secret-db.yaml @@ -16,10 +16,6 @@ metadata: name: {{ $secretName }} type: Opaque data: -{{- if $envAll.Values.manifests.certificates }} - DB_CONNECTION: {{ (printf "%s?charset=utf8&ssl_ca=/etc/mysql/certs/ca.crt&ssl_key=/etc/mysql/certs/tls.key&ssl_cert=/etc/mysql/certs/tls.crt&ssl_verify_cert" $connection ) | b64enc -}} -{{- else }} - DB_CONNECTION: {{ tuple "oslo_db" "internal" $userClass "mysql" $envAll | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" | b64enc -}} -{{- end }} + DB_CONNECTION: {{ $connection | b64enc -}} {{- end }} {{- end }}