[CORD-2909] Flatten and parameterize charts
Change-Id: I695c1df063b0f6f6ccf280254d54cc701292348f
diff --git a/xos-services/openstack/templates/_helpers.tpl b/xos-services/openstack/templates/_helpers.tpl
index b61f963..d0d413a 100644
--- a/xos-services/openstack/templates/_helpers.tpl
+++ b/xos-services/openstack/templates/_helpers.tpl
@@ -45,3 +45,47 @@
{{- define "openstack.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
+
+{{- define "openstack.serviceConfig" -}}
+name: openstack-synchronizer
+accessor:
+ username: {{ .Values.xosAdminUser | quote }}
+ password: {{ .Values.xosAdminPassword | quote }}
+ endpoint: xos-core:50051
+dependency_graph: "/opt/xos/synchronizers/openstack/model-deps"
+steps_dir: "/opt/xos/synchronizers/openstack/steps"
+sys_dir: "/opt/xos/synchronizers/openstack/sys"
+model_policies_dir: "/opt/xos/synchronizers/openstack/model_policies"
+logging:
+ version: 1
+ handlers:
+ console:
+ class: logging.StreamHandler
+ file:
+ class: logging.handlers.RotatingFileHandler
+ filename: /var/log/xos.log
+ maxBytes: 10485760
+ backupCount: 5
+ loggers:
+ 'multistructlog':
+ handlers:
+ - console
+ - file
+ level: DEBUG
+images_directory: "/opt/xos/images"
+required_models:
+ - ControllerImages
+ - ControllerNetwork
+ - ControllerSitePrivilege
+ - ControllerSite
+ - ControllerSlicePrivilege
+ - ControllerSlice
+ - ControllerUser
+ - Image
+ - Instance
+ - Port
+ - Role
+nova:
+ ca_ssl_cert: "/etc/ssl/certs/ca-certificates.crt"
+ enabled: True
+{{- end -}}
diff --git a/xos-services/openstack/templates/configmap.yaml b/xos-services/openstack/templates/configmap.yaml
index 6d234c4..db369de 100644
--- a/xos-services/openstack/templates/configmap.yaml
+++ b/xos-services/openstack/templates/configmap.yaml
@@ -1,5 +1,4 @@
---
-
# Copyright 2018-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,4 +19,4 @@
name: openstack
data:
serviceConfig: |
-{{ toYaml .Values.serviceConfig | indent 4 }}
+{{ include "openstack.serviceConfig" . | indent 4 }}
diff --git a/xos-services/openstack/templates/deployment.yaml b/xos-services/openstack/templates/deployment.yaml
index f202d79..b0270d1 100644
--- a/xos-services/openstack/templates/deployment.yaml
+++ b/xos-services/openstack/templates/deployment.yaml
@@ -39,16 +39,17 @@
spec:
containers:
- name: {{ .Chart.Name }}
- image: "{{ .Values.pull_docker_registry }}{{ .Values.image.repository }}:{{ .Values.image.tag }}"
- imagePullPolicy: {{ .Values.image.pullPolicy }}
+ image: {{ .Values.openstack_synchronizerImage | quote }}
+ imagePullPolicy: {{ .Values.imagePullPolicy }}
resources:
{{ toYaml .Values.resources | indent 12 }}
volumeMounts:
- name: openstack-config
mountPath: /opt/xos/synchronizers/openstack/openstack_config.yaml
subPath: openstack_config.yaml
- - name: cert-chain-secret
- mountPath: /usr/local/share/ca-certificates
+ - name: certchain-volume
+ mountPath: /usr/local/share/ca-certificates/local_certs.crt
+ subPath: config/ca_cert_chain.pem
volumes:
- name: openstack-config
configMap:
@@ -56,9 +57,12 @@
items:
- key: serviceConfig
path: openstack_config.yaml
- - name: cert-chain-secret
- secret:
- secretName: cert-chain-secret
+ - name: certchain-volume
+ configMap:
+ name: ca-certificates
+ items:
+ - key: chain
+ path: config/ca_cert_chain.pem
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}