From c48d4c98361add7f2da08662a0442d36dbfe4f50 Mon Sep 17 00:00:00 2001 From: Mario Alfredo Carrillo Arevalo Date: Tue, 16 Apr 2019 18:50:04 +0000 Subject: [PATCH 2/7] Add chart to deploy fm rest api This commit adds the required files to deploy fm rest api service with helm. Story: 2004008 Task: 26955 Depends-On: https://review.opendev.org/634540/ Depends-On: https://review.opendev.org/656388/ Depends-On: https://review.opendev.org/656655/ Change-Id: I566f2191914a49403c1947f3b767fae7807c43d0 Co-authored-by: Sun Austin Signed-off-by: Mario Alfredo Carrillo Arevalo --- .../helm-charts/fm-rest-api/Chart.yaml | 5 + .../helm-charts/fm-rest-api/requirements.yaml | 8 + .../fm-rest-api/templates/_helpers.tpl | 38 +++ .../fm-rest-api/templates/bin/_db-drop.sh.tpl | 11 + .../fm-rest-api/templates/bin/_db-sync.sh.tpl | 11 + .../templates/bin/_fm-rest-api.sh.tpl | 14 + .../fm-rest-api/templates/configmap-bin.yaml | 27 ++ .../fm-rest-api/templates/configmap-etc.yaml | 45 +++ .../fm-rest-api/templates/deployment.yaml | 85 +++++ .../fm-rest-api/templates/ingress.yaml | 10 + .../fm-rest-api/templates/job-db-drop.yaml | 10 + .../fm-rest-api/templates/job-db-init.yaml | 10 + .../fm-rest-api/templates/job-db-sync.yaml | 10 + .../templates/job-ks-endpoints.yaml | 10 + .../fm-rest-api/templates/job-ks-service.yaml | 10 + .../fm-rest-api/templates/job-ks-user.yaml | 10 + .../fm-rest-api/templates/secret-db.yaml | 20 ++ .../templates/secret-keystone.yaml | 20 ++ .../fm-rest-api/templates/service.yaml | 29 ++ .../helm-charts/fm-rest-api/values.yaml | 306 ++++++++++++++++++ 20 files changed, 689 insertions(+) create mode 100644 fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/Chart.yaml create mode 100644 fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/requirements.yaml create mode 100755 fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/_helpers.tpl create mode 100755 fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/bin/_db-drop.sh.tpl create mode 100755 fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/bin/_db-sync.sh.tpl create mode 100755 fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/bin/_fm-rest-api.sh.tpl create mode 100755 fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/configmap-bin.yaml create mode 100755 fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/configmap-etc.yaml create mode 100755 fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/deployment.yaml create mode 100755 fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/ingress.yaml create mode 100755 fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-db-drop.yaml create mode 100755 fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-db-init.yaml create mode 100755 fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-db-sync.yaml create mode 100755 fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-ks-endpoints.yaml create mode 100755 fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-ks-service.yaml create mode 100755 fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-ks-user.yaml create mode 100755 fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/secret-db.yaml create mode 100755 fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/secret-keystone.yaml create mode 100755 fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/service.yaml create mode 100644 fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/Chart.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/Chart.yaml new file mode 100644 index 0000000..7f6adbe --- /dev/null +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: "1.0" +description: StarlingX Fault Rest API Service +name: fm-rest-api +version: 0.1.0 diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/requirements.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/requirements.yaml new file mode 100644 index 0000000..4148fb8 --- /dev/null +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/requirements.yaml @@ -0,0 +1,8 @@ +# +# SPDX-License-Identifier: Apache-2.0 +# + +dependencies: + - name: helm-toolkit + repository: http://localhost:8879/charts + version: 0.1.0 diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/_helpers.tpl b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/_helpers.tpl new file mode 100755 index 0000000..d1fe022 --- /dev/null +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/_helpers.tpl @@ -0,0 +1,38 @@ +{{/* +# +# SPDX-License-Identifier: Apache-2.0 +# +*/}} + +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "fm-rest-api.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "fm-rest-api.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "fm-rest-api.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/bin/_db-drop.sh.tpl b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/bin/_db-drop.sh.tpl new file mode 100755 index 0000000..c3a222f --- /dev/null +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/bin/_db-drop.sh.tpl @@ -0,0 +1,11 @@ +#!/bin/bash + +{{/* +# +# SPDX-License-Identifier: Apache-2.0 +# +*/}} + +set -ex + +dropdb -h 127.0.0.1 -Uroot fm diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/bin/_db-sync.sh.tpl b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/bin/_db-sync.sh.tpl new file mode 100755 index 0000000..d39d047 --- /dev/null +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/bin/_db-sync.sh.tpl @@ -0,0 +1,11 @@ +#!/bin/bash + +{{/* +# +# SPDX-License-Identifier: Apache-2.0 +# +*/}} + +set -ex + +fm-dbsync --config-file /etc/fm/fm.conf diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/bin/_fm-rest-api.sh.tpl b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/bin/_fm-rest-api.sh.tpl new file mode 100755 index 0000000..e45ad87 --- /dev/null +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/bin/_fm-rest-api.sh.tpl @@ -0,0 +1,14 @@ +#!/bin/bash + +{{/* +# +# SPDX-License-Identifier: Apache-2.0 +# +*/}} + +set -ex + +export SQL_CONNECTION=$(awk -F '=' '/sql_connection/{print $2}' /etc/fm/fm.conf) +echo $SQL_CONNECTION > /var/log/sql_connection +python /usr/local/bin/fm_db_sync_event_suppression.py $SQL_CONNECTION +python /var/lib/openstack/bin/fm-api --config-file /etc/fm/fm.conf diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/configmap-bin.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/configmap-bin.yaml new file mode 100755 index 0000000..351d2e1 --- /dev/null +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/configmap-bin.yaml @@ -0,0 +1,27 @@ +{{/* +# +# SPDX-License-Identifier: Apache-2.0 +# +*/}} + +apiVersion: v1 +kind: ConfigMap +metadata: + name: fm-bin +data: + fm-rest-api.sh: | +{{ tuple "bin/_fm-rest-api.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + db-sync.sh: | +{{ tuple "bin/_db-sync.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + db-init.py: | +{{- include "helm-toolkit.scripts.db_init" . | indent 4 }} + db-drop.sh: | +{{ tuple "bin/_db-drop.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + db-drop.py: | +{{- include "helm-toolkit.scripts.db_drop" . | indent 4 }} + ks-service.sh: | +{{- include "helm-toolkit.scripts.keystone_service" . | indent 4 }} + ks-endpoints.sh: | +{{- include "helm-toolkit.scripts.keystone_endpoints" . | indent 4 }} + ks-user.sh: | +{{- include "helm-toolkit.scripts.keystone_user" . | indent 4 }} 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 new file mode 100755 index 0000000..92cec5e --- /dev/null +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/configmap-etc.yaml @@ -0,0 +1,45 @@ +{{/* +# +# SPDX-License-Identifier: Apache-2.0 +# +*/}} + +{{- if empty .Values.conf.fm.database.connection -}} +{{- $_ := tuple "oslo_db" "internal" "fm" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup"| set .Values.conf.fm.database "connection" -}} +{{- 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 -}} +{{- if empty .Values.conf.fm.keystone_authtoken.auth_uri -}} +{{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.fm.keystone_authtoken "auth_uri" -}} +{{- end -}} +{{- if empty .Values.conf.fm.keystone_authtoken.auth_url -}} +{{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.fm.keystone_authtoken "auth_url" -}} +{{- end -}} +{{- if empty .Values.conf.fm.keystone_authtoken.region_name -}} +{{- $_ := set .Values.conf.fm.keystone_authtoken "region_name" .Values.endpoints.identity.auth.fm.region_name -}} +{{- end -}} +{{- if empty .Values.conf.fm.keystone_authtoken.project_name -}} +{{- $_ := set .Values.conf.fm.keystone_authtoken "project_name" .Values.endpoints.identity.auth.fm.project_name -}} +{{- end -}} +{{- if empty .Values.conf.fm.keystone_authtoken.project_domain_name -}} +{{- $_ := set .Values.conf.fm.keystone_authtoken "project_domain_name" .Values.endpoints.identity.auth.fm.project_domain_name -}} +{{- end -}} +{{- if empty .Values.conf.fm.keystone_authtoken.user_domain_name -}} +{{- $_ := set .Values.conf.fm.keystone_authtoken "user_domain_name" .Values.endpoints.identity.auth.fm.user_domain_name -}} +{{- end -}} +{{- if empty .Values.conf.fm.keystone_authtoken.username -}} +{{- $_ := set .Values.conf.fm.keystone_authtoken "username" .Values.endpoints.identity.auth.fm.username -}} +{{- end -}} +{{- if empty .Values.conf.fm.keystone_authtoken.password -}} +{{- $_ := set .Values.conf.fm.keystone_authtoken "password" .Values.endpoints.identity.auth.fm.password -}} +{{- end -}} + +apiVersion: v1 +kind: Secret +metadata: + name: fm-etc +type: Opaque +data: + api-paste.ini: {{ include "helm-toolkit.utils.to_ini" .Values.conf.paste | b64enc }} + fm.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.fm | b64enc }} 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 new file mode 100755 index 0000000..59e9165 --- /dev/null +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/deployment.yaml @@ -0,0 +1,85 @@ +{{/* +# +# SPDX-License-Identifier: Apache-2.0 +# +*/}} + +{{- if .Values.manifests.deployment_fm_rest_api }} +{{- $envAll := . }} + +{{- $mounts_fm_rest_api := .Values.pod.mounts.fm_rest_api.fm_rest_api }} +{{- $mounts_fm_rest_api_init := .Values.pod.mounts.fm_rest_api.init_container }} + +{{- $serviceAccountName := "fm-rest-api" }} +{{ tuple $envAll "fmapi" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} + +apiVersion: apps/v1beta2 +kind: Deployment +metadata: + name: fm-rest-api + labels: +{{ tuple $envAll "fm-rest-api" "fm" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} +spec: + replicas: {{ .Values.pod.replicas.api }} + selector: + matchLabels: +{{ tuple $envAll "fm-rest-api" "fm" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} + template: + metadata: + labels: +{{ tuple $envAll "fm-rest-api" "fm" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} + spec: + serviceAccountName: {{ $serviceAccountName }} + initContainers: +{{ tuple $envAll "api" $mounts_fm_rest_api_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} + containers: + - name: fm-rest-api + volumeMounts: + - name: fm-bin + mountPath: /tmp/fm-rest-api.sh + subPath: fm-rest-api.sh + readOnly: true + - name: fm-etc + mountPath: /etc/fm/api-paste.ini + subPath: api-paste.ini + readOnly: true + - name: fm-etc + mountPath: /etc/fm/fm.conf + subPath: fm.conf + readOnly: true + - name: fm-etc-event + mountPath: /etc/fm/events.yaml + readOnly: true + command: + - /tmp/fm-rest-api.sh + image: "{{ .Values.images.tags.fm_rest_api }}" + imagePullPolicy: {{ .Values.images.pullPolicy }} + ports: + - name: http + containerPort: 18003 + protocol: TCP + resources: +{{ toYaml .Values.resources | indent 12 }} + nodeSelector: + {{ .Values.labels.fm_api.node_selector_key }}: {{ .Values.labels.fm_api.node_selector_value }} + affinity: + {{ tuple $envAll "fm-rest-api" "fm" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} + {{- with .Values.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} + {{- end }} + volumes: + - name: fm-etc + secret: + secretName: fm-etc + defaultMode: 0644 + - name: fm-bin + configMap: + name: fm-bin + defaultMode: 0755 + - name: fm-etc-event + hostPath: + path: /etc/fm/events.yaml + type: File +{{- end }} diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/ingress.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/ingress.yaml new file mode 100755 index 0000000..cba6d0d --- /dev/null +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/ingress.yaml @@ -0,0 +1,10 @@ +{{/* +# +# SPDX-License-Identifier: Apache-2.0 +# +*/}} + +{{- if and .Values.manifests.ingress .Values.network.alarming.ingress.public }} +{{- $ingressOpts := dict "envAll" . "backendService" "alarming" "backendServiceType" "alarming" "backendPort" "fm-port" -}} +{{ $ingressOpts | include "helm-toolkit.manifests.ingress" }} +{{- 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 new file mode 100755 index 0000000..e9cc111 --- /dev/null +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-db-drop.yaml @@ -0,0 +1,10 @@ +{{/* +# +# SPDX-License-Identifier: Apache-2.0 +# +*/}} + +{{- if .Values.manifests.job_db_drop }} +{{- $dbDropJob := dict "envAll" . "serviceName" "fm" -}} +{{ $dbDropJob | include "helm-toolkit.manifests.job_db_drop_mysql" }} +{{- 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 new file mode 100755 index 0000000..50e6310 --- /dev/null +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-db-init.yaml @@ -0,0 +1,10 @@ +{{/* +# +# SPDX-License-Identifier: Apache-2.0 +# +*/}} + +{{- if .Values.manifests.job_db_init }} +{{- $dbInitJob := dict "envAll" . "serviceName" "fm" -}} +{{ $dbInitJob | include "helm-toolkit.manifests.job_db_init_mysql" }} +{{- 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 new file mode 100755 index 0000000..07de48f --- /dev/null +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-db-sync.yaml @@ -0,0 +1,10 @@ +{{/* +# +# SPDX-License-Identifier: Apache-2.0 +# +*/}} + +{{- if .Values.manifests.job_db_sync }} +{{- $dbSyncJob := dict "envAll" . "serviceName" "fm" -}} +{{ $dbSyncJob | include "helm-toolkit.manifests.job_db_sync" }} +{{- 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 new file mode 100755 index 0000000..7f15924 --- /dev/null +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-ks-endpoints.yaml @@ -0,0 +1,10 @@ +{{/* +# +# SPDX-License-Identifier: Apache-2.0 +# +*/}} + +{{- if .Values.manifests.job_ks_endpoints }} +{{- $ksServiceJob := dict "envAll" . "serviceName" "fm" "serviceTypes" ( tuple "alarming" ) -}} +{{ $ksServiceJob | include "helm-toolkit.manifests.job_ks_endpoints" }} +{{- end }} 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 new file mode 100755 index 0000000..f4cdf9a --- /dev/null +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-ks-service.yaml @@ -0,0 +1,10 @@ +{{/* +# +# SPDX-License-Identifier: Apache-2.0 +# +*/}} + +{{- if .Values.manifests.job_ks_service }} +{{- $ksServiceJob := dict "envAll" . "serviceName" "fm" "serviceTypes" ( tuple "alarming" ) -}} +{{ $ksServiceJob | include "helm-toolkit.manifests.job_ks_service" }} +{{- end }} 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 new file mode 100755 index 0000000..4506e41 --- /dev/null +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/job-ks-user.yaml @@ -0,0 +1,10 @@ +{{/* +# +# SPDX-License-Identifier: Apache-2.0 +# +*/}} + +{{- if .Values.manifests.job_ks_user }} +{{- $ksUserJob := dict "envAll" . "serviceName" "fm" -}} +{{ $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 new file mode 100755 index 0000000..8ba79d7 --- /dev/null +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/secret-db.yaml @@ -0,0 +1,20 @@ +{{/* +# +# SPDX-License-Identifier: Apache-2.0 +# +*/}} + +{{- if .Values.manifests.secret_db }} +{{- $envAll := . }} +{{- range $key1, $userClass := tuple "admin" "fm" }} +{{- $secretName := index $envAll.Values.secrets.oslo_db $userClass }} +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ $secretName }} +type: Opaque +data: + DB_CONNECTION: {{ tuple "oslo_db" "internal" $userClass "mysql" $envAll | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" | b64enc -}} +{{- end }} +{{- end }} diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/secret-keystone.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/secret-keystone.yaml new file mode 100755 index 0000000..dd9e0ae --- /dev/null +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/secret-keystone.yaml @@ -0,0 +1,20 @@ +{{/* +# +# SPDX-License-Identifier: Apache-2.0 +# +*/}} + +{{- if .Values.manifests.secret_keystone }} +{{- $envAll := . }} +{{- range $key1, $userClass := tuple "admin" "fm" }} +{{- $secretName := index $envAll.Values.secrets.identity $userClass }} +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ $secretName }} +type: Opaque +data: +{{- tuple $userClass "internal" $envAll | include "helm-toolkit.snippets.keystone_secret_openrc" | indent 2 -}} +{{- end }} +{{- end }} diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/service.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/service.yaml new file mode 100755 index 0000000..113bb9b --- /dev/null +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/service.yaml @@ -0,0 +1,29 @@ +{{/* +# +# SPDX-License-Identifier: Apache-2.0 +# +*/}} + +{{- if .Values.manifests.service_fm }} +{{- $envAll := . }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ tuple "alarming" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }} +spec: + ports: + - name: fm-port + port: {{ .Values.network.alarming.port }} + {{ if .Values.network.alarming.node_port.enabled }} + nodePort: {{ .Values.network.alarming.node_port.port }} + {{ end }} + selector: +{{ tuple $envAll "fm-rest-api" "fm" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} + {{ if .Values.network.alarming.node_port.enabled }} + type: NodePort + {{ if .Values.network.alarming.external_policy_local }} + externalTrafficPolicy: Local + {{ end }} + {{ end }} +{{- end }} diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml new file mode 100644 index 0000000..b3c79f9 --- /dev/null +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml @@ -0,0 +1,306 @@ +# +# SPDX-License-Identifier: Apache-2.0 +# + +# Default values for fm-rest-api. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +labels: + fm_api: + node_selector_key: openstack-control-plane + node_selector_value: enabled + job: + node_selector_key: openstack-control-plane + node_selector_value: enabled + +images: + tags: + fm_rest_api: docker.io/starlingx/stx-fm-rest-api:master-centos-stable-latest + ks_user: docker.io/starlingx/stx-heat:master-centos-stable-latest + ks_service: docker.io/starlingx/stx-heat:master-centos-stable-latest + ks_endpoints: docker.io/starlingx/stx-heat:master-centos-stable-latest + fm_db_sync: docker.io/starlingx/stx-fm-rest-api:master-centos-stable-latest + db_init: docker.io/starlingx/stx-heat:master-centos-stable-latest + db_drop: docker.io/starlingx/stx-heat:master-centos-stable-latest + dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.3.1 + pullPolicy: IfNotPresent + local_registry: + active: false + +nameOverride: "" +fullnameOverride: "" + +network: + alarming: + ingress: + public: true + classes: + namespace: "nginx" + cluster: "nginx-cluster" + annotations: + nginx.ingress.kubernetes.io/rewrite-target: / + port: 18003 + node_port: + enabled: false + port: 30083 + external_policy_local: false + +ingress: + enabled: false + annotations: {} + paths: [] + hosts: + - fm-rest-api + tls: [] + +conf: + paste: + app:api_v1: + paste.app_factory: fm.api.app:app_factory + filter:authtoken: + acl_public_routes: /, /v1 + paste.filter_factory: fm.api.middleware.auth_token:AuthTokenMiddleware.factory + filter:request_id: + paste.filter_factory: oslo_middleware:RequestId.factory + pipeline:fm-api: + pipeline: request_id authtoken api_v1 + + fm: + DEFAULT: + use_syslog: True + syslog_log_facility: local2 + trap_destinations: + region_name: RegionOne + event_log_max_size: 4000 + database: + idle_timeout: 60 + max_pool_size: 1 + max_overflow: 20 + oslo_middleware: + enable_proxy_headers_parsing: True + keystone_authtoken: + auth_type: password + auth_version: v3 + sysinv: + catalog_info: platform:sysinv:internalURL + os_region_name: RegionOne + api: + api_paste_config: /etc/fm/api-paste.ini + api_workers: 2 + bind_port: 18003 + +dependencies: + static: + fmapi: + jobs: + - fm-ks-user + - fm-ks-service + - fm-ks-endpoints + - fm-db-sync + services: + - endpoint: internal + service: identity + - endpoint: internal + service: oslo_db + ks_endpoints: + jobs: + - fm-ks-user + - fm-ks-service + services: + - endpoint: internal + service: identity + db_drop: + services: + - endpoint: internal + service: oslo_db + db_init: + services: + - endpoint: internal + service: oslo_db + db_sync: + jobs: + - fm-db-init + services: + - endpoint: internal + service: oslo_db + +manifests: + configmap_bin: true + configmap_etc: true + deployment_fm_rest_api: true + ingress: true + job_ks_endpoints: true + job_db_init: true + job_db_sync: true + job_db_drop: false + job_ks_user: true + job_ks_service: true + secret_db: true + secret_ingress_tls: false + secret_keystone: true + service_fm: true +endpoints: + cluster_domain_suffix: cluster.local + oslo_db: + auth: + admin: + username: root + password: password + fm: + username: fm + password: password + hosts: + default: mariadb + host_fqdn_override: + default: null + path: /fm + scheme: mysql+pymysql + port: + mysql: + default: 3306 + local_image_registry: + name: docker-registry + namespace: docker-registry + hosts: + default: localhost + internal: docker-registry + node: localhost + host_fqdn_override: + default: null + port: + registry: + node: 5000 + identity: + name: keystone + auth: + admin: + region_name: RegionOne + username: admin + password: password + project_name: admin + user_domain_name: default + project_domain_name: default + fm: + role: admin + region_name: RegionOne + username: fm + password: password + project_name: service + user_domain_name: service + project_domain_name: service + hosts: + default: keystone-api + public: keystone + host_fqdn_override: + default: null + path: + default: /v3 + scheme: + default: http + port: + api: + default: 80 + internal: 5000 + alarming: + name: fm + hosts: + default: fm-rest-api + public: fm + host_fqdn_override: + default: null + path: + default: "/v1" + scheme: + default: 'http' + port: + api: + default: 18003 + public: 80 +pod: + user: + fm_rest_api: + uid: 42424 + affinity: + anti: + type: + default: preferredDuringSchedulingIgnoredDuringExecution + topologyKey: + default: kubernetes.io/hostname + mounts: + fm_rest_api: + init_container: null + fm_rest_api: + replicas: + api: 2 + lifecycle: + upgrades: + deployments: + revision_history: 3 + pod_replacement_strategy: RollingUpdate + rolling_update: + max_unavailable: 1 + max_surge: 3 + daemonsets: + pod_replacement_strategy: RollingUpdate + compute: + enabled: true + min_ready_seconds: 0 + max_unavailable: 1 + disruption_budget: + fm: + min_available: 0 + termination_grace_period: + fm: + timeout: 30 + resources: + jobs: + ks_endpoints: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + db_init: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + db_sync: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + db_drop: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + +secrets: + identity: + admin: fm-keystone-admin + fm: fm-keystone-user + oslo_db: + admin: fm-db-admin + fm: fm-db-user + tls: + alarming: + fm_api: + public: fm-rest-api-tls-public + + +resources: {} + +nodeSelector: {} + +tolerations: [] + +affinity: {} From 3f9413d0c2a4d650084e5bf773416dc5d877ba58 Mon Sep 17 00:00:00 2001 From: Sun Austin Date: Mon, 27 May 2019 15:16:01 +0800 Subject: [PATCH 3/7] change fm-rest-api helm endpoint service type to 'faultmanagement' container fm-rest-api endpoint service type should be same as platform fm-rest-api endpoint service type. Story: 2004008 Task: 33501 Change-Id: Iccb0f0544f388ca51f015c6b11e49f8058db4829 Signed-off-by: Sun Austin --- .../helm-charts/fm-rest-api/templates/ingress.yaml | 4 ++-- .../fm-rest-api/templates/job-ks-endpoints.yaml | 2 +- .../fm-rest-api/templates/job-ks-service.yaml | 2 +- .../helm-charts/fm-rest-api/templates/service.yaml | 12 ++++++------ .../fm-rest-api/helm-charts/fm-rest-api/values.yaml | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/ingress.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/ingress.yaml index cba6d0d..723a27b 100755 --- a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/ingress.yaml +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/ingress.yaml @@ -4,7 +4,7 @@ # */}} -{{- if and .Values.manifests.ingress .Values.network.alarming.ingress.public }} -{{- $ingressOpts := dict "envAll" . "backendService" "alarming" "backendServiceType" "alarming" "backendPort" "fm-port" -}} +{{- if and .Values.manifests.ingress .Values.network.faultmanagement.ingress.public }} +{{- $ingressOpts := dict "envAll" . "backendService" "faultmanagement" "backendServiceType" "faultmanagement" "backendPort" "fm-port" -}} {{ $ingressOpts | include "helm-toolkit.manifests.ingress" }} {{- 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 7f15924..f9b67a2 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 @@ -5,6 +5,6 @@ */}} {{- if .Values.manifests.job_ks_endpoints }} -{{- $ksServiceJob := dict "envAll" . "serviceName" "fm" "serviceTypes" ( tuple "alarming" ) -}} +{{- $ksServiceJob := dict "envAll" . "serviceName" "fm" "serviceTypes" ( tuple "faultmanagement" ) -}} {{ $ksServiceJob | include "helm-toolkit.manifests.job_ks_endpoints" }} {{- end }} 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 f4cdf9a..74bbd39 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 @@ -5,6 +5,6 @@ */}} {{- if .Values.manifests.job_ks_service }} -{{- $ksServiceJob := dict "envAll" . "serviceName" "fm" "serviceTypes" ( tuple "alarming" ) -}} +{{- $ksServiceJob := dict "envAll" . "serviceName" "fm" "serviceTypes" ( tuple "faultmanagement" ) -}} {{ $ksServiceJob | include "helm-toolkit.manifests.job_ks_service" }} {{- end }} diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/service.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/service.yaml index 113bb9b..ad6a32d 100755 --- a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/service.yaml +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/service.yaml @@ -10,19 +10,19 @@ apiVersion: v1 kind: Service metadata: - name: {{ tuple "alarming" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }} + name: {{ tuple "faultmanagement" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }} spec: ports: - name: fm-port - port: {{ .Values.network.alarming.port }} - {{ if .Values.network.alarming.node_port.enabled }} - nodePort: {{ .Values.network.alarming.node_port.port }} + port: {{ .Values.network.faultmanagement.port }} + {{ if .Values.network.faultmanagement.node_port.enabled }} + nodePort: {{ .Values.network.faultmanagement.node_port.port }} {{ end }} selector: {{ tuple $envAll "fm-rest-api" "fm" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} - {{ if .Values.network.alarming.node_port.enabled }} + {{ if .Values.network.faultmanagement.node_port.enabled }} type: NodePort - {{ if .Values.network.alarming.external_policy_local }} + {{ if .Values.network.faultmanagement.external_policy_local }} externalTrafficPolicy: Local {{ end }} {{ end }} diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml index b3c79f9..4f90925 100644 --- a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml @@ -32,7 +32,7 @@ nameOverride: "" fullnameOverride: "" network: - alarming: + faultmanagement: ingress: public: true classes: @@ -202,7 +202,7 @@ endpoints: api: default: 80 internal: 5000 - alarming: + faultmanagement: name: fm hosts: default: fm-rest-api @@ -292,7 +292,7 @@ secrets: admin: fm-db-admin fm: fm-db-user tls: - alarming: + faultmanagement: fm_api: public: fm-rest-api-tls-public From 39decc0e2dd23a4c31159791aa150a00cb765e8e Mon Sep 17 00:00:00 2001 From: Sun Austin Date: Sun, 26 May 2019 11:09:08 +0800 Subject: [PATCH 4/7] enabling fm containerization log to host log files. This config will enable log output to host /var/log/containers/fm-rest-api-xxx.log Story: 2004008 Task: 33499 Change-Id: I5b4b76af59fd8d87e6874a31fbb43f576c81a526 Signed-off-by: Sun Austin --- .../fm-rest-api/templates/configmap-etc.yaml | 1 + .../fm-rest-api/templates/deployment.yaml | 4 ++ .../helm-charts/fm-rest-api/values.yaml | 50 +++++++++++++++++-- 3 files changed, 52 insertions(+), 3 deletions(-) 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 92cec5e..4ca479f 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 @@ -43,3 +43,4 @@ type: Opaque data: api-paste.ini: {{ include "helm-toolkit.utils.to_ini" .Values.conf.paste | b64enc }} fm.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.fm | b64enc }} + logging.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.logging | b64enc }} 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 59e9165..e05812a 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 @@ -48,6 +48,10 @@ spec: mountPath: /etc/fm/fm.conf subPath: fm.conf readOnly: true + - name: fm-etc + mountPath: /etc/fm/logging.conf + subPath: logging.conf + readOnly: true - name: fm-etc-event mountPath: /etc/fm/events.yaml readOnly: true diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml index b3c79f9..611b97c 100644 --- a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml @@ -68,8 +68,7 @@ conf: fm: DEFAULT: - use_syslog: True - syslog_log_facility: local2 + log_config_append: /etc/fm/logging.conf trap_destinations: region_name: RegionOne event_log_max_size: 4000 @@ -89,7 +88,52 @@ conf: api_paste_config: /etc/fm/api-paste.ini api_workers: 2 bind_port: 18003 - + logging: + loggers: + keys: + - root + - fm + handlers: + keys: + - stdout + - stderr + - "null" + formatters: + keys: + - context + - default + logger_root: + level: WARNING + handlers: 'null' + logger_fm: + level: INFO + handlers: + - stdout + qualname: fm + logger_eventletwsgi: + level: WARNING + handlers: stderr + qualname: eventlet.wsgi.server + logger_sqlalchemy: + level: WARNING + handlers: stderr + qualname: sqlalchemy + handler_null: + class: logging.NullHandler + formatter: default + args: () + handler_stdout: + class: StreamHandler + args: (sys.stdout,) + formatter: context + handler_stderr: + class: StreamHandler + args: (sys.stderr,) + formatter: context + formatter_context: + class: oslo_log.formatters.ContextFormatter + formatter_default: + format: "%(message)s" dependencies: static: fmapi: From 3b9aee8abc174adc50e308e9e395c60010259a15 Mon Sep 17 00:00:00 2001 From: Sun Austin Date: Fri, 31 May 2019 09:45:39 +0800 Subject: [PATCH 5/7] Fix fm-rest-api pod crash when starting on 1st time 1) add '---' in Deployment yaml to support multi resources types. 2) change Deployment apiVersion to 'apps/v1'. 3) set serviceaccount name to 'fm' to be same as db-init etc jobs. 4) add job ks_service and ks_user dependencies. Change-Id: I3b15da621dd5a5cc1f20e9e963abbeba54827592 Closes-Bug: 1831163 Signed-off-by: Sun Austin --- .../fm-rest-api/templates/deployment.yaml | 16 ++++++++-------- .../fm-rest-api/templates/service.yaml | 2 +- .../helm-charts/fm-rest-api/values.yaml | 8 ++++++++ 3 files changed, 17 insertions(+), 9 deletions(-) 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 e05812a..07db14d 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 @@ -10,29 +10,29 @@ {{- $mounts_fm_rest_api := .Values.pod.mounts.fm_rest_api.fm_rest_api }} {{- $mounts_fm_rest_api_init := .Values.pod.mounts.fm_rest_api.init_container }} -{{- $serviceAccountName := "fm-rest-api" }} +{{- $serviceAccountName := "fm" }} {{ tuple $envAll "fmapi" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} - -apiVersion: apps/v1beta2 +--- +apiVersion: apps/v1 kind: Deployment metadata: name: fm-rest-api labels: -{{ tuple $envAll "fm-rest-api" "fm" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} +{{ tuple $envAll "fm" "fmapi" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: replicas: {{ .Values.pod.replicas.api }} selector: matchLabels: -{{ tuple $envAll "fm-rest-api" "fm" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} +{{ tuple $envAll "fm" "fmapi" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} {{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: -{{ tuple $envAll "fm-rest-api" "fm" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} +{{ tuple $envAll "fm" "fmapi" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} spec: serviceAccountName: {{ $serviceAccountName }} initContainers: -{{ tuple $envAll "api" $mounts_fm_rest_api_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "fmapi" $mounts_fm_rest_api_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: fm-rest-api volumeMounts: @@ -68,7 +68,7 @@ spec: nodeSelector: {{ .Values.labels.fm_api.node_selector_key }}: {{ .Values.labels.fm_api.node_selector_value }} affinity: - {{ tuple $envAll "fm-rest-api" "fm" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} + {{ tuple $envAll "fm" "fmapi" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} {{- with .Values.tolerations }} tolerations: {{ toYaml . | indent 8 }} diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/service.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/service.yaml index ad6a32d..a131d8f 100755 --- a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/service.yaml +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/service.yaml @@ -19,7 +19,7 @@ spec: nodePort: {{ .Values.network.faultmanagement.node_port.port }} {{ end }} selector: -{{ tuple $envAll "fm-rest-api" "fm" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} +{{ tuple $envAll "fm" "fmapi" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} {{ if .Values.network.faultmanagement.node_port.enabled }} type: NodePort {{ if .Values.network.faultmanagement.external_policy_local }} diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml index 028c954..6a49abd 100644 --- a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml @@ -168,6 +168,14 @@ dependencies: services: - endpoint: internal service: oslo_db + ks_service: + services: + - endpoint: internal + service: identity + ks_user: + services: + - endpoint: internal + service: identity manifests: configmap_bin: true From f21fa9d263974e5ce963ed25dd33fb947bada3d6 Mon Sep 17 00:00:00 2001 From: Sun Austin Date: Mon, 10 Jun 2019 11:12:43 +0800 Subject: [PATCH 6/7] containerized fm public endpoint can not be accessed http://fm.openstack.svc.cluster.local:80 can not be accessed The ingress service is missing in helm chart Closes-Bug: 1832155 Change-Id: I61ea514d3092e1e3fedcd8ca8001a178d65282a3 Signed-off-by: Sun Austin --- .../templates/service-ingress.yaml | 21 +++++++++++++++++++ .../helm-charts/fm-rest-api/values.yaml | 1 + 2 files changed, 22 insertions(+) create mode 100644 fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/service-ingress.yaml diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/service-ingress.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/service-ingress.yaml new file mode 100644 index 0000000..64ea3b9 --- /dev/null +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/service-ingress.yaml @@ -0,0 +1,21 @@ +{{/* +Copyright 2017 The Openstack-Helm Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/}} + +{{- if and .Values.manifests.service_ingress .Values.network.faultmanagement.ingress.public }} +{{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "faultmanagement" -}} +{{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }} +{{- end }} + diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml index 6a49abd..37f8dde 100644 --- a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml @@ -192,6 +192,7 @@ manifests: secret_ingress_tls: false secret_keystone: true service_fm: true + service_ingress: true endpoints: cluster_domain_suffix: cluster.local oslo_db: From 66c687a618ec72ca4475014a3ae035588af97918 Mon Sep 17 00:00:00 2001 From: Mario Alfredo Carrillo Arevalo Date: Thu, 20 Jun 2019 01:44:57 +0000 Subject: [PATCH 7/7] Remove V1 from FM endpoint This change is required to enable the FM panels in the containerized horizon. The fmclient dependency used by the back-end already includes the reference to "v1". Then "v1" should not be part of the endpoint. Story: 2004008 Task: 34183 Change-Id: Ibe92d942b2847ef6d9271595fcc9ac2faad2fb13 Co-authored-by: Sun Austin Signed-off-by: Mario Alfredo Carrillo Arevalo --- fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml index 37f8dde..d307f6e 100644 --- a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml @@ -263,7 +263,7 @@ endpoints: host_fqdn_override: default: null path: - default: "/v1" + default: null scheme: default: 'http' port: