From d68f2e965abec2c1078a9c62a9dc27a16e1d359d Mon Sep 17 00:00:00 2001 From: Zhe Huang Date: Wed, 8 Jan 2020 13:48:40 -0500 Subject: [PATCH] Add support for multiple e2term Signed-off-by: Zhe Huang Change-Id: I7b64124f2e5ab3ccc1bbd2f7a3e8d0a8bec17ab3 --- example_recipe.yaml | 32 +++--- helm/e2term/resources/configfile.properties | 12 +-- helm/e2term/resources/pizpub.crontab | 2 +- helm/e2term/templates/configmap-pizpub.yaml | 16 ++- helm/e2term/templates/configmap.yaml | 119 +++++++++++++++------ helm/e2term/templates/deployment.yaml | 89 ++++++++------- helm/e2term/templates/env.yaml | 30 ++++-- helm/e2term/templates/{e2term-pv.yaml => pv.yaml} | 19 +++- .../e2term/templates/{e2term-pvc.yaml => pvc.yaml} | 16 ++- helm/e2term/templates/service-rmr.yaml | 36 ++++--- helm/e2term/values.yaml | 58 ++++++---- 11 files changed, 275 insertions(+), 154 deletions(-) rename helm/e2term/templates/{e2term-pv.yaml => pv.yaml} (77%) rename helm/e2term/templates/{e2term-pvc.yaml => pvc.yaml} (79%) diff --git a/example_recipe.yaml b/example_recipe.yaml index 9738470..4d0824d 100644 --- a/example_recipe.yaml +++ b/example_recipe.yaml @@ -88,20 +88,28 @@ e2mgr: RIC_ID: "bbbccc-abcd0e/20" + e2term: - image: - name: ric-plt-e2 - tag: 3.0.1 + alpha: + imagePullPolicy: IfNotPresent + image: + name: ric-plt-e2 + tag: 3.0.1 + registry: "nexus3.o-ran-sc.org:10004" - privilegedmode: false - hostnetworkmode: false - env: - print: "1" - messagecollectorfile: "/data/outgoing/" - dataVolSize: 100Mi - storageClassName: local-storage - pizpub: - enabled: false + privilegedmode: false + hostnetworkmode: false + + replicaCount: 1 + env: + print: "1" + messagecollectorfile: "/data/outgoing/" + + dataVolSize: 100Mi + storageClassName: local-storage + + pizpub: + enabled: false jaegeradapter: diff --git a/helm/e2term/resources/configfile.properties b/helm/e2term/resources/configfile.properties index f83a815..0155202 100644 --- a/helm/e2term/resources/configfile.properties +++ b/helm/e2term/resources/configfile.properties @@ -1,18 +1,18 @@ Processors: pub pub.Class: com.att.research.basin.pubsubx.Publisher pub.Threads: 2 -pub.PublishURL: {{ .Values.e2term.pizpub.publishURL }} -pub.User: {{ .Values.e2term.pizpub.user }} -pub.Password: {{ .Values.e2term.pizpub.password }} -pub.meta.feed_id: {{ .Values.e2term.pizpub.feedId }} +pub.PublishURL: {{ .pizpub.publishURL }} +pub.User: {{ .pizpub.user }} +pub.Password: {{ .pizpub.password }} +pub.meta.feed_id: {{ .pizpub.feedId }} pub.meta.version: 1 pub.meta.splits: 1 Factories: scanner scanner.Class: com.att.research.basin.pubsubx.FileScanner scanner.Destination: pub -scanner.Directory: {{ .Values.e2term.pizpub.dataRootDir }}/{{ .Values.e2term.pizpub.scanDirectory }} +scanner.Directory: {{ .pizpub.dataRootDir }}/{{ .pizpub.scanDirectory }} scanner.MinAgeSeconds: 10 scanner.ScanIntervalSeconds: 10 scanner.DeleteOrGZip: delete -scanner.LinkDirectory: {{ .Values.e2term.pizpub.dataRootDir }}/{{ .Values.e2term.pizpub.processedDirectory }} +scanner.LinkDirectory: {{ .pizpub.dataRootDir }}/{{ .pizpub.processedDirectory }} scanner.meta.record_count: countNewLines diff --git a/helm/e2term/resources/pizpub.crontab b/helm/e2term/resources/pizpub.crontab index a798dfe..a41b109 100644 --- a/helm/e2term/resources/pizpub.crontab +++ b/helm/e2term/resources/pizpub.crontab @@ -15,4 +15,4 @@ ################################################################################ # -0 * * * * find {{ .Values.dataRootDir }}/{{ .Values.processedDirectory }} -type f -mtime +3 -delete +0 * * * * find {{ .pizpub.dataRootDir }}/{{ .pizpub.processedDirectory }} -type f -mtime +3 -delete diff --git a/helm/e2term/templates/configmap-pizpub.yaml b/helm/e2term/templates/configmap-pizpub.yaml index a669834..5ef9cb5 100644 --- a/helm/e2term/templates/configmap-pizpub.yaml +++ b/helm/e2term/templates/configmap-pizpub.yaml @@ -13,12 +13,20 @@ # See the License for the specific language governing permissions and # # limitations under the License. # ################################################################################ -{{ if .Values.e2term.pizpub.enabled }} +{{- $topCtx := . }} +{{- range keys .Values.e2term }} +{{- $key := . }} +{{- with index $topCtx.Values.e2term . }} + +{{ if .pizpub.enabled }} apiVersion: v1 kind: ConfigMap metadata: - name: {{ include "common.configmapname.e2term" . }}-pizpub - namespace: {{ include "common.namespace.platform" . }} + name: {{ include "common.configmapname.e2term" $topCtx }}-pizpub-{{ $key }} + namespace: {{ include "common.namespace.platform" $topCtx }} data: -{{ tpl (.Files.Glob "resources/*").AsConfig . | indent 2 }} +{{ tpl ($topCtx.Files.Glob "resources/*").AsConfig $topCtx | indent 2 }} + {{ end }} +{{- end }} +{{- end }} diff --git a/helm/e2term/templates/configmap.yaml b/helm/e2term/templates/configmap.yaml index 316a64e..2ca8d78 100644 --- a/helm/e2term/templates/configmap.yaml +++ b/helm/e2term/templates/configmap.yaml @@ -14,46 +14,101 @@ # See the License for the specific language governing permissions and # # limitations under the License. # ################################################################################ +{{- $topCtx := . }} --- apiVersion: v1 kind: ConfigMap metadata: - name: {{ include "common.configmapname.e2term" . }}-router-configmap - namespace: {{ include "common.namespace.platform" . }} + name: {{ include "common.configmapname.e2term" $topCtx }}-router-configmap + namespace: {{ include "common.namespace.platform" $topCtx }} data: rmr_verbose: | 0 router.txt: | newrt|start - rte|1080|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:{{ include "common.serviceport.e2mgr.rmr.data" . }} - rte|1090|{{ include "common.servicename.e2term.rmr" . }}.{{ include "common.namespace.platform" . }}:{{ include "common.serviceport.e2term.rmr.data" . }} - rte|1100|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:{{ include "common.serviceport.e2mgr.rmr.data" . }} - rte|10020|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:{{ include "common.serviceport.e2mgr.rmr.data" . }} - rte|10060|{{ include "common.servicename.e2term.rmr" . }}.{{ include "common.namespace.platform" . }}:{{ include "common.serviceport.e2term.rmr.data" . }} - rte|10061|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:{{ include "common.serviceport.e2mgr.rmr.data" . }} - rte|10062|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:{{ include "common.serviceport.e2mgr.rmr.data" . }} - rte|10030|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:{{ include "common.serviceport.e2mgr.rmr.data" . }} - rte|10070|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:{{ include "common.serviceport.e2mgr.rmr.data" . }} - rte|10071|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:{{ include "common.serviceport.e2mgr.rmr.data" . }} - rte|10080|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:{{ include "common.serviceport.e2mgr.rmr.data" . }} - rte|10091|{{ include "common.servicename.rsm.rmr" . }}.{{ include "common.namespace.platform" . }}:{{ include "common.serviceport.rsm.rmr.data" . }} - rte|10092|{{ include "common.servicename.rsm.rmr" . }}.{{ include "common.namespace.platform" . }}:{{ include "common.serviceport.rsm.rmr.data" . }} - rte|10360|{{ include "common.servicename.e2term.rmr" . }}.{{ include "common.namespace.platform" . }}:{{ include "common.serviceport.e2term.rmr.data" . }} - rte|10361|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:{{ include "common.serviceport.e2mgr.rmr.data" . }} - rte|10362|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:{{ include "common.serviceport.e2mgr.rmr.data" . }} - rte|10370|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:{{ include "common.serviceport.e2mgr.rmr.data" . }} - rte|10371|{{ include "common.servicename.e2term.rmr" . }}.{{ include "common.namespace.platform" . }}:{{ include "common.serviceport.e2term.rmr.data" . }} - rte|12010|{{ include "common.servicename.e2term.rmr" . }}.{{ include "common.namespace.platform" . }}:{{ include "common.serviceport.e2term.rmr.data" . }} - rte|12020|{{ include "common.servicename.e2term.rmr" . }}.{{ include "common.namespace.platform" . }}:{{ include "common.serviceport.e2term.rmr.data" . }} - rte|20001|{{ include "common.servicename.a1mediator.rmr" . }}.{{ include "common.namespace.platform" . }}:{{ include "common.serviceport.a1mediator.rmr.data" . }} - rte|12011|service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" . }}:4560;service-admission-ctrl-xapp-rmr.{{ include "common.namespace.xapp" . }}:4560 - rte|12050|service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" . }}:4560;service-admission-ctrl-xapp-rmr.{{ include "common.namespace.xapp" . }}:4560 - rte|12012|service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" . }}:4560;service-admission-ctrl-xapp-rmr.{{ include "common.namespace.xapp" . }}:4560 - rte|12021|service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" . }}:4560;service-admission-ctrl-xapp-rmr.{{ include "common.namespace.xapp" . }}:4560 - rte|12022|service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" . }}:4560;service-admission-ctrl-xapp-rmr.{{ include "common.namespace.xapp" . }}:4560 - rte|12041|service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" . }}:4560;service-admission-ctrl-xapp-rmr.{{ include "common.namespace.xapp" . }}:4560 - rte|12042|service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" . }}:4560;service-admission-ctrl-xapp-rmr.{{ include "common.namespace.xapp" . }}:4560 - rte|12050|service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" . }}:4560;service-admission-ctrl-xapp-rmr.{{ include "common.namespace.xapp" . }}:4560 - rte|20000|service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" . }}:4560;service-admission-ctrl-xapp-rmr.{{ include "common.namespace.xapp" . }}:4560 + rte|1080|{{ include "common.servicename.e2mgr.rmr" $topCtx }}.{{ include "common.namespace.platform" $topCtx }}:{{ include "common.serviceport.e2mgr.rmr.data" $topCtx }} + rte|1090| +{{- $frist := true -}} +{{- range keys .Values.e2term -}} +{{- if $frist -}} +{{- $frist = false -}} +{{- else -}} +; +{{- end -}} +{{ include "common.servicename.e2term.rmr" $topCtx }}-{{ . }}.{{ include "common.namespace.platform" $topCtx }}:{{ include "common.serviceport.e2term.rmr.data" $topCtx }} +{{- end }} + rte|1100|{{ include "common.servicename.e2mgr.rmr" $topCtx }}.{{ include "common.namespace.platform" $topCtx }}:{{ include "common.serviceport.e2mgr.rmr.data" $topCtx }} + rte|10020|{{ include "common.servicename.e2mgr.rmr" $topCtx }}.{{ include "common.namespace.platform" $topCtx }}:{{ include "common.serviceport.e2mgr.rmr.data" $topCtx }} + rte|10060| +{{- $frist := true -}} +{{- range keys .Values.e2term -}} +{{- if $frist -}} +{{- $frist = false -}} +{{- else -}} +; +{{- end -}} +{{ include "common.servicename.e2term.rmr" $topCtx }}-{{ . }}.{{ include "common.namespace.platform" $topCtx }}:{{ include "common.serviceport.e2term.rmr.data" $topCtx }} +{{- end }} + rte|10061|{{ include "common.servicename.e2mgr.rmr" $topCtx }}.{{ include "common.namespace.platform" $topCtx }}:{{ include "common.serviceport.e2mgr.rmr.data" $topCtx }} + rte|10062|{{ include "common.servicename.e2mgr.rmr" $topCtx }}.{{ include "common.namespace.platform" $topCtx }}:{{ include "common.serviceport.e2mgr.rmr.data" $topCtx }} + rte|10030|{{ include "common.servicename.e2mgr.rmr" $topCtx }}.{{ include "common.namespace.platform" $topCtx }}:{{ include "common.serviceport.e2mgr.rmr.data" $topCtx }} + rte|10070|{{ include "common.servicename.e2mgr.rmr" $topCtx }}.{{ include "common.namespace.platform" $topCtx }}:{{ include "common.serviceport.e2mgr.rmr.data" $topCtx }} + rte|10071|{{ include "common.servicename.e2mgr.rmr" $topCtx }}.{{ include "common.namespace.platform" $topCtx }}:{{ include "common.serviceport.e2mgr.rmr.data" $topCtx }} + rte|10080|{{ include "common.servicename.e2mgr.rmr" $topCtx }}.{{ include "common.namespace.platform" $topCtx }}:{{ include "common.serviceport.e2mgr.rmr.data" $topCtx }} + rte|10091|{{ include "common.servicename.rsm.rmr" $topCtx }}.{{ include "common.namespace.platform" $topCtx }}:{{ include "common.serviceport.rsm.rmr.data" $topCtx }} + rte|10092|{{ include "common.servicename.rsm.rmr" $topCtx }}.{{ include "common.namespace.platform" $topCtx }}:{{ include "common.serviceport.rsm.rmr.data" $topCtx }} + rte|10360| +{{- $frist := true -}} +{{- range keys .Values.e2term -}} +{{- if $frist -}} +{{- $frist = false -}} +{{- else -}} +; +{{- end -}} +{{ include "common.servicename.e2term.rmr" $topCtx }}-{{ . }}.{{ include "common.namespace.platform" $topCtx }}:{{ include "common.serviceport.e2term.rmr.data" $topCtx }} +{{- end }} + rte|10361|{{ include "common.servicename.e2mgr.rmr" $topCtx }}.{{ include "common.namespace.platform" $topCtx }}:{{ include "common.serviceport.e2mgr.rmr.data" $topCtx }} + rte|10362|{{ include "common.servicename.e2mgr.rmr" $topCtx }}.{{ include "common.namespace.platform" $topCtx }}:{{ include "common.serviceport.e2mgr.rmr.data" $topCtx }} + rte|10370|{{ include "common.servicename.e2mgr.rmr" $topCtx }}.{{ include "common.namespace.platform" $topCtx }}:{{ include "common.serviceport.e2mgr.rmr.data" $topCtx }} + rte|10371| +{{- $frist := true -}} +{{- range keys .Values.e2term -}} +{{- if $frist -}} +{{- $frist = false -}} +{{- else -}} +; +{{- end -}} +{{ include "common.servicename.e2term.rmr" $topCtx }}-{{ . }}.{{ include "common.namespace.platform" $topCtx }}:{{ include "common.serviceport.e2term.rmr.data" $topCtx }} +{{- end }} + rte|12010| +{{- $frist := true -}} +{{- range keys .Values.e2term -}} +{{- if $frist -}} +{{- $frist = false -}} +{{- else -}} +; +{{- end -}} +{{ include "common.servicename.e2term.rmr" $topCtx }}-{{ . }}.{{ include "common.namespace.platform" $topCtx }}:{{ include "common.serviceport.e2term.rmr.data" $topCtx }} +{{- end }} + rte|12020| +{{- $frist := true -}} +{{- range keys .Values.e2term -}} +{{- if $frist -}} +{{- $frist = false -}} +{{- else -}} +; +{{- end -}} +{{ include "common.servicename.e2term.rmr" $topCtx }}-{{ . }}.{{ include "common.namespace.platform" $topCtx }}:{{ include "common.serviceport.e2term.rmr.data" $topCtx }} +{{- end }} + rte|20001|{{ include "common.servicename.a1mediator.rmr" $topCtx }}.{{ include "common.namespace.platform" $topCtx }}:{{ include "common.serviceport.a1mediator.rmr.data" $topCtx }} + rte|12011|service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" $topCtx }}:4560;service-admission-ctrl-xapp-rmr.{{ include "common.namespace.xapp" $topCtx }}:4560 + rte|12050|service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" $topCtx }}:4560;service-admission-ctrl-xapp-rmr.{{ include "common.namespace.xapp" $topCtx }}:4560 + rte|12012|service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" $topCtx }}:4560;service-admission-ctrl-xapp-rmr.{{ include "common.namespace.xapp" $topCtx }}:4560 + rte|12021|service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" $topCtx }}:4560;service-admission-ctrl-xapp-rmr.{{ include "common.namespace.xapp" $topCtx }}:4560 + rte|12022|service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" $topCtx }}:4560;service-admission-ctrl-xapp-rmr.{{ include "common.namespace.xapp" $topCtx }}:4560 + rte|12041|service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" $topCtx }}:4560;service-admission-ctrl-xapp-rmr.{{ include "common.namespace.xapp" $topCtx }}:4560 + rte|12042|service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" $topCtx }}:4560;service-admission-ctrl-xapp-rmr.{{ include "common.namespace.xapp" $topCtx }}:4560 + rte|12050|service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" $topCtx }}:4560;service-admission-ctrl-xapp-rmr.{{ include "common.namespace.xapp" $topCtx }}:4560 + rte|20000|service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" $topCtx }}:4560;service-admission-ctrl-xapp-rmr.{{ include "common.namespace.xapp" $topCtx }}:4560 newrt|end diff --git a/helm/e2term/templates/deployment.yaml b/helm/e2term/templates/deployment.yaml index c258095..331c156 100644 --- a/helm/e2term/templates/deployment.yaml +++ b/helm/e2term/templates/deployment.yaml @@ -14,45 +14,51 @@ # See the License for the specific language governing permissions and # # limitations under the License. # ################################################################################ -{{- $imagectx := dict "ctx" . "defaultregistry" .Values.e2term.image.registry }} -{{- $pullpolicyctx := dict "ctx" . "defaultpullpolicy" .Values.e2term.imagePullPolicy }} +{{- $topCtx := . }} +{{- range keys .Values.e2term }} +{{- $key := . }} +{{- with index $topCtx.Values.e2term . }} + +{{- $imagectx := dict "ctx" $topCtx "defaultregistry" .image.registry }} +{{- $pullpolicyctx := dict "ctx" $topCtx "defaultpullpolicy" .imagePullPolicy }} +--- apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "common.deploymentname.e2term" . }} - namespace: {{ include "common.namespace.platform" . }} + name: {{ include "common.deploymentname.e2term" $topCtx }}-{{ $key }} + namespace: {{ include "common.namespace.platform" $topCtx }} labels: - app: {{ include "common.namespace.platform" . }}-{{ include "common.name.e2term" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + app: {{ include "common.namespace.platform" $topCtx }}-{{ include "common.name.e2term" $topCtx }} + chart: {{ $topCtx.Chart.Name }}-{{ $topCtx.Chart.Version | replace "+" "_" }} + release: {{ $topCtx.Release.Name }} + heritage: {{ $topCtx.Release.Service }} spec: - replicas: {{ .Values.e2term.replicaCount }} + replicas: {{ .replicaCount }} selector: matchLabels: - app: {{ include "common.namespace.platform" . }}-{{ include "common.name.e2term" . }} - release: {{ .Release.Name }} + app: {{ include "common.namespace.platform" $topCtx }}-{{ include "common.name.e2term" $topCtx }} + release: {{ $topCtx.Release.Name }} template: metadata: - {{- if .Values.e2term.annotations }} + {{- if .annotations }} annotations: - {{- .Values.e2term.annotations | nindent 8 -}} + {{- .annotations | nindent 8 -}} {{ end }} labels: - app: {{ include "common.namespace.platform" . }}-{{ include "common.name.e2term" . }} - release: {{ .Release.Name }} + app: {{ include "common.namespace.platform" $topCtx }}-{{ include "common.name.e2term" $topCtx }} + release: {{ $topCtx.Release.Name }} spec: - hostname: {{ include "common.name.e2term" . }} - hostNetwork: {{ .Values.e2term.hostnetworkmode }} + hostname: {{ include "common.name.e2term" $topCtx }}-{{ $key }} + hostNetwork: {{ .hostnetworkmode }} dnsPolicy: ClusterFirstWithHostNet imagePullSecrets: - name: {{ include "common.dockerregistry.credential" $imagectx }} - {{- with .Values.e2term.nodeselector }} + {{- with .nodeselector }} nodeSelector: {{ toYaml . | trim | nindent 8 -}} {{- end }} containers: - - name: {{ include "common.containername.e2term" . }} - image: {{ include "common.dockerregistry.url" $imagectx }}/{{ .Values.e2term.image.name }}:{{ .Values.e2term.image.tag }} + - name: {{ include "common.containername.e2term" $topCtx }} + image: {{ include "common.dockerregistry.url" $imagectx }}/{{ .image.name }}:{{ .image.tag }} imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $pullpolicyctx }} volumeMounts: - mountPath: /opt/e2/router.txt @@ -61,38 +67,39 @@ spec: - mountPath: /tmp/rmr_verbose name: local-router-file subPath: rmr_verbose -{{ if .Values.e2term.pizpub.enabled }} - - mountPath: "{{ .Values.e2term.env.messagecollectorfile }}" +{{ if .pizpub.enabled }} + - mountPath: "{{ .env.messagecollectorfile }}" name: vol-shared readOnly: false - subPath: "{{ .Values.e2term.pizpub.scanDirectory }}" + subPath: "{{ .pizpub.scanDirectory }}" {{ else }} - - mountPath: "{{ .Values.e2term.env.messagecollectorfile }}" + - mountPath: "{{ .env.messagecollectorfile }}" name: vol-shared readOnly: false {{ end }} envFrom: - configMapRef: - name: {{ include "common.configmapname.e2term" . }}-env + name: {{ include "common.configmapname.e2term" $topCtx }}-env-{{ $key }} ports: - - name: "rmrroute" - containerPort: {{ include "common.serviceport.e2term.rmr.route" . }} - - name: "rmrdata" - containerPort: {{ include "common.serviceport.e2term.rmr.data" . }} + - name: "rmrroute-{{ $key }}" + containerPort: {{ include "common.serviceport.e2term.rmr.route" $topCtx }} + - name: "rmrdata-{{ $key }}" + containerPort: {{ include "common.serviceport.e2term.rmr.data" $topCtx }} stdin: true tty: true securityContext: - privileged: {{ .Values.e2term.privilegedmode }} + privileged: {{ .privilegedmode }} -{{ if .Values.e2term.pizpub.enabled }} - - name: {{ include "common.containername.e2term" . }}-pizpub - image: {{ include "common.repository" . }}/{{ .Values.e2term.pizpub.imageName }}:{{ .Values.e2term.pizpub.imageVersion }} - imagePullPolicy: {{ include "common.pullPolicy" . }} +{{ if .pizpub.enabled }} + - name: {{ include "common.containername.e2term" $topCtx }}-pizpub + {{- $pizpubimagectx := dict "ctx" $topCtx "defaultregistry" .pizpub.image.registry }} + image: {{ include "common.dockerregistry.url" $pizpubimagectx }}/{{ .pizpub.image.name }}:{{ .pizpub.image.tag }} + imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $pullpolicyctx }} volumeMounts: - mountPath: /etc/localtime name: localtime readOnly: true - - mountPath: "{{ .Values.e2term.pizpub.dataRootDir }}" + - mountPath: "{{ .pizpub.dataRootDir }}" name: vol-shared readOnly: false - name: pizpub-config @@ -100,21 +107,23 @@ spec: lifecycle: postStart: exec: - command: ["/bin/sh", "/opt/app/config/conf/cleaner.sh", "{{ .Values.e2term.pizpub.dataRootDir }}/{{ .Values.e2term.pizpub.processedDirectory }}", "3"] + command: ["/bin/sh", "/opt/app/config/conf/cleaner.sh", "{{ .pizpub.dataRootDir }}/{{ .pizpub.processedDirectory }}", "3"] {{ end }} volumes: - name: local-router-file configMap: - name: {{ include "common.configmapname.e2term" . }}-router-configmap -{{ if .Values.e2term.pizpub.enabled }} + name: {{ include "common.configmapname.e2term" $topCtx }}-router-configmap +{{ if .pizpub.enabled }} - name: localtime hostPath: path: /etc/localtime - name: pizpub-config configMap: - name: {{ include "common.configmapname.e2term" . }}-pizpub + name: {{ include "common.configmapname.e2term" $topCtx }}-pizpub-{{ $key }} {{ end }} - name: vol-shared persistentVolumeClaim: - claimName: {{ include "common.pvcname.e2term" . }} + claimName: {{ include "common.pvcname.e2term" $topCtx }}-{{ $key }} +{{- end }} +{{- end }} diff --git a/helm/e2term/templates/env.yaml b/helm/e2term/templates/env.yaml index aa2ae94..89bd26a 100644 --- a/helm/e2term/templates/env.yaml +++ b/helm/e2term/templates/env.yaml @@ -14,20 +14,28 @@ # See the License for the specific language governing permissions and # # limitations under the License. # ################################################################################ +{{- $topCtx := . }} +{{- range keys .Values.e2term }} +{{- $key := . }} +{{- with index $topCtx.Values.e2term . }} +--- apiVersion: v1 kind: ConfigMap metadata: - name: {{ include "common.configmapname.e2term" . }}-env + name: {{ include "common.configmapname.e2term" $topCtx }}-env-{{ $key }} data: - DBAAS_SERVICE_HOST: {{ include "common.servicename.dbaas.tcp" . | quote }} - DBAAS_SERVICE_PORT: {{ include "common.serviceport.dbaas.tcp" . | quote }} - DBAAS_PORT_6379_TCP_ADDR: {{ include "common.servicename.dbaas.tcp" . | quote }} - DBAAS_PORT_6379_TCP_PORT: {{ include "common.serviceport.dbaas.tcp" . | quote }} - RMR_SRC_ID: {{ include "common.servicename.e2term.rmr" . }}.{{ include "common.namespace.platform" . }} - RMR_RTG_SVC: {{ include "common.serviceport.e2term.rmr.route" . | quote }} + DBAAS_SERVICE_HOST: {{ include "common.servicename.dbaas.tcp" $topCtx | quote }} + DBAAS_SERVICE_PORT: {{ include "common.serviceport.dbaas.tcp" $topCtx | quote }} + DBAAS_PORT_6379_TCP_ADDR: {{ include "common.servicename.dbaas.tcp" $topCtx | quote }} + DBAAS_PORT_6379_TCP_PORT: {{ include "common.serviceport.dbaas.tcp" $topCtx | quote }} + RMR_SRC_ID: {{ include "common.servicename.e2term.rmr" $topCtx }}-{{ $key }}.{{ include "common.namespace.platform" $topCtx }} + RMR_RTG_SVC: {{ include "common.serviceport.e2term.rmr.route" $topCtx | quote }} RMR_SEED_RT: "router.txt" RMR_VCTL_FILE: "/tmp/rmr_verbose" - sctp: {{ include "common.serviceport.e2term.sctp" . | quote }} - nano: {{ include "common.serviceport.e2term.rmr.data" . | quote }} - print: "{{ .Values.e2term.env.print }}" - volume: "{{ .Values.e2term.env.messagecollectorfile }}" + sctp: {{ include "common.serviceport.e2term.sctp" $topCtx | quote }} + nano: {{ include "common.serviceport.e2term.rmr.data" $topCtx | quote }} + print: "{{ .env.print }}" + volume: "{{ .env.messagecollectorfile }}" + +{{- end }} +{{- end }} diff --git a/helm/e2term/templates/e2term-pv.yaml b/helm/e2term/templates/pv.yaml similarity index 77% rename from helm/e2term/templates/e2term-pv.yaml rename to helm/e2term/templates/pv.yaml index 2f46132..cf7f970 100644 --- a/helm/e2term/templates/e2term-pv.yaml +++ b/helm/e2term/templates/pv.yaml @@ -13,19 +13,28 @@ # See the License for the specific language governing permissions and # # limitations under the License. # ################################################################################1 -{{if eq .Values.e2term.storageClassName "local-storage" }} +{{- $topCtx := . }} +{{- range keys .Values.e2term }} +{{- $key := . }} +{{- with index $topCtx.Values.e2term . }} + +{{if eq .storageClassName "local-storage" }} +--- apiVersion: v1 kind: PersistentVolume metadata: - name: {{ include "common.pvname.e2term" . }} + name: {{ include "common.pvname.e2term" $topCtx }}-{{ $key }} labels: type: local spec: - storageClassName: {{ .Values.e2term.storageClassName }} + storageClassName: {{ .storageClassName }} capacity: - storage: {{ .Values.e2term.dataVolSize }} + storage: {{ .dataVolSize }} accessModes: - ReadWriteOnce hostPath: - path: /mnt/{{ include "common.pvname.e2term" . }} + path: /mnt/{{ include "common.pvname.e2term" $topCtx }}-{{ $key }} {{ end }} + +{{- end }} +{{- end }} diff --git a/helm/e2term/templates/e2term-pvc.yaml b/helm/e2term/templates/pvc.yaml similarity index 79% rename from helm/e2term/templates/e2term-pvc.yaml rename to helm/e2term/templates/pvc.yaml index df01541..2698d72 100644 --- a/helm/e2term/templates/e2term-pvc.yaml +++ b/helm/e2term/templates/pvc.yaml @@ -13,16 +13,22 @@ # See the License for the specific language governing permissions and # # limitations under the License. # ################################################################################ - +{{- $topCtx := . }} +{{- range keys .Values.e2term }} +{{- $key := . }} +{{- with index $topCtx.Values.e2term . }} +--- kind: PersistentVolumeClaim apiVersion: v1 metadata: - name: {{ include "common.pvcname.e2term" . }} + name: {{ include "common.pvcname.e2term" $topCtx }}-{{ $key }} spec: accessModes: - ReadWriteOnce resources: requests: - storage: {{ .Values.e2term.dataVolSize }} - storageClassName: {{ .Values.e2term.storageClassName }} - #volumeName: {{ include "common.pvname.e2term" . }} + storage: {{ .dataVolSize }} + storageClassName: {{ .storageClassName }} + #volumeName: {{ include "common.pvname.e2term" $topCtx }} +{{- end }} +{{- end }} diff --git a/helm/e2term/templates/service-rmr.yaml b/helm/e2term/templates/service-rmr.yaml index f9443a5..a708dfb 100644 --- a/helm/e2term/templates/service-rmr.yaml +++ b/helm/e2term/templates/service-rmr.yaml @@ -14,28 +14,34 @@ # See the License for the specific language governing permissions and # # limitations under the License. # ################################################################################ - +{{- $topCtx := . }} +{{- range keys .Values.e2term }} +{{- $key := . }} +{{- with index $topCtx.Values.e2term . }} +--- apiVersion: v1 kind: Service metadata: - name: {{ include "common.servicename.e2term.rmr" . }} - namespace: {{ include "common.namespace.platform" . }} + name: {{ include "common.servicename.e2term.rmr" $topCtx }}-{{ $key }} + namespace: {{ include "common.namespace.platform" $topCtx }} labels: - app: {{ include "common.namespace.platform" . }}-{{ include "common.name.e2term" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + app: {{ include "common.namespace.platform" $topCtx }}-{{ include "common.name.e2term" $topCtx }} + chart: {{ $topCtx.Chart.Name }}-{{ $topCtx.Chart.Version | replace "+" "_" }} + release: {{ $topCtx.Release.Name }} + heritage: {{ $topCtx.Release.Service }} spec: type: ClusterIP ports: - - port: {{ include "common.serviceport.e2term.rmr.route" . }} + - port: {{ include "common.serviceport.e2term.rmr.route" $topCtx }} protocol: "TCP" - targetPort: "rmrroute" - name: "rmrroute" - - port: {{ include "common.serviceport.e2term.rmr.data" . }} + targetPort: "rmrroute-{{ $key }}" + name: "rmrroute-{{ $key }}" + - port: {{ include "common.serviceport.e2term.rmr.data" $topCtx }} protocol: "TCP" - targetPort: "rmrdata" - name: "rmrdata" + targetPort: "rmrdata-{{ $key }}" + name: "rmrdata-{{ $key }}" selector: - app: {{ include "common.namespace.platform" . }}-{{ include "common.name.e2term" . }} - release: {{ .Release.Name }} + app: {{ include "common.namespace.platform" $topCtx }}-{{ include "common.name.e2term" $topCtx }} + release: {{ $topCtx.Release.Name }} +{{- end }} +{{- end }} diff --git a/helm/e2term/values.yaml b/helm/e2term/values.yaml index c58fe99..28be9bc 100644 --- a/helm/e2term/values.yaml +++ b/helm/e2term/values.yaml @@ -20,27 +20,39 @@ ################################################################# e2term: - imagePullPolicy: IfNotPresent - image: - name: ric-plt-e2 - tag: 3.0.1 - registry: "nexus3.o-ran-sc.org:10002/o-ran-sc" + alpha: + imagePullPolicy: IfNotPresent + image: + name: ric-plt-e2 + tag: 3.0.1 + registry: "nexus3.o-ran-sc.org:10002/o-ran-sc" + + privilegedmode: false + hostnetworkmode: false - privilegedmode: false - hostnetworkmode: false - - replicaCount: 1 - env: - print: "1" - messagecollectorfile: "/data/outgoing/" - # Service ports are now defined in - # ric-common/Common-Template/helm/ric-common/templates/_ports.tpl file. - # If need to change a service port, make the code change necessary, then - # update the _ports.tpl file with the new port number. - - dataVolSize: 100Mi - storageClassName: local-storage - #storageClassName: ric-storage-class - - pizpub: - enabled: false + replicaCount: 1 + env: + print: "1" + messagecollectorfile: "/data/outgoing/" + # Service ports are now defined in + # ric-common/Common-Template/helm/ric-common/templates/_ports.tpl file. + # If need to change a service port, make the code change necessary, then + # update the _ports.tpl file with the new port number. + + dataVolSize: 100Mi + storageClassName: local-storage + #storageClassName: ric-storage-class + + pizpub: + enabled: false + # publishURL: "" + # user: "" + # password: "" + # feedId: "" + # dataRootDir: "" + # scanDirectory: "" + # processedDirectory: "" + # image: + # name: "" + # tag: "" + # registry: "" -- 2.16.6