From 918108f729c368db61fe904024129f21269e19b7 Mon Sep 17 00:00:00 2001 From: Louis Date: Tue, 19 Dec 2023 12:05:56 +0000 Subject: [PATCH] Improve oran_oom helm charts Refactor oran_oom helm charts to utilize common templates and values files Fix ics var data foler perm with init container Fix dmaapmediator by add init container to create topics Move dmaapmediator env var to values file Change-Id: I65ebf62553520458b714c88eb33106ec5503292f Signed-off-by: Louis Li --- smo-install/helm-override/cnf/oran-override.yaml | 40 +++-- .../helm-override/default/oran-override.yaml | 40 +++-- .../pythonsdk-tests/oran-override.yaml | 40 +++-- smo-install/oran_oom/a1controller/Chart.yaml | 2 +- .../a1controller/templates/deployment.yaml | 65 ++------ .../oran_oom/a1controller/templates/service.yaml | 51 +----- smo-install/oran_oom/a1controller/values.yaml | 42 ++--- smo-install/oran_oom/a1simulator/Chart.yaml | 2 +- .../oran_oom/aux-common/templates/_ingress.tpl | 2 +- .../oran_oom/aux-common/templates/_namespace.tpl | 9 +- .../oran_oom/aux-common/templates/_service.tpl | 2 +- .../oran_oom/controlpanel/templates/configmap.yaml | 10 +- .../controlpanel/templates/deployment.yaml | 51 ++---- .../oran_oom/controlpanel/templates/service.yaml | 29 +--- smo-install/oran_oom/controlpanel/values.yaml | 52 ++++--- .../oran_oom/dmaapadapterservice/Chart.yaml | 2 +- .../resources/config/application.yaml | 84 ---------- .../resources/data/application_configuration.json | 14 -- .../dmaapadapterservice/templates/configmap.yaml | 25 +-- .../dmaapadapterservice/templates/service.yaml | 27 +--- .../dmaapadapterservice/templates/statefulset.yaml | 61 ++------ .../oran_oom/dmaapadapterservice/values.yaml | 118 +++++++++++--- .../resources/config/application.yaml | 54 ------- .../resources/data/type_config.json | 13 -- .../resources/dmaap-topic-init.sh} | 19 ++- .../templates/_helpers.tpl} | 41 +++-- .../dmaapmediatorservice/templates/configmap.yaml | 17 +- .../dmaapmediatorservice/templates/service.yaml | 27 +--- .../templates/statefulset.yaml | 141 +++++++---------- .../oran_oom/dmaapmediatorservice/values.yaml | 63 +++++--- smo-install/oran_oom/helmmanager/Chart.yaml | 2 +- .../oran_oom/helmmanager/templates/service.yaml | 22 +-- .../helmmanager/templates/serviceaccount.yaml | 23 ++- .../helmmanager/templates/statefulset.yaml | 60 ++----- smo-install/oran_oom/helmmanager/values.yaml | 41 ++--- smo-install/oran_oom/informationservice/Chart.yaml | 2 +- .../resources/config/application.yaml | 58 ------- .../informationservice/templates/configmap.yaml | 14 +- .../informationservice/templates/ingress.yaml | 15 +- .../informationservice/templates/service.yaml | 27 +--- .../informationservice/templates/statefulset.yaml | 82 ++++------ .../oran_oom/informationservice/values.yaml | 94 ++++++++--- smo-install/oran_oom/nonrtric-common/Chart.yaml | 2 +- .../nonrtric-common/templates/_a1controller.tpl | 24 --- .../templates/{_common.tpl => _configmap.tpl} | 19 ++- .../nonrtric-common/templates/_controlpanel.tpl | 24 --- .../templates/_dmaapadapterservice.tpl | 24 --- .../templates/_dmaapmediatorservice.tpl | 23 --- .../templates/_informationservice.tpl | 22 --- .../{_nonrtricgateway.tpl => _ingress.tpl} | 30 ++-- .../oran_oom/nonrtric-common/templates/_labels.tpl | 105 +++++++++++++ .../oran_oom/nonrtric-common/templates/_name.tpl | 37 +++++ .../nonrtric-common/templates/_namespace.tpl | 26 ++++ .../oran_oom/nonrtric-common/templates/_pods.tpl | 92 +++++++++++ .../templates/_rappcatalogueservice.tpl | 24 --- .../nonrtric-common/templates/_service.tpl | 137 ++++++++++++++++ ...olicymanagementservice.tpl => _statefulset.tpl} | 20 ++- .../oran_oom/nonrtric-common/templates/_utils.tpl | 28 ++++ smo-install/oran_oom/nonrtric-common/values.yaml | 2 +- smo-install/oran_oom/nonrtric/templates/pv1.yaml | 2 +- smo-install/oran_oom/nonrtric/templates/pv2.yaml | 2 +- smo-install/oran_oom/nonrtric/templates/pv3.yaml | 2 +- smo-install/oran_oom/nonrtric/values.yaml | 11 +- smo-install/oran_oom/nonrtricgateway/Chart.yaml | 2 +- .../resources/config/application.yaml | 52 ------- .../nonrtricgateway/templates/configmap.yaml | 14 +- .../nonrtricgateway/templates/deployment.yaml | 56 ++----- .../nonrtricgateway/templates/service.yaml | 22 +-- smo-install/oran_oom/nonrtricgateway/values.yaml | 77 ++++++--- .../oran_oom/odu-app-ics-version/Chart.yaml | 5 + .../odu-app-ics-version/templates/_helpers.tpl | 79 ---------- .../odu-app-ics-version/templates/deployment.yaml | 19 +-- .../odu-app-ics-version/templates/service.yaml | 16 +- .../oran_oom/odu-app-ics-version/values.yaml | 4 +- smo-install/oran_oom/odu-app/Chart.yaml | 5 + .../oran_oom/odu-app/templates/_helpers.tpl | 79 ---------- .../oran_oom/odu-app/templates/deployment.yaml | 24 +-- .../oran_oom/odu-app/templates/service.yaml | 16 +- smo-install/oran_oom/odu-app/values.yaml | 4 +- smo-install/oran_oom/oru-app/Chart.yaml | 5 + .../oran_oom/oru-app/templates/configmap.yaml | 7 +- .../oran_oom/oru-app/templates/configmapenv.yaml | 10 +- .../oran_oom/oru-app/templates/deployment.yaml | 23 +-- .../oran_oom/oru-app/templates/service.yaml | 18 +-- smo-install/oran_oom/oru-app/values.yaml | 3 +- .../oran_oom/policymanagementservice/Chart.yaml | 2 +- .../resources/config/application.yaml | 76 --------- .../resources/data/application_configuration.json | 84 ---------- .../templates/configmap.yaml | 26 +--- .../policymanagementservice/templates/ingress.yaml | 11 +- .../policymanagementservice/templates/service.yaml | 27 +--- .../templates/statefulset.yaml | 85 +++------- .../oran_oom/policymanagementservice/values.yaml | 173 +++++++++++++++++---- .../oran_oom/rappcatalogueservice/Chart.yaml | 2 +- .../rappcatalogueservice/templates/deployment.yaml | 47 ++---- .../rappcatalogueservice/templates/service.yaml | 27 +--- .../oran_oom/rappcatalogueservice/values.yaml | 40 ++--- .../oran_oom/ric-common/templates/_influxdb.tpl | 114 +++++++------- .../oran_oom/ric-common/templates/_tiller.tpl | 4 +- smo-install/oran_oom/topology/Chart.yaml | 5 + .../oran_oom/topology/templates/configmapenv.yaml | 9 +- .../oran_oom/topology/templates/deployment.yaml | 23 +-- .../oran_oom/topology/templates/service.yaml | 18 +-- smo-install/oran_oom/topology/values.yaml | 4 +- 104 files changed, 1448 insertions(+), 2108 deletions(-) delete mode 100644 smo-install/oran_oom/dmaapadapterservice/resources/config/application.yaml delete mode 100644 smo-install/oran_oom/dmaapadapterservice/resources/data/application_configuration.json delete mode 100644 smo-install/oran_oom/dmaapmediatorservice/resources/config/application.yaml delete mode 100644 smo-install/oran_oom/dmaapmediatorservice/resources/data/type_config.json rename smo-install/oran_oom/{nonrtric-common/templates/_helmmanager.tpl => dmaapmediatorservice/resources/dmaap-topic-init.sh} (73%) rename smo-install/oran_oom/{nonrtric-common/templates/_a1simulator.tpl => dmaapmediatorservice/templates/_helpers.tpl} (58%) delete mode 100644 smo-install/oran_oom/informationservice/resources/config/application.yaml delete mode 100644 smo-install/oran_oom/nonrtric-common/templates/_a1controller.tpl rename smo-install/oran_oom/nonrtric-common/templates/{_common.tpl => _configmap.tpl} (72%) delete mode 100644 smo-install/oran_oom/nonrtric-common/templates/_controlpanel.tpl delete mode 100644 smo-install/oran_oom/nonrtric-common/templates/_dmaapadapterservice.tpl delete mode 100644 smo-install/oran_oom/nonrtric-common/templates/_dmaapmediatorservice.tpl delete mode 100644 smo-install/oran_oom/nonrtric-common/templates/_informationservice.tpl rename smo-install/oran_oom/nonrtric-common/templates/{_nonrtricgateway.tpl => _ingress.tpl} (68%) create mode 100644 smo-install/oran_oom/nonrtric-common/templates/_labels.tpl create mode 100644 smo-install/oran_oom/nonrtric-common/templates/_name.tpl create mode 100644 smo-install/oran_oom/nonrtric-common/templates/_namespace.tpl create mode 100644 smo-install/oran_oom/nonrtric-common/templates/_pods.tpl delete mode 100644 smo-install/oran_oom/nonrtric-common/templates/_rappcatalogueservice.tpl create mode 100644 smo-install/oran_oom/nonrtric-common/templates/_service.tpl rename smo-install/oran_oom/nonrtric-common/templates/{_policymanagementservice.tpl => _statefulset.tpl} (72%) create mode 100644 smo-install/oran_oom/nonrtric-common/templates/_utils.tpl delete mode 100644 smo-install/oran_oom/nonrtricgateway/resources/config/application.yaml delete mode 100755 smo-install/oran_oom/odu-app-ics-version/templates/_helpers.tpl delete mode 100755 smo-install/oran_oom/odu-app/templates/_helpers.tpl delete mode 100644 smo-install/oran_oom/policymanagementservice/resources/config/application.yaml delete mode 100644 smo-install/oran_oom/policymanagementservice/resources/data/application_configuration.json diff --git a/smo-install/helm-override/cnf/oran-override.yaml b/smo-install/helm-override/cnf/oran-override.yaml index d000c291..222a8bd7 100644 --- a/smo-install/helm-override/cnf/oran-override.yaml +++ b/smo-install/helm-override/cnf/oran-override.yaml @@ -61,24 +61,22 @@ common: ingressClassName: kong informationservice: - informationservice: - persistence: - # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed size should be the same. - # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be for instance 'standard' or 'gluster-fs' (depeneds on which classes that are available) - size: 2Gi - storageClassName: ics-storage - ingress: - enabled: true + persistence: + # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed size should be the same. + # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be for instance 'standard' or 'gluster-fs' (depeneds on which classes that are available) + size: 2Gi + storageClassName: ics-storage + ingress: + enabled: true # Need to check the external port Availability policymanagementservice: - policymanagementservice: - persistence: - # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed size should be the same. - # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be fon instance 'standard' or 'gluster-fs' (depeneds on which classes that are available) - size: 2Gi - storageClassName: pms-storage + persistence: + # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed size should be the same. + # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be fon instance 'standard' or 'gluster-fs' (depeneds on which classes that are available) + size: 2Gi + storageClassName: pms-storage ingress: enabled: true @@ -89,16 +87,14 @@ kong: enabled: true helmmanager: - helmmanager: - persistence: - # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed si> - # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be f> - storageClassName: helmmanager-storage + persistence: + # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed si> + # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be f> + storageClassName: helmmanager-storage controlpanel: - controlpanel: - ingress: - enabled: false + ingress: + enabled: false oru-app: simulators: diff --git a/smo-install/helm-override/default/oran-override.yaml b/smo-install/helm-override/default/oran-override.yaml index d40e97a1..222a8bd7 100644 --- a/smo-install/helm-override/default/oran-override.yaml +++ b/smo-install/helm-override/default/oran-override.yaml @@ -61,24 +61,22 @@ common: ingressClassName: kong informationservice: - informationservice: - persistence: - # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed size should be the same. - # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be for instance 'standard' or 'gluster-fs' (depeneds on which classes that are available) - size: 2Gi - storageClassName: ics-storage - ingress: - enabled: true + persistence: + # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed size should be the same. + # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be for instance 'standard' or 'gluster-fs' (depeneds on which classes that are available) + size: 2Gi + storageClassName: ics-storage + ingress: + enabled: true # Need to check the external port Availability policymanagementservice: - policymanagementservice: - persistence: - # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed size should be the same. - # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be fon instance 'standard' or 'gluster-fs' (depeneds on which classes that are available) - size: 2Gi - storageClassName: pms-storage + persistence: + # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed size should be the same. + # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be fon instance 'standard' or 'gluster-fs' (depeneds on which classes that are available) + size: 2Gi + storageClassName: pms-storage ingress: enabled: true @@ -89,16 +87,14 @@ kong: enabled: true helmmanager: - helmmanager: - persistence: - # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed si> - # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be f> - storageClassName: helmmanager-storage + persistence: + # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed si> + # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be f> + storageClassName: helmmanager-storage controlpanel: - controlpanel: - ingress: - enabled: false + ingress: + enabled: false oru-app: simulators: diff --git a/smo-install/helm-override/pythonsdk-tests/oran-override.yaml b/smo-install/helm-override/pythonsdk-tests/oran-override.yaml index b722d130..58eded0f 100644 --- a/smo-install/helm-override/pythonsdk-tests/oran-override.yaml +++ b/smo-install/helm-override/pythonsdk-tests/oran-override.yaml @@ -61,24 +61,22 @@ common: ingressClassName: kong informationservice: - informationservice: - persistence: - # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed size should be the same. - # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be for instance 'standard' or 'gluster-fs' (depeneds on which classes that are available) - size: 2Gi - storageClassName: ics-storage - ingress: - enabled: true + persistence: + # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed size should be the same. + # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be for instance 'standard' or 'gluster-fs' (depeneds on which classes that are available) + size: 2Gi + storageClassName: ics-storage + ingress: + enabled: true # Need to check the external port Availability policymanagementservice: - policymanagementservice: - persistence: - # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed size should be the same. - # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be fon instance 'standard' or 'gluster-fs' (depeneds on which classes that are available) - size: 2Gi - storageClassName: pms-storage + persistence: + # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed size should be the same. + # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be fon instance 'standard' or 'gluster-fs' (depeneds on which classes that are available) + size: 2Gi + storageClassName: pms-storage ingress: enabled: true @@ -89,16 +87,14 @@ kong: enabled: true helmmanager: - helmmanager: - persistence: - # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed si> - # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be f> - storageClassName: helmmanager-storage + persistence: + # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed si> + # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be f> + storageClassName: helmmanager-storage controlpanel: - controlpanel: - ingress: - enabled: false + ingress: + enabled: false oru-app: simulators: diff --git a/smo-install/oran_oom/a1controller/Chart.yaml b/smo-install/oran_oom/a1controller/Chart.yaml index a2e06881..53f199fb 100644 --- a/smo-install/oran_oom/a1controller/Chart.yaml +++ b/smo-install/oran_oom/a1controller/Chart.yaml @@ -23,4 +23,4 @@ version: 2.0.0 dependencies: - name: nonrtric-common version: ^2.0.0 - repository: "@local" \ No newline at end of file + repository: "@local" diff --git a/smo-install/oran_oom/a1controller/templates/deployment.yaml b/smo-install/oran_oom/a1controller/templates/deployment.yaml index 86bc4665..d1a646bf 100644 --- a/smo-install/oran_oom/a1controller/templates/deployment.yaml +++ b/smo-install/oran_oom/a1controller/templates/deployment.yaml @@ -16,41 +16,22 @@ kind: Deployment apiVersion: apps/v1 -metadata: - name: {{ include "common.name.a1controller" . }} - namespace: {{ include "common.namespace.nonrtric" . }} - generation: 1 - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.a1controller" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} - annotations: - deployment.kubernetes.io/revision: '1' +metadata: {{- include "common.resourceMetadata" . | nindent 2 }} spec: - replicas: {{ .Values.a1controller.replicaCount }} - selector: - matchLabels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.a1controller" . }} - release: {{ .Release.Name }} + replicas: {{ .Values.replicaCount }} + selector: {{- include "common.selectors" . | nindent 4 }} template: - metadata: - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.a1controller" . }} - release: {{ .Release.Name }} + metadata: {{- include "common.templateMetadata" . | nindent 6 }} spec: - hostname: {{ include "common.name.a1controller" . }} + hostname: {{ include "common.name" . }} containers: - - name: {{ include "common.containername.a1controller" . }} - image: {{ .Values.a1controller.image.registry }}/{{ .Values.a1controller.image.name }}:{{ .Values.a1controller.image.tag }} - imagePullPolicy: {{ .Values.a1controller.imagePullPolicy }} + - name: {{ include "common.containername" . }} + image: {{ .Values.image.registry }}/{{ .Values.image.name }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.imagePullPolicy }} command: - /opt/onap/sdnc/bin/startODL.sh - ports: - - containerPort: {{ .Values.a1controller.service.targetPort1 }} - protocol: TCP - - containerPort: {{ .Values.a1controller.service.targetPort2 }} - protocol: TCP + ports: {{- include "common.containerPorts" . | nindent 10 }} + {{- include "common.tcpsocketProbes" . | nindent 10 }} env: - name: MYSQL_ROOT_PASSWORD value: 'itsASecret' @@ -80,32 +61,16 @@ spec: value: 'a1adapter' - name: AAI_TRUSTSTORE_PASSWORD value: 'changeit' - readinessProbe: - tcpSocket: - port: {{ .Values.a1controller.service.targetPort1 }} - initialDelaySeconds: {{ .Values.a1controller.readiness.initialDelaySeconds }} - periodSeconds: {{ .Values.a1controller.readiness.periodSeconds }} - livenessProbe: - tcpSocket: - port: {{ .Values.a1controller.service.targetPort1 }} - initialDelaySeconds: {{ .Values.a1controller.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.a1controller.liveness.periodSeconds }} --- apiVersion: apps/v1 kind: Deployment -metadata: - name: db - namespace: {{ include "common.namespace.nonrtric" . }} - labels: - app: db +metadata: {{- include "common.resourceMetadata" (dict "suffix" "db" "dot" . ) | nindent 2 }} +{{ $selectorsCtx := dict "matchLabels" (dict "app.kubernetes.io/component" "db") "dot" . }} +{{ $templateMetadataCtx := dict "labels" (dict "app.kubernetes.io/component" "db") "dot" . }} spec: - selector: - matchLabels: - app: db + selector: {{- include "common.selectors" $selectorsCtx | nindent 4 }} template: - metadata: - labels: - app: db + metadata: {{- include "common.templateMetadata" $templateMetadataCtx | nindent 6 }} spec: containers: - name: sdnc-db-container diff --git a/smo-install/oran_oom/a1controller/templates/service.yaml b/smo-install/oran_oom/a1controller/templates/service.yaml index 5259bb84..be38ac46 100644 --- a/smo-install/oran_oom/a1controller/templates/service.yaml +++ b/smo-install/oran_oom/a1controller/templates/service.yaml @@ -14,53 +14,4 @@ # limitations under the License. # ################################################################################ -kind: Service -apiVersion: v1 -metadata: - name: {{ include "common.name.a1controller" . }} - namespace: {{ include "common.namespace.nonrtric" . }} - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.a1controller" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - type: ClusterIP - ports: - {{if eq .Values.a1controller.service.allowHttp true -}} - - name: {{ index .Values.a1controller.service.httpName }} - port: {{ .Values.a1controller.service.internalPort1 }} - targetPort: {{ .Values.a1controller.service.targetPort1 }} - protocol: TCP - {{- end }} - - name: {{ index .Values.a1controller.service.httpsName }} - port: {{ .Values.a1controller.service.internalPort2 }} - targetPort: {{ .Values.a1controller.service.targetPort2 }} - protocol: TCP - selector: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.a1controller" . }} - release: {{ .Release.Name }} ---- -apiVersion: v1 -kind: Service -metadata: - name: dbhost - namespace: {{ include "common.namespace.nonrtric" . }} -spec: - ports: - - port: 3306 - targetPort: 3306 - selector: - app: db ---- -apiVersion: v1 -kind: Service -metadata: - name: sdnctldb01 - namespace: {{ include "common.namespace.nonrtric" . }} -spec: - ports: - - port: 3306 - targetPort: 3306 - selector: - app: db +{{ include "common.service" . }} diff --git a/smo-install/oran_oom/a1controller/values.yaml b/smo-install/oran_oom/a1controller/values.yaml index 28bd09ce..bae7cfb0 100644 --- a/smo-install/oran_oom/a1controller/values.yaml +++ b/smo-install/oran_oom/a1controller/values.yaml @@ -17,24 +17,24 @@ # Default values for a1controller. # This is a YAML-formatted file. # Declare variables to be passed into your templates. -a1controller: - imagePullPolicy: IfNotPresent - image: - registry: 'nexus3.onap.org:10002/onap' - name: sdnc-image - tag: 2.1.6 - replicaCount: 1 - service: - allowHttp: true - httpName: http - internalPort1: 8282 - targetPort1: 8181 - httpsName: https - internalPort2: 8383 - targetPort2: 8443 - liveness: - initialDelaySeconds: 300 - periodSeconds: 10 - readiness: - initialDelaySeconds: 60 - periodSeconds: 10 +imagePullPolicy: IfNotPresent +image: + registry: 'nexus3.onap.org:10002/onap' + name: sdnc-image + tag: 2.1.6 +replicaCount: 1 +service: + type: ClusterIP + ports: + - name: http + internalPort: 8282 + targetPort: 8181 + name_tls: https + internalPort_tls: 8383 + targetPort_tls: 8443 +liveness: + initialDelaySeconds: 300 + periodSeconds: 10 +readiness: + initialDelaySeconds: 60 + periodSeconds: 10 diff --git a/smo-install/oran_oom/a1simulator/Chart.yaml b/smo-install/oran_oom/a1simulator/Chart.yaml index d4570a4f..daa3758f 100644 --- a/smo-install/oran_oom/a1simulator/Chart.yaml +++ b/smo-install/oran_oom/a1simulator/Chart.yaml @@ -7,4 +7,4 @@ version: 2.1.0 dependencies: - name: nonrtric-common version: ^2.0.0 - repository: "@local" \ No newline at end of file + repository: "@local" diff --git a/smo-install/oran_oom/aux-common/templates/_ingress.tpl b/smo-install/oran_oom/aux-common/templates/_ingress.tpl index b4afe630..5851de89 100644 --- a/smo-install/oran_oom/aux-common/templates/_ingress.tpl +++ b/smo-install/oran_oom/aux-common/templates/_ingress.tpl @@ -81,4 +81,4 @@ spec: {{- end -}} {{- end -}} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/smo-install/oran_oom/aux-common/templates/_namespace.tpl b/smo-install/oran_oom/aux-common/templates/_namespace.tpl index 94c9ee72..a1971ade 100644 --- a/smo-install/oran_oom/aux-common/templates/_namespace.tpl +++ b/smo-install/oran_oom/aux-common/templates/_namespace.tpl @@ -14,13 +14,6 @@ # limitations under the License. */}} -{{/* - Resolve the namespace to apply to a chart. The default namespace suffix - is the name of the chart. This can be overridden if necessary (eg. for subcharts) - using the following value: - - - .Values.nsPrefix : override namespace prefix -*/}} {{- define "common.namespace" -}} - {{- default .Release.Namespace .Values.nsPrefix -}} +{{- .Release.Namespace -}} {{- end -}} diff --git a/smo-install/oran_oom/aux-common/templates/_service.tpl b/smo-install/oran_oom/aux-common/templates/_service.tpl index 77b77d05..ececa627 100644 --- a/smo-install/oran_oom/aux-common/templates/_service.tpl +++ b/smo-install/oran_oom/aux-common/templates/_service.tpl @@ -28,4 +28,4 @@ {{- define "common.servicename" -}} {{- $name := default .Chart.Name .Values.nameOverride -}} {{- default $name .Values.service.name | trunc 63 | trimSuffix "-" -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/smo-install/oran_oom/controlpanel/templates/configmap.yaml b/smo-install/oran_oom/controlpanel/templates/configmap.yaml index cf0f7da6..2847f211 100644 --- a/smo-install/oran_oom/controlpanel/templates/configmap.yaml +++ b/smo-install/oran_oom/controlpanel/templates/configmap.yaml @@ -17,15 +17,9 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ include "common.name.controlpanel" . }}-configmap - namespace: {{ include "common.namespace.nonrtric" . }} - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.controlpanel" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + {{ include "common.resourceMetadata" (dict "suffix" "configmap" "dot" . ) | nindent 2 }} data: -{{ if eq .Values.controlpanel.ingress.enabled false }} +{{ if eq .Values.ingress.enabled false }} {{ tpl (.Files.Glob "resources-ngw/*").AsConfig . | indent 2 }} {{ else }} {{ tpl (.Files.Glob "resources-ing/*").AsConfig . | indent 2 }} diff --git a/smo-install/oran_oom/controlpanel/templates/deployment.yaml b/smo-install/oran_oom/controlpanel/templates/deployment.yaml index eb8fccea..ff93fd53 100644 --- a/smo-install/oran_oom/controlpanel/templates/deployment.yaml +++ b/smo-install/oran_oom/controlpanel/templates/deployment.yaml @@ -16,55 +16,26 @@ kind: Deployment apiVersion: apps/v1 -metadata: - name: {{ include "common.name.controlpanel" . }} - namespace: {{ include "common.namespace.nonrtric" . }} - generation: 1 - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.controlpanel" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} - annotations: - deployment.kubernetes.io/revision: '1' +metadata: {{- include "common.resourceMetadata" . | nindent 2 }} spec: - replicas: {{ .Values.controlpanel.replicaCount }} - selector: - matchLabels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.controlpanel" . }} - release: {{ .Release.Name }} + replicas: {{ .Values.replicaCount }} + selector: {{- include "common.selectors" . | nindent 4 }} template: - metadata: - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.controlpanel" . }} - release: {{ .Release.Name }} + metadata: {{- include "common.templateMetadata" . | nindent 6 }} spec: - hostname: {{ include "common.name.controlpanel" . }} + hostname: {{ include "common.name" . }} containers: - - name: {{ include "common.containername.controlpanel" . }} - image: {{ .Values.controlpanel.image.registry }}/{{ .Values.controlpanel.image.name }}:{{ .Values.controlpanel.image.tag }} - imagePullPolicy: {{ .Values.controlpanel.imagePullPolicy }} - ports: - - containerPort: {{ .Values.controlpanel.service.targetPort1 }} - protocol: TCP - - containerPort: {{ .Values.controlpanel.service.targetPort2 }} - protocol: TCP + - name: {{ include "common.containername" . }} + image: {{ .Values.image.registry }}/{{ .Values.image.name }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.imagePullPolicy }} + ports: {{- include "common.containerPorts" . | nindent 10 }} + {{- include "common.tcpsocketProbes" . | nindent 10 }} volumeMounts: - name: configmap mountPath: /etc/nginx/nginx.conf subPath: nginx.conf readOnly: true - readinessProbe: - tcpSocket: - port: {{ .Values.controlpanel.service.targetPort1 }} - initialDelaySeconds: {{ .Values.controlpanel.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.controlpanel.liveness.periodSeconds }} - livenessProbe: - tcpSocket: - port: {{ .Values.controlpanel.service.targetPort1 }} - initialDelaySeconds: {{ .Values.controlpanel.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.controlpanel.liveness.periodSeconds }} volumes: - name: configmap configMap: - name: {{ include "common.name.controlpanel" . }}-configmap \ No newline at end of file + name: {{ include "common.name" . }}-configmap diff --git a/smo-install/oran_oom/controlpanel/templates/service.yaml b/smo-install/oran_oom/controlpanel/templates/service.yaml index 1a61ed75..be38ac46 100644 --- a/smo-install/oran_oom/controlpanel/templates/service.yaml +++ b/smo-install/oran_oom/controlpanel/templates/service.yaml @@ -14,31 +14,4 @@ # limitations under the License. # ################################################################################ -kind: Service -apiVersion: v1 -metadata: - name: {{ include "common.name.controlpanel" . }} - namespace: {{ include "common.namespace.nonrtric" . }} - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.controlpanel" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - type: NodePort - ports: - {{if eq .Values.controlpanel.service.allowHttp true -}} - - name: {{ index .Values.controlpanel.service.httpName }} - port: {{ .Values.controlpanel.service.internalPort1 }} - targetPort: {{ .Values.controlpanel.service.targetPort1 }} - nodePort: {{ .Values.controlpanel.service.externalPort1 }} - protocol: TCP - {{- end }} - - name: {{ index .Values.controlpanel.service.httpsName }} - port: {{ .Values.controlpanel.service.internalPort2 }} - targetPort: {{ .Values.controlpanel.service.targetPort2 }} - nodePort: {{ .Values.controlpanel.service.externalPort2 }} - protocol: TCP - selector: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.controlpanel" . }} - release: {{ .Release.Name }} \ No newline at end of file +{{ include "common.service" . }} diff --git a/smo-install/oran_oom/controlpanel/values.yaml b/smo-install/oran_oom/controlpanel/values.yaml index fe4f2e37..f1d439af 100644 --- a/smo-install/oran_oom/controlpanel/values.yaml +++ b/smo-install/oran_oom/controlpanel/values.yaml @@ -18,29 +18,31 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -controlpanel: - imagePullPolicy: IfNotPresent - image: - registry: 'nexus3.o-ran-sc.org:10002/o-ran-sc' - name: nonrtric-controlpanel - tag: 2.5.0 - replicaCount: 1 - service: - allowHttp: true - httpName: http - internalPort1: 8182 - targetPort1: 8080 - externalPort1: 30091 - httpsName: https - internalPort2: 8082 - targetPort2: 8082 - externalPort2: 30092 - liveness: - initialDelaySeconds: 20 - periodSeconds: 10 - readiness: - initialDelaySeconds: 20 - periodSeconds: 10 +imagePullPolicy: IfNotPresent +image: + registry: 'nexus3.o-ran-sc.org:10002/o-ran-sc' + name: nonrtric-controlpanel + tag: 2.5.0 +replicaCount: 1 +liveness: + initialDelaySeconds: 20 + periodSeconds: 10 +readiness: + initialDelaySeconds: 20 + periodSeconds: 10 - ingress: - enabled: true +service: + type: NodePort + ports: + - name: http + internalPort: "8182" + targetPort: "8080" + nodePort: "30091" + name_tls: https + internalPort_tls: "8082" + targetPort_tls: "8082" + nodePort_tls: "30092" + + +ingress: + enabled: true diff --git a/smo-install/oran_oom/dmaapadapterservice/Chart.yaml b/smo-install/oran_oom/dmaapadapterservice/Chart.yaml index 15d22c41..14558b14 100644 --- a/smo-install/oran_oom/dmaapadapterservice/Chart.yaml +++ b/smo-install/oran_oom/dmaapadapterservice/Chart.yaml @@ -23,4 +23,4 @@ version: 1.0.0 dependencies: - name: nonrtric-common version: ^2.0.0 - repository: "@local" \ No newline at end of file + repository: "@local" diff --git a/smo-install/oran_oom/dmaapadapterservice/resources/config/application.yaml b/smo-install/oran_oom/dmaapadapterservice/resources/config/application.yaml deleted file mode 100644 index f2d5e593..00000000 --- a/smo-install/oran_oom/dmaapadapterservice/resources/config/application.yaml +++ /dev/null @@ -1,84 +0,0 @@ -################################################################################ -# Copyright (c) 2021 Nordix Foundation. # -# # -# 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. # -################################################################################ - -spring: - profiles: - active: prod - main: - allow-bean-definition-overriding: true - aop: - auto: false -management: - endpoints: - web: - exposure: - # Enabling of springboot actuator features. See springboot documentation. - include: "loggers,logfile,health,info,metrics,threaddump,heapdump" -springdoc: - show-actuator: true -logging: - # Configuration of logging - level: - ROOT: ERROR - org.springframework: ERROR - org.springframework.data: ERROR - org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR - org.oran.dmaapadapter: DEBUG - file: - name: /var/log/dmaap-adapter-service/application.log -server: - # Configuration of the HTTP/REST server. The parameters are defined and handeled by the springboot framework. - # See springboot documentation. - port : 8435 - http-port: 8084 - ssl: - key-store-type: JKS - key-store-password: policy_agent - key-store: /opt/app/dmaap-adapter-service/etc/cert/keystore.jks - key-password: policy_agent - key-alias: policy_agent -app: - webclient: - # Configuration of the trust store used for the HTTP client (outgoing requests) - # The file location and the password for the truststore is only relevant if trust-store-used == true - # Note that the same keystore as for the server is used. - trust-store-used: false - trust-store-password: policy_agent - trust-store: /opt/app/dmaap-adapter-service/etc/cert/truststore.jks - # Configuration of usage of HTTP Proxy for the southbound accesses. - # The HTTP proxy (if configured) will only be used for accessing NearRT RIC:s - http.proxy-host: - http.proxy-port: 0 - ics-base-url: https://informationservice.nonrtric:9083 - # Location of the component configuration file. The file will only be used if the Consul database is not used; - # configuration from the Consul will override the file. - configuration-filepath: /opt/app/dmaap-adapter-service/data/application_configuration.json - dmaap-base-url: http://message-router.onap:3904 - # The url used to adress this component. This is used as a callback url sent to other components. - dmaap-adapter-base-url: https://dmaapadapterservice.nonrtric:9088 - # KAFKA boostrap server. This is only needed if there are Information Types that uses a kafkaInputTopic - kafka: - bootstrap-servers: message-router-kafka.onap:9092 - # If the file name is empty, no authorization token is used - auth-token-file: - pm-files-path: /tmp - zip-output: false - s3: - endpointOverride: http://localhost:9000 - accessKeyId: minio - secretAccessKey: miniostorage - locksBucket: ropfilelocks - bucket: ropfiles \ No newline at end of file diff --git a/smo-install/oran_oom/dmaapadapterservice/resources/data/application_configuration.json b/smo-install/oran_oom/dmaapadapterservice/resources/data/application_configuration.json deleted file mode 100644 index 137e353f..00000000 --- a/smo-install/oran_oom/dmaapadapterservice/resources/data/application_configuration.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "types": [ - { - "id": "ExampleInformationType", - "dmaapTopicUrl": "/events/unauthenticated.dmaapadp.json/dmaapadapterproducer/msgs?timeout=15000&limit=100", - "useHttpProxy": false - }, - { - "id": "ExampleInformationTypeKafka", - "kafkaInputTopic": "unauthenticated.dmaapadp_kafka.text", - "useHttpProxy": false - } - ] - } diff --git a/smo-install/oran_oom/dmaapadapterservice/templates/configmap.yaml b/smo-install/oran_oom/dmaapadapterservice/templates/configmap.yaml index e0552132..cbd8da9b 100644 --- a/smo-install/oran_oom/dmaapadapterservice/templates/configmap.yaml +++ b/smo-install/oran_oom/dmaapadapterservice/templates/configmap.yaml @@ -15,28 +15,11 @@ ################################################################################ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "common.name.dmaapadapterservice" . }}-configmap-config - namespace: {{ include "common.namespace.nonrtric" . }} - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.dmaapadapterservice" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: -{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }} +{{ include "common.applicationConfigmap" . }} --- apiVersion: v1 kind: ConfigMap -metadata: - name: {{ include "common.name.dmaapadapterservice" . }}-configmap-data - namespace: {{ include "common.namespace.nonrtric" . }} - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.dmaapadapterservice" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} +metadata: {{ include "common.resourceMetadata" (dict "suffix" "type-configmap" "dot" . ) | nindent 2 }} data: -{{ tpl (.Files.Glob "resources/data/*").AsConfig . | indent 2 }} + type_config.json: | + {{- (dict "types" .Values.types) | toRawJson | nindent 4 }} diff --git a/smo-install/oran_oom/dmaapadapterservice/templates/service.yaml b/smo-install/oran_oom/dmaapadapterservice/templates/service.yaml index b2f0ad68..48461ebd 100644 --- a/smo-install/oran_oom/dmaapadapterservice/templates/service.yaml +++ b/smo-install/oran_oom/dmaapadapterservice/templates/service.yaml @@ -14,29 +14,4 @@ # limitations under the License. # ################################################################################ -kind: Service -apiVersion: v1 -metadata: - name: {{ include "common.name.dmaapadapterservice" . }} - namespace: {{ include "common.namespace.nonrtric" . }} - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.dmaapadapterservice" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - ports: - {{if eq .Values.dmaapadapterservice.service.allowHttp true -}} - - name: {{ index .Values.dmaapadapterservice.service.httpName }} - port: {{ .Values.dmaapadapterservice.service.internalPort1 }} - targetPort: {{ .Values.dmaapadapterservice.service.targetPort1 }} - protocol: TCP - {{- end }} - - name: {{ index .Values.dmaapadapterservice.service.httpsName }} - port: {{ .Values.dmaapadapterservice.service.internalPort2 }} - targetPort: {{ .Values.dmaapadapterservice.service.targetPort2 }} - protocol: TCP - selector: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.dmaapadapterservice" . }} - release: {{ .Release.Name }} - type: ClusterIP +{{ include "common.service" . }} diff --git a/smo-install/oran_oom/dmaapadapterservice/templates/statefulset.yaml b/smo-install/oran_oom/dmaapadapterservice/templates/statefulset.yaml index bc282973..aff1a274 100644 --- a/smo-install/oran_oom/dmaapadapterservice/templates/statefulset.yaml +++ b/smo-install/oran_oom/dmaapadapterservice/templates/statefulset.yaml @@ -16,59 +16,28 @@ kind: StatefulSet apiVersion: apps/v1 -metadata: - name: {{ include "common.name.dmaapadapterservice" . }} - namespace: {{ include "common.namespace.nonrtric" . }} - generation: 1 - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.dmaapadapterservice" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} - annotations: - deployment.kubernetes.io/revision: '1' +metadata: {{- include "common.resourceMetadata" . | nindent 2 }} spec: - serviceName: {{ include "common.name.dmaapadapterservice" . }} + serviceName: {{ include "common.name" . }} replicas: 1 - selector: - matchLabels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.dmaapadapterservice" . }} - release: {{ .Release.Name }} + selector: {{- include "common.selectors" . | nindent 4 }} template: - metadata: - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.dmaapadapterservice" . }} - release: {{ .Release.Name }} + metadata: {{- include "common.templateMetadata" . | nindent 6 }} spec: - hostname: {{ include "common.name.dmaapadapterservice" . }} + hostname: {{ include "common.name" . }} containers: - - name: {{ include "common.container.dmaapadapterservice" . }} - image: {{ .Values.dmaapadapterservice.image.registry }}/{{ .Values.dmaapadapterservice.image.name }}:{{ .Values.dmaapadapterservice.image.tag }} - imagePullPolicy: {{ .Values.dmaapadapterservice.imagePullPolicy }} - ports: - - containerPort: {{ .Values.dmaapadapterservice.service.targetPort1 }} - protocol: TCP - - containerPort: {{ .Values.dmaapadapterservice.service.targetPort2 }} - protocol: TCP - readinessProbe: - tcpSocket: - port: {{ .Values.dmaapadapterservice.service.targetPort1 }} - initialDelaySeconds: {{ .Values.dmaapadapterservice.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.dmaapadapterservice.liveness.periodSeconds }} - livenessProbe: - tcpSocket: - port: {{ .Values.dmaapadapterservice.service.targetPort1 }} - initialDelaySeconds: {{ .Values.dmaapadapterservice.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.dmaapadapterservice.liveness.periodSeconds }} + - name: {{ include "common.containername" . }} + image: {{ .Values.image.registry }}/{{ .Values.image.name }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.imagePullPolicy }} + ports: {{- include "common.containerPorts" . | nindent 8 }} + {{- include "common.tcpsocketProbes" . | nindent 8 }} volumeMounts: - - name: {{ include "common.name.dmaapadapterservice" . }}-dmaapadapter-config + - name: {{ include "common.applicationConfigMountName" . }} mountPath: /opt/app/dmaap-adapter-service/config - - name: {{ include "common.name.dmaapadapterservice" . }}-dmaapadapter-data + - name: {{ include "common.name" . }}-dmaapadapter-data mountPath: /opt/app/dmaap-adapter-service/data volumes: - - name: {{ include "common.name.dmaapadapterservice" . }}-dmaapadapter-config + {{- include "common.applicationConfigVolume" . | nindent 8 }} + - name: {{ include "common.name" . }}-dmaapadapter-data configMap: - name: {{ include "common.name.dmaapadapterservice" . }}-configmap-config - - name: {{ include "common.name.dmaapadapterservice" . }}-dmaapadapter-data - configMap: - name: {{ include "common.name.dmaapadapterservice" . }}-configmap-data + name: {{ include "common.name" . }}-type-configmap diff --git a/smo-install/oran_oom/dmaapadapterservice/values.yaml b/smo-install/oran_oom/dmaapadapterservice/values.yaml index 38e5e0b3..40665dca 100644 --- a/smo-install/oran_oom/dmaapadapterservice/values.yaml +++ b/smo-install/oran_oom/dmaapadapterservice/values.yaml @@ -18,23 +18,101 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -dmaapadapterservice: - imagePullPolicy: IfNotPresent - image: - registry: "nexus3.o-ran-sc.org:10002/o-ran-sc" - name: "nonrtric-plt-dmaapadapter" - tag: 1.3.0 - service: - allowHttp: true - httpName: http - internalPort1: 9087 - targetPort1: 8084 - httpsName: https - internalPort2: 9088 - targetPort2: 8435 - liveness: - initialDelaySeconds: 20 - periodSeconds: 10 - readiness: - initialDelaySeconds: 20 - periodSeconds: 10 +imagePullPolicy: IfNotPresent +image: + registry: "nexus3.o-ran-sc.org:10002/o-ran-sc" + name: "nonrtric-plt-dmaapadapter" + tag: 1.3.0 +service: + type: ClusterIP + ports: + - name: http + internalPort: 9087 + targetPort: 8084 + name_tls: https + internalPort_tls: 9088 + targetPort_tls: 8435 +liveness: + initialDelaySeconds: 20 + periodSeconds: 10 +readiness: + initialDelaySeconds: 20 + periodSeconds: 10 + +types: + - id: "ExampleInformationType" + dmaapTopicUrl: "/events/unauthenticated.dmaapadp.json/dmaapadapterproducer/msgs?timeout=15000&limit=100" + useHttpProxy: false + - id: "ExampleInformationTypeKafka" + kafkaInputTopic: "unauthenticated.dmaapadp_kafka.text" + useHttpProxy: false + +application: + spring: + profiles: + active: prod + main: + allow-bean-definition-overriding: true + aop: + auto: false + management: + endpoints: + web: + exposure: + # Enabling of springboot actuator features. See springboot documentation. + include: "loggers,logfile,health,info,metrics,threaddump,heapdump" + springdoc: + show-actuator: true + logging: + # Configuration of logging + level: + ROOT: ERROR + org.springframework: ERROR + org.springframework.data: ERROR + org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR + org.oran.dmaapadapter: DEBUG + file: + name: /var/log/dmaap-adapter-service/application.log + server: + # Configuration of the HTTP/REST server. The parameters are defined and handeled by the springboot framework. + # See springboot documentation. + port : 8435 + http-port: 8084 + ssl: + key-store-type: JKS + key-store-password: policy_agent + key-store: /opt/app/dmaap-adapter-service/etc/cert/keystore.jks + key-password: policy_agent + key-alias: policy_agent + app: + webclient: + # Configuration of the trust store used for the HTTP client (outgoing requests) + # The file location and the password for the truststore is only relevant if trust-store-used == true + # Note that the same keystore as for the server is used. + trust-store-used: false + trust-store-password: policy_agent + trust-store: /opt/app/dmaap-adapter-service/etc/cert/truststore.jks + # Configuration of usage of HTTP Proxy for the southbound accesses. + # The HTTP proxy (if configured) will only be used for accessing NearRT RIC:s + http.proxy-host: + http.proxy-port: 0 + ics-base-url: https://informationservice.nonrtric:9083 + # Location of the component configuration file. The file will only be used if the Consul database is not used; + # configuration from the Consul will override the file. + configuration-filepath: /opt/app/dmaap-adapter-service/data/application_configuration.json + dmaap-base-url: http://message-router.onap:3904 + # The url used to adress this component. This is used as a callback url sent to other components. + dmaap-adapter-base-url: https://dmaapadapterservice.nonrtric:9088 + # KAFKA boostrap server. This is only needed if there are Information Types that uses a kafkaInputTopic + kafka: + bootstrap-servers: message-router-kafka.onap:9092 + # If the file name is empty, no authorization token is used + auth-token-file: + pm-files-path: /tmp + zip-output: false + s3: + endpointOverride: http://localhost:9000 + accessKeyId: minio + secretAccessKey: miniostorage + locksBucket: ropfilelocks + bucket: ropfiles diff --git a/smo-install/oran_oom/dmaapmediatorservice/resources/config/application.yaml b/smo-install/oran_oom/dmaapmediatorservice/resources/config/application.yaml deleted file mode 100644 index 75b11ad8..00000000 --- a/smo-install/oran_oom/dmaapmediatorservice/resources/config/application.yaml +++ /dev/null @@ -1,54 +0,0 @@ -################################################################################ -# Copyright (c) 2020 Nordix Foundation. # -# # -# 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. # -################################################################################ - -spring: - profiles: - active: prod - main: - allow-bean-definition-overriding: true - aop: - auto: false -management: - endpoints: - web: - exposure: - include: "loggers,logfile,health,info,metrics,threaddump,heapdump" - -logging: - level: - ROOT: ERROR - org.springframework: ERROR - org.springframework.data: ERROR - org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR - org.oransc.enrichment: INFO - file: - name: /var/log/enrichment-coordinator-service/application.log -server: - port : 8434 - http-port: 8083 - ssl: - key-store-type: JKS - key-store-password: policy_agent - key-store: /opt/app/enrichment-coordinator-service/etc/cert/keystore.jks - key-password: policy_agent - key-alias: policy_agent -app: - filepath: /opt/app/enrichment-coordinator-service/data/application_configuration.json - webclient: - trust-store-used: false - trust-store-password: policy_agent - trust-store: /opt/app/enrichment-coordinator-service/etc/cert/truststore.jks - vardata-directory: /var/enrichment-coordinator-service \ No newline at end of file diff --git a/smo-install/oran_oom/dmaapmediatorservice/resources/data/type_config.json b/smo-install/oran_oom/dmaapmediatorservice/resources/data/type_config.json deleted file mode 100644 index 3a82a95e..00000000 --- a/smo-install/oran_oom/dmaapmediatorservice/resources/data/type_config.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "types": - [ - { - "id": "STD_Fault_Messages", - "dmaapTopicUrl": "/events/unauthenticated.dmaapmed.json/dmaapmediatorproducer/STD_Fault_Messages?timeout=15000&limit=100" - }, - { - "id": "VES_Fault_Messages", - "dmaapTopicUrl": "/events/unauthenticated.SEC_FAULT_OUTPUT/dmaapmediatorproducer/VES_Fault_Messages?timeout=15000&limit=100" - } - ] - } diff --git a/smo-install/oran_oom/nonrtric-common/templates/_helmmanager.tpl b/smo-install/oran_oom/dmaapmediatorservice/resources/dmaap-topic-init.sh similarity index 73% rename from smo-install/oran_oom/nonrtric-common/templates/_helmmanager.tpl rename to smo-install/oran_oom/dmaapmediatorservice/resources/dmaap-topic-init.sh index 736bff35..be8c6c8f 100644 --- a/smo-install/oran_oom/nonrtric-common/templates/_helmmanager.tpl +++ b/smo-install/oran_oom/dmaapmediatorservice/resources/dmaap-topic-init.sh @@ -1,5 +1,6 @@ +#!/bin/sh ################################################################################ -# Copyright (c) 2021 Nordix Foundation. # +# Copyright (c) 2024 NYCU WINLab. # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # @@ -14,11 +15,13 @@ # limitations under the License. # ################################################################################ -{{- define "common.name.helmmanager" -}} - {{- printf "helmmanager" -}} -{{- end -}} +topics='{{ .Values.dmaapTopicInit.topics | toRawJson }}' -{{- define "common.container.helmmanager" -}} - {{- $name := ( include "common.name.helmmanager" . ) -}} - {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} +echo $topics | jq -c '.[]' | while read -r obj; do + curl -X POST -H "Content-Type: application/json" -d "$obj" {{ .Values.dmaapTopicInit.dmaapMrAddr }}/topics/create + response=$? + if [ $response -ne 0 ]; then + echo "Failed to create topic $obj" + exit 1 + fi +done diff --git a/smo-install/oran_oom/nonrtric-common/templates/_a1simulator.tpl b/smo-install/oran_oom/dmaapmediatorservice/templates/_helpers.tpl similarity index 58% rename from smo-install/oran_oom/nonrtric-common/templates/_a1simulator.tpl rename to smo-install/oran_oom/dmaapmediatorservice/templates/_helpers.tpl index d15ee939..4f3b0b1e 100644 --- a/smo-install/oran_oom/nonrtric-common/templates/_a1simulator.tpl +++ b/smo-install/oran_oom/dmaapmediatorservice/templates/_helpers.tpl @@ -1,5 +1,6 @@ +{{/* ################################################################################ -# Copyright (c) 2020 Nordix Foundation. # +# Copyright (c) 2024 NYCU WINLab. # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # @@ -13,18 +14,34 @@ # See the License for the specific language governing permissions and # # limitations under the License. # ################################################################################ +*/}} -{{- define "common.name.a1simulator" -}} - {{- printf "a1simulator" -}} +{{- define "dmaapTopic.initContainer" -}} +- name: dmaap-topic-init + image: alpine:3.19.1 + command: + - sh + - -c + - apk add --no-cache curl jq; sh /app/dmaap-topic-init.sh; + volumeMounts: + - name: dmaap-topic-init + mountPath: /app {{- end -}} -{{- define "common.fullname.a1simulator" -}} - {{- $name := ( include "common.name.a1simulator" . ) -}} - {{- $namespace := ( include "common.namespace.nonrtric" . ) -}} - {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} +{{- define "dmaapTopic.initConfigMap" -}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.name" . }}-dmaap-topic-init + namespace: {{ include "common.namespace" . }} + labels: {{- include "common.labels" . | nindent 4 }} +data: + dmaap-topic-init.sh: | + {{- tpl (.Files.Get "resources/dmaap-topic-init.sh") . | nindent 4 }} +{{- end }} -{{- define "common.containername.a1simulator" -}} - {{- $name := ( include "common.fullname.a1simulator" . ) -}} - {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} +{{- define "dmaapTopic.initVolume" -}} +- name: dmaap-topic-init + configMap: + name: {{ include "common.name" . }}-dmaap-topic-init +{{- end }} diff --git a/smo-install/oran_oom/dmaapmediatorservice/templates/configmap.yaml b/smo-install/oran_oom/dmaapmediatorservice/templates/configmap.yaml index 89589967..2dce181f 100644 --- a/smo-install/oran_oom/dmaapmediatorservice/templates/configmap.yaml +++ b/smo-install/oran_oom/dmaapmediatorservice/templates/configmap.yaml @@ -17,13 +17,12 @@ apiVersion: v1 kind: ConfigMap -metadata: - name: {{ include "common.name.dmaapmediatorservice" . }}-configmap-data - namespace: {{ include "common.namespace.nonrtric" . }} - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.dmaapmediatorservice" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} +metadata: {{ include "common.resourceMetadata" (dict "suffix" "type-configmap" "dot" . ) | nindent 2 }} data: -{{ tpl (.Files.Glob "resources/data/*").AsConfig . | indent 2 }} + type_config.json: | + {{- (dict "types" .Values.types) | toRawJson | nindent 4 }} +--- +{{ if .Values.dmaapTopicInit.enabled -}} +{{ include "dmaapTopic.initConfigMap" . }} +--- +{{- end -}} diff --git a/smo-install/oran_oom/dmaapmediatorservice/templates/service.yaml b/smo-install/oran_oom/dmaapmediatorservice/templates/service.yaml index d09fde42..48461ebd 100644 --- a/smo-install/oran_oom/dmaapmediatorservice/templates/service.yaml +++ b/smo-install/oran_oom/dmaapmediatorservice/templates/service.yaml @@ -14,29 +14,4 @@ # limitations under the License. # ################################################################################ -kind: Service -apiVersion: v1 -metadata: - name: {{ include "common.name.dmaapmediatorservice" . }} - namespace: {{ include "common.namespace.nonrtric" . }} - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.dmaapmediatorservice" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - ports: - {{if eq .Values.dmaapmediatorservice.service.allowHttp true -}} - - name: {{ index .Values.dmaapmediatorservice.service.httpName }} - port: {{ .Values.dmaapmediatorservice.service.internalPort1 }} - targetPort: {{ .Values.dmaapmediatorservice.service.targetPort1 }} - protocol: TCP - {{- end }} - - name: {{ index .Values.dmaapmediatorservice.service.httpsName }} - port: {{ .Values.dmaapmediatorservice.service.internalPort2 }} - targetPort: {{ .Values.dmaapmediatorservice.service.targetPort2 }} - protocol: TCP - selector: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.dmaapmediatorservice" . }} - release: {{ .Release.Name }} - type: ClusterIP +{{ include "common.service" . }} diff --git a/smo-install/oran_oom/dmaapmediatorservice/templates/statefulset.yaml b/smo-install/oran_oom/dmaapmediatorservice/templates/statefulset.yaml index c8df0349..e3211e24 100644 --- a/smo-install/oran_oom/dmaapmediatorservice/templates/statefulset.yaml +++ b/smo-install/oran_oom/dmaapmediatorservice/templates/statefulset.yaml @@ -1,82 +1,59 @@ -################################################################################ -# Copyright (c) 2021 Nordix Foundation. # -# # -# 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. # -################################################################################ - -kind: StatefulSet -apiVersion: apps/v1 -metadata: - name: {{ include "common.name.dmaapmediatorservice" . }} - namespace: {{ include "common.namespace.nonrtric" . }} - generation: 1 - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.dmaapmediatorservice" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} - annotations: - deployment.kubernetes.io/revision: '1' -spec: - serviceName: {{ include "common.name.dmaapmediatorservice" . }} - replicas: 1 - selector: - matchLabels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.dmaapmediatorservice" . }} - release: {{ .Release.Name }} - template: - metadata: - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.dmaapmediatorservice" . }} - release: {{ .Release.Name }} - spec: - hostname: {{ include "common.name.dmaapmediatorservice" . }} - containers: - - name: {{ include "common.container.dmaapmediatorservice" . }} - image: {{ .Values.dmaapmediatorservice.image.registry }}/{{ .Values.dmaapmediatorservice.image.name }}:{{ .Values.dmaapmediatorservice.image.tag }} - imagePullPolicy: {{ .Values.dmaapmediatorservice.imagePullPolicy }} - ports: - - containerPort: {{ .Values.dmaapmediatorservice.service.targetPort1 }} - protocol: TCP - - containerPort: {{ .Values.dmaapmediatorservice.service.targetPort2 }} - protocol: TCP - readinessProbe: - tcpSocket: - port: {{ .Values.dmaapmediatorservice.service.targetPort2 }} - initialDelaySeconds: {{ .Values.dmaapmediatorservice.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.dmaapmediatorservice.liveness.periodSeconds }} - livenessProbe: - tcpSocket: - port: {{ .Values.dmaapmediatorservice.service.targetPort2 }} - initialDelaySeconds: {{ .Values.dmaapmediatorservice.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.dmaapmediatorservice.liveness.periodSeconds }} - volumeMounts: - - name: {{ include "common.name.dmaapmediatorservice" . }}-dmaapmediator-data - mountPath: /configs/type_config.json - subPath: type_config.json - - env: - - name: INFO_PRODUCER_HOST - value: https://{{ include "common.name.dmaapmediatorservice" . }} - - name: INFO_PRODUCER_PORT - value: "{{ .Values.dmaapmediatorservice.service.internalPort2 }}" - - name: INFO_COORD_ADDR - value: https://informationservice:9083 - - name: DMAAP_MR_ADDR - value: http://message-router.onap:3904 - - name: LOG_LEVEL - value: Info - volumes: - - name: {{ include "common.name.dmaapmediatorservice" . }}-dmaapmediator-data - configMap: - name: {{ include "common.name.dmaapmediatorservice" . }}-configmap-data +################################################################################ +# Copyright (c) 2021 Nordix Foundation. # +# # +# 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. # +################################################################################ + +kind: StatefulSet +apiVersion: apps/v1 +metadata: {{- include "common.resourceMetadata" . | nindent 2 }} +spec: + serviceName: {{ include "common.name" . }} + replicas: 1 + selector: {{- include "common.selectors" . | nindent 4 }} + template: + metadata: {{- include "common.templateMetadata" . | nindent 6 }} + spec: + hostname: {{ include "common.name" . }} + {{- if .Values.dmaapTopicInit.enabled }} + initContainers: {{- include "dmaapTopic.initContainer" . | nindent 6 }} + {{- end }} + containers: + - name: {{ include "common.containername" . }} + image: {{ .Values.image.registry }}/{{ .Values.image.name }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.imagePullPolicy }} + ports: {{- include "common.containerPorts" . | nindent 8 }} + {{- /* Only the info producer port is active */ -}} + {{- include "common.tcpsocketProbes" (dict "port" ((first .Values.service.ports).internalPort_tls) "dot" .) | nindent 8 }} + volumeMounts: + - name: {{ include "common.name" . }}-dmaapmediator-data + mountPath: /configs/type_config.json + subPath: type_config.json + env: + - name: INFO_PRODUCER_HOST + value: "{{ default (print "https://" ( include "common.name" . )) .Values.infoProducerHost }}" + - name: INFO_PRODUCER_PORT + value: "{{ default (first .Values.service.ports).internalPort_tls .Values.infoProducerPort }}" + - name: INFO_COORD_ADDR + value: "{{ .Values.infoCoordinatorAddr }}" + - name: DMAAP_MR_ADDR + value: "{{ .Values.dmaapMrAddr }}" + - name: LOG_LEVEL + value: "{{ .Values.logLevel }}" + volumes: + - name: {{ include "common.name" . }}-dmaapmediator-data + configMap: + name: {{ include "common.name" . }}-type-configmap + {{- if .Values.dmaapTopicInit.enabled -}} + {{- include "dmaapTopic.initVolume" . | nindent 8 }} + {{- end }} diff --git a/smo-install/oran_oom/dmaapmediatorservice/values.yaml b/smo-install/oran_oom/dmaapmediatorservice/values.yaml index bec03b9a..7acf5e66 100644 --- a/smo-install/oran_oom/dmaapmediatorservice/values.yaml +++ b/smo-install/oran_oom/dmaapmediatorservice/values.yaml @@ -18,23 +18,46 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -dmaapmediatorservice: - imagePullPolicy: IfNotPresent - image: - registry: "nexus3.o-ran-sc.org:10002/o-ran-sc" - name: "nonrtric-plt-dmaapmediatorproducer" - tag: 1.2.0 - service: - allowHttp: true - httpName: http - internalPort1: 8085 - targetPort1: 8085 - httpsName: https - internalPort2: 8185 - targetPort2: 8185 - liveness: - initialDelaySeconds: 20 - periodSeconds: 10 - readiness: - initialDelaySeconds: 20 - periodSeconds: 10 +imagePullPolicy: IfNotPresent +image: + registry: "nexus3.o-ran-sc.org:10002/o-ran-sc" + name: "nonrtric-plt-dmaapmediatorproducer" + tag: 1.2.0 +service: + type: ClusterIP + ports: + - name: http + internalPort: 8085 + targetPort: 8085 + name_tls: https + internalPort_tls: 8185 + targetPort_tls: 8185 +liveness: + initialDelaySeconds: 20 + periodSeconds: 10 +readiness: + initialDelaySeconds: 20 + periodSeconds: 10 + +logLevel: INFO +dmaapMrAddr: http://message-router.onap:3904 +infoCoordinatorAddr: https://informationservice:9083 + +types: + - id: STD_Fault_Messages + dmaapTopicUrl: "/events/unauthenticated.dmaapmed.json/dmaapmediatorproducer/STD_Fault_Messages?timeout=15000&limit=100" + - id: VES_Fault_Messages + dmaapTopicUrl: "/events/unauthenticated.SEC_FAULT_OUTPUT/dmaapmediatorproducer/VES_Fault_Messages?timeout=15000&limit=100" + +dmaapTopicInit: + enabled: true + dmaapMrAddr: http://message-router.onap:3904 + topics: + - topicName: unauthenticated.dmaapmed.json + topicDescription: STD_Fault_Messages + partitionCount: 1 + replicationCount: 1 + - topicName: unauthenticated.SEC_FAULT_OUTPUT + topicDescription: VES_Fault_Messages + partitionCount: 1 + replicationCount: 1 diff --git a/smo-install/oran_oom/helmmanager/Chart.yaml b/smo-install/oran_oom/helmmanager/Chart.yaml index 511176b3..26aa796c 100644 --- a/smo-install/oran_oom/helmmanager/Chart.yaml +++ b/smo-install/oran_oom/helmmanager/Chart.yaml @@ -22,4 +22,4 @@ version: 1.0.0 dependencies: - name: nonrtric-common version: ^2.0.0 - repository: "@local" \ No newline at end of file + repository: "@local" diff --git a/smo-install/oran_oom/helmmanager/templates/service.yaml b/smo-install/oran_oom/helmmanager/templates/service.yaml index 90ae6140..48461ebd 100644 --- a/smo-install/oran_oom/helmmanager/templates/service.yaml +++ b/smo-install/oran_oom/helmmanager/templates/service.yaml @@ -13,23 +13,5 @@ # See the License for the specific language governing permissions and # # limitations under the License. # ################################################################################ -kind: Service -apiVersion: v1 -metadata: - name: {{ include "common.name.helmmanager" . }} - namespace: {{ include "common.namespace.nonrtric" . }} - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.helmmanager" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - ports: - - name: {{ index .Values.helmmanager.service.httpName }} - port: {{ .Values.helmmanager.service.internalPort1 }} - targetPort: {{ .Values.helmmanager.service.targetPort1 }} - protocol: TCP - selector: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.helmmanager" . }} - release: {{ .Release.Name }} - type: ClusterIP + +{{ include "common.service" . }} diff --git a/smo-install/oran_oom/helmmanager/templates/serviceaccount.yaml b/smo-install/oran_oom/helmmanager/templates/serviceaccount.yaml index 60c081dc..a2f4242c 100644 --- a/smo-install/oran_oom/helmmanager/templates/serviceaccount.yaml +++ b/smo-install/oran_oom/helmmanager/templates/serviceaccount.yaml @@ -18,26 +18,21 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: {{ include "common.namespace.nonrtric" . }}-helm-manager-sa - namespace: {{ include "common.namespace.nonrtric" . }} - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.helmmanager" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} - annotations: - + name: {{ include "common.namespace" . }}-helm-manager-sa + namespace: {{ include "common.namespace" . }} + labels: {{- include "common.labels" . | nindent 4 }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: {{ include "common.namespace.nonrtric" . }}-helm-manager-sa-clusterrolebinding - namespace: {{ include "common.namespace.nonrtric" . }} + name: {{ include "common.namespace" . }}-helm-manager-sa-clusterrolebinding + namespace: {{ include "common.namespace" . }} + labels: {{- include "common.labels" . | nindent 4 }} subjects: - kind: ServiceAccount - name: {{ include "common.namespace.nonrtric" . }}-helm-manager-sa - namespace: {{ include "common.namespace.nonrtric" . }} + name: {{ include "common.namespace" . }}-helm-manager-sa + namespace: {{ include "common.namespace" . }} roleRef: kind: ClusterRole - name: {{ .Values.helmmanager.clusterRoleName }} + name: {{ .Values.clusterRoleName }} apiGroup: rbac.authorization.k8s.io diff --git a/smo-install/oran_oom/helmmanager/templates/statefulset.yaml b/smo-install/oran_oom/helmmanager/templates/statefulset.yaml index d980ecba..25e361c3 100644 --- a/smo-install/oran_oom/helmmanager/templates/statefulset.yaml +++ b/smo-install/oran_oom/helmmanager/templates/statefulset.yaml @@ -16,58 +16,22 @@ kind: StatefulSet apiVersion: apps/v1 -metadata: - name: {{ include "common.name.helmmanager" . }} - namespace: {{ include "common.namespace.nonrtric" . }} - generation: 1 - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.helmmanager" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} - annotations: - +metadata: {{- include "common.resourceMetadata" . | nindent 2 }} spec: - serviceName: {{ include "common.name.helmmanager" . }} + serviceName: {{ include "common.name" . }} replicas: 1 - selector: - matchLabels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.helmmanager" . }} - release: {{ .Release.Name }} + selector: {{- include "common.selectors" . | nindent 4 }} template: - metadata: - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.helmmanager" . }} - release: {{ .Release.Name }} + metadata: {{- include "common.templateMetadata" . | nindent 6 }} spec: - hostname: {{ include "common.name.helmmanager" . }} + hostname: {{ include "common.name" . }} containers: - - name: {{ include "common.container.helmmanager" . }} - image: {{ .Values.helmmanager.image.registry }}/{{ .Values.helmmanager.image.name }}:{{ .Values.helmmanager.image.tag }} - imagePullPolicy: {{ .Values.helmmanager.imagePullPolicy }} - ports: - - containerPort: {{ .Values.helmmanager.service.targetPort1 }} - protocol: TCP - readinessProbe: - tcpSocket: - port: {{ .Values.helmmanager.service.targetPort1 }} - initialDelaySeconds: {{ .Values.helmmanager.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.helmmanager.liveness.periodSeconds }} - livenessProbe: - tcpSocket: - port: {{ .Values.helmmanager.service.targetPort1 }} - initialDelaySeconds: {{ .Values.helmmanager.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.helmmanager.liveness.periodSeconds }} + - name: {{ include "common.containername" . }} + image: {{ .Values.image.registry }}/{{ .Values.image.name }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.imagePullPolicy }} + ports: {{- include "common.containerPorts" . | nindent 8 }} + {{- include "common.tcpsocketProbes" . | nindent 8 }} volumeMounts: - - name: {{ include "common.name.helmmanager" . }}-vardata + - name: {{ include "common.vardataMountName" . }} mountPath: "/var/helm-manager-service" - volumeClaimTemplates: - - metadata: - name: {{ include "common.name.helmmanager" . }}-vardata - spec: - accessModes: - - ReadWriteOnce - storageClassName: "{{ .Values.helmmanager.persistence.storageClassName }}" - resources: - requests: - storage: "{{ .Values.helmmanager.persistence.size }}" + volumeClaimTemplates: {{- include "common.vardataVolumeClaimTemplate" . | nindent 4 }} diff --git a/smo-install/oran_oom/helmmanager/values.yaml b/smo-install/oran_oom/helmmanager/values.yaml index fe194e78..d21d38c7 100644 --- a/smo-install/oran_oom/helmmanager/values.yaml +++ b/smo-install/oran_oom/helmmanager/values.yaml @@ -18,23 +18,24 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -helmmanager: - clusterRoleName: cluster-admin - imagePullPolicy: IfNotPresent - image: - registry: "nexus3.o-ran-sc.org:10002/o-ran-sc" - name: "nonrtric-plt-helmmanager" - tag: 1.3.0 - service: - httpName: http - internalPort1: 8112 - targetPort1: 8083 - liveness: - initialDelaySeconds: 20 - periodSeconds: 10 - readiness: - initialDelaySeconds: 20 - periodSeconds: 10 - persistence: - size: 1Gi - storageClassName: standard +clusterRoleName: cluster-admin +imagePullPolicy: IfNotPresent +image: + registry: "nexus3.o-ran-sc.org:10002/o-ran-sc" + name: "nonrtric-plt-helmmanager" + tag: 1.3.0 +service: + type: ClusterIP + ports: + - name: http + internalPort: "8112" + targetPort: "8083" +liveness: + initialDelaySeconds: 20 + periodSeconds: 10 +readiness: + initialDelaySeconds: 20 + periodSeconds: 10 +persistence: + size: 1Gi + storageClassName: standard diff --git a/smo-install/oran_oom/informationservice/Chart.yaml b/smo-install/oran_oom/informationservice/Chart.yaml index 900578d1..2ce8040b 100644 --- a/smo-install/oran_oom/informationservice/Chart.yaml +++ b/smo-install/oran_oom/informationservice/Chart.yaml @@ -23,4 +23,4 @@ version: 1.0.0 dependencies: - name: nonrtric-common version: ^2.0.0 - repository: "@local" \ No newline at end of file + repository: "@local" diff --git a/smo-install/oran_oom/informationservice/resources/config/application.yaml b/smo-install/oran_oom/informationservice/resources/config/application.yaml deleted file mode 100644 index 38bf7f0c..00000000 --- a/smo-install/oran_oom/informationservice/resources/config/application.yaml +++ /dev/null @@ -1,58 +0,0 @@ -################################################################################ -# Copyright (c) 2020 Nordix Foundation. # -# # -# 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. # -################################################################################ - -spring: - profiles: - active: prod - main: - allow-bean-definition-overriding: true - aop: - auto: false -management: - endpoints: - web: - exposure: - include: "loggers,logfile,health,info,metrics,threaddump,heapdump" - -logging: - level: - ROOT: ERROR - org.springframework: ERROR - org.springframework.data: ERROR - org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR - org.oransc.information: INFO - file: - name: /var/log/information-coordinator-service/application.log -server: - port : 8434 - http-port: 8083 - ssl: - key-store-type: JKS - key-store-password: policy_agent - key-store: /opt/app/information-coordinator-service/etc/cert/keystore.jks - key-password: policy_agent - key-alias: policy_agent -app: - filepath: /opt/app/information-coordinator-service/data/application_configuration.json - webclient: - trust-store-used: false - trust-store-password: policy_agent - trust-store: /opt/app/information-coordinator-service/etc/cert/truststore.jks - # Configuration of usage of HTTP Proxy for the southbound accesses. - # The HTTP proxy (if configured) will only be used for accessing NearRT RIC:s - http.proxy-host: - http.proxy-port: 0 - vardata-directory: /var/information-coordinator-service diff --git a/smo-install/oran_oom/informationservice/templates/configmap.yaml b/smo-install/oran_oom/informationservice/templates/configmap.yaml index 4d4df9f2..269b2d7f 100644 --- a/smo-install/oran_oom/informationservice/templates/configmap.yaml +++ b/smo-install/oran_oom/informationservice/templates/configmap.yaml @@ -14,16 +14,4 @@ # limitations under the License. # ################################################################################ - -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "common.name.informationservice" . }}-configmap - namespace: {{ include "common.namespace.nonrtric" . }} - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.informationservice" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: -{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }} +{{ include "common.applicationConfigmap" . }} diff --git a/smo-install/oran_oom/informationservice/templates/ingress.yaml b/smo-install/oran_oom/informationservice/templates/ingress.yaml index d8724070..63ac9ec4 100644 --- a/smo-install/oran_oom/informationservice/templates/ingress.yaml +++ b/smo-install/oran_oom/informationservice/templates/ingress.yaml @@ -16,13 +16,10 @@ ################################################################################ */}} -{{- if .Values.informationservice.ingress.enabled -}} +{{- if (include "common.ingressEnabled" .) -}} apiVersion: networking.k8s.io/v1 kind: Ingress -metadata: - name: {{ include "common.name.informationservice" . }} - namespace: {{ include "common.namespace.nonrtric" . }} - +metadata: {{- include "common.resourceMetadata" . | nindent 2 }} spec: ingressClassName: {{ include "common.ingressClassName" . }} rules: @@ -31,15 +28,15 @@ spec: - path: "/data-producer" backend: service: - name: {{ include "common.name.informationservice" . }} + name: {{ include "common.name" . }} port: - number: {{ .Values.informationservice.service.internalPort1 }} + number: {{ (first .Values.service.ports).internalPort }} pathType: Prefix - path: "/data-consumer" backend: service: - name: {{ include "common.name.informationservice" . }} + name: {{ include "common.name" . }} port: - number: {{ .Values.informationservice.service.internalPort1 }} + number: {{ (first .Values.service.ports).internalPort }} pathType: Prefix {{- end -}} diff --git a/smo-install/oran_oom/informationservice/templates/service.yaml b/smo-install/oran_oom/informationservice/templates/service.yaml index ba5783cf..be38ac46 100644 --- a/smo-install/oran_oom/informationservice/templates/service.yaml +++ b/smo-install/oran_oom/informationservice/templates/service.yaml @@ -14,29 +14,4 @@ # limitations under the License. # ################################################################################ -kind: Service -apiVersion: v1 -metadata: - name: {{ include "common.name.informationservice" . }} - namespace: {{ include "common.namespace.nonrtric" . }} - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.informationservice" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - ports: - {{if eq .Values.informationservice.service.allowHttp true -}} - - name: {{ index .Values.informationservice.service.httpName }} - port: {{ .Values.informationservice.service.internalPort1 }} - targetPort: {{ .Values.informationservice.service.targetPort1 }} - protocol: TCP - {{- end }} - - name: {{ index .Values.informationservice.service.httpsName }} - port: {{ .Values.informationservice.service.internalPort2 }} - targetPort: {{ .Values.informationservice.service.targetPort2 }} - protocol: TCP - selector: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.informationservice" . }} - release: {{ .Release.Name }} - type: ClusterIP +{{ include "common.service" . }} diff --git a/smo-install/oran_oom/informationservice/templates/statefulset.yaml b/smo-install/oran_oom/informationservice/templates/statefulset.yaml index a5973243..f9d8348c 100644 --- a/smo-install/oran_oom/informationservice/templates/statefulset.yaml +++ b/smo-install/oran_oom/informationservice/templates/statefulset.yaml @@ -16,67 +16,39 @@ kind: StatefulSet apiVersion: apps/v1 -metadata: - name: {{ include "common.name.informationservice" . }} - namespace: {{ include "common.namespace.nonrtric" . }} - generation: 1 - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.informationservice" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} - annotations: - deployment.kubernetes.io/revision: '1' +metadata: {{- include "common.resourceMetadata" . | nindent 2 }} spec: - serviceName: {{ include "common.name.informationservice" . }} + serviceName: {{ include "common.name" . }} replicas: 1 - selector: - matchLabels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.informationservice" . }} - release: {{ .Release.Name }} + selector: {{- include "common.selectors" . | nindent 4 }} template: - metadata: - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.informationservice" . }} - release: {{ .Release.Name }} + metadata: {{- include "common.templateMetadata" . | nindent 6 }} spec: - hostname: {{ include "common.name.informationservice" . }} + hostname: {{ include "common.name" . }} + initContainers: + - name: fix-permission + command: + - sh + - -c + - mkdir /var/information-coordinator-service/database; + chown -R 1000:1000 /var/information-coordinator-service; + image: busybox:1.28 + imagePullPolicy: {{ .Values.imagePullPolicy }} + volumeMounts: + - name: {{ include "common.vardataMountName" . }} + mountPath: /var/information-coordinator-service containers: - - name: {{ include "common.container.informationservice" . }} - image: {{ .Values.informationservice.image.registry }}/{{ .Values.informationservice.image.name }}:{{ .Values.informationservice.image.tag }} - imagePullPolicy: {{ .Values.informationservice.imagePullPolicy }} - ports: - - containerPort: {{ .Values.informationservice.service.targetPort1 }} - protocol: TCP - - containerPort: {{ .Values.informationservice.service.targetPort2 }} - protocol: TCP - readinessProbe: - tcpSocket: - port: {{ .Values.informationservice.service.targetPort1 }} - initialDelaySeconds: {{ .Values.informationservice.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.informationservice.liveness.periodSeconds }} - livenessProbe: - httpGet: - path: /status - port: {{ .Values.informationservice.service.targetPort1 }} - initialDelaySeconds: {{ .Values.informationservice.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.informationservice.liveness.periodSeconds }} + - name: {{ include "common.containername" . }} + image: {{ .Values.image.registry }}/{{ .Values.image.name }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.imagePullPolicy }} + ports: {{- include "common.containerPorts" . | nindent 8 }} + {{- include "common.tcpsocketReadinessProbe" . | nindent 8 }} + {{- include "common.httpLiveProbe" . | nindent 8 }} volumeMounts: - - name: {{ include "common.name.informationservice" . }}-information-config + - name: {{ include "common.applicationConfigMountName" . }} mountPath: /opt/app/information-coordinator-service/config - - name: {{ include "common.name.informationservice" . }}-vardata + - name: {{ include "common.vardataMountName" . }} mountPath: /var/information-coordinator-service - volumes: - - name: {{ include "common.name.informationservice" . }}-information-config - configMap: - name: {{ include "common.name.informationservice" . }}-configmap + volumes: {{- include "common.applicationConfigVolume" . | nindent 8 }} - volumeClaimTemplates: - - metadata: - name: {{ include "common.name.informationservice" . }}-vardata - spec: - accessModes: [ ReadWriteOnce ] - storageClassName: "{{ .Values.informationservice.persistence.storageClassName }}" - resources: - requests: - storage: "{{ .Values.informationservice.persistence.size }}" + volumeClaimTemplates: {{- include "common.vardataVolumeClaimTemplate" . | nindent 4 }} diff --git a/smo-install/oran_oom/informationservice/values.yaml b/smo-install/oran_oom/informationservice/values.yaml index 7d7aadf7..2df11d46 100644 --- a/smo-install/oran_oom/informationservice/values.yaml +++ b/smo-install/oran_oom/informationservice/values.yaml @@ -19,28 +19,72 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -informationservice: - imagePullPolicy: IfNotPresent - image: - registry: "nexus3.o-ran-sc.org:10002/o-ran-sc" - name: "nonrtric-plt-informationcoordinatorservice" - tag: 1.6.0 - service: - allowHttp: true - httpName: http - internalPort1: 9082 - targetPort1: 8083 - httpsName: https - internalPort2: 9083 - targetPort2: 8434 - liveness: - initialDelaySeconds: 20 - periodSeconds: 10 - readiness: - initialDelaySeconds: 20 - periodSeconds: 10 - persistence: - size: 2Gi - storageClassName: standard - ingress: - enabled: false +imagePullPolicy: IfNotPresent +image: + registry: "nexus3.o-ran-sc.org:10002/o-ran-sc" + name: "nonrtric-plt-informationcoordinatorservice" + tag: 1.6.0 +service: + type: ClusterIP + ports: + - name: http + internalPort: "9082" + targetPort: "8083" + name_tls: https + internalPort_tls: "9083" + targetPort_tls: "8434" +liveness: + initialDelaySeconds: 20 + periodSeconds: 10 +readiness: + initialDelaySeconds: 20 + periodSeconds: 10 +persistence: + size: 2Gi + storageClassName: standard +ingress: + enabled: false + +application: + spring: + profiles: + active: prod + main: + allow-bean-definition-overriding: true + aop: + auto: false + management: + endpoints: + web: + exposure: + include: "loggers,logfile,health,info,metrics,threaddump,heapdump" + + logging: + level: + ROOT: ERROR + org.springframework: ERROR + org.springframework.data: ERROR + org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR + org.oransc.information: INFO + file: + name: /var/log/information-coordinator-service/application.log + server: + port : 8434 + http-port: 8083 + ssl: + key-store-type: JKS + key-store-password: policy_agent + key-store: /opt/app/information-coordinator-service/etc/cert/keystore.jks + key-password: policy_agent + key-alias: policy_agent + app: + filepath: /opt/app/information-coordinator-service/data/application_configuration.json + webclient: + trust-store-used: false + trust-store-password: policy_agent + trust-store: /opt/app/information-coordinator-service/etc/cert/truststore.jks + # Configuration of usage of HTTP Proxy for the southbound accesses. + # The HTTP proxy (if configured) will only be used for accessing NearRT RIC:s + http.proxy-host: + http.proxy-port: 0 + vardata-directory: /var/information-coordinator-service diff --git a/smo-install/oran_oom/nonrtric-common/Chart.yaml b/smo-install/oran_oom/nonrtric-common/Chart.yaml index 3798faff..1f64891e 100644 --- a/smo-install/oran_oom/nonrtric-common/Chart.yaml +++ b/smo-install/oran_oom/nonrtric-common/Chart.yaml @@ -17,4 +17,4 @@ apiVersion: v2 description: NONRTRIC Common templates for inclusion in other charts name: nonrtric-common -version: 2.0.0 \ No newline at end of file +version: 2.0.0 diff --git a/smo-install/oran_oom/nonrtric-common/templates/_a1controller.tpl b/smo-install/oran_oom/nonrtric-common/templates/_a1controller.tpl deleted file mode 100644 index afb5097b..00000000 --- a/smo-install/oran_oom/nonrtric-common/templates/_a1controller.tpl +++ /dev/null @@ -1,24 +0,0 @@ -################################################################################ -# Copyright (c) 2020 Nordix Foundation. # -# # -# 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. # -################################################################################ - -{{- define "common.name.a1controller" -}} - {{- printf "a1controller" -}} -{{- end -}} - -{{- define "common.containername.a1controller" -}} - {{- $name := ( include "common.name.a1controller" . ) -}} - {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} \ No newline at end of file diff --git a/smo-install/oran_oom/nonrtric-common/templates/_common.tpl b/smo-install/oran_oom/nonrtric-common/templates/_configmap.tpl similarity index 72% rename from smo-install/oran_oom/nonrtric-common/templates/_common.tpl rename to smo-install/oran_oom/nonrtric-common/templates/_configmap.tpl index af3226f7..3eb24952 100644 --- a/smo-install/oran_oom/nonrtric-common/templates/_common.tpl +++ b/smo-install/oran_oom/nonrtric-common/templates/_configmap.tpl @@ -1,5 +1,6 @@ +{{/* ################################################################################ -# Copyright (c) 2020 Nordix Foundation. # +# Copyright (c) 2024 NYCU WINLab. # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # @@ -13,7 +14,17 @@ # See the License for the specific language governing permissions and # # limitations under the License. # ################################################################################ +*/}} -{{- define "common.namespace.nonrtric" -}} - {{- default .Release.Namespace .Values.nsPrefix -}} -{{- end -}} +{{- define "common.applicationConfigmap" -}} +{{- $dot := default . .dot -}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.name" $dot }}-application-configmap + namespace: {{ include "common.namespace" . }} + labels: {{- include "common.labels" . | nindent 4 }} +data: + application.yml: | + {{- toYaml .Values.application | nindent 4 }} +{{ end -}} diff --git a/smo-install/oran_oom/nonrtric-common/templates/_controlpanel.tpl b/smo-install/oran_oom/nonrtric-common/templates/_controlpanel.tpl deleted file mode 100644 index 1f1430e9..00000000 --- a/smo-install/oran_oom/nonrtric-common/templates/_controlpanel.tpl +++ /dev/null @@ -1,24 +0,0 @@ -################################################################################ -# Copyright (c) 2020 Nordix Foundation. # -# # -# 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. # -################################################################################ - -{{- define "common.name.controlpanel" -}} - {{- printf "controlpanel" -}} -{{- end -}} - -{{- define "common.containername.controlpanel" -}} - {{- $name := ( include "common.name.controlpanel" . ) -}} - {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} \ No newline at end of file diff --git a/smo-install/oran_oom/nonrtric-common/templates/_dmaapadapterservice.tpl b/smo-install/oran_oom/nonrtric-common/templates/_dmaapadapterservice.tpl deleted file mode 100644 index 0d730461..00000000 --- a/smo-install/oran_oom/nonrtric-common/templates/_dmaapadapterservice.tpl +++ /dev/null @@ -1,24 +0,0 @@ -################################################################################ -# Copyright (c) 2021 Nordix Foundation. # -# # -# 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. # -################################################################################ - -{{- define "common.name.dmaapadapterservice" -}} - {{- printf "dmaapadapterservice" -}} -{{- end -}} - -{{- define "common.container.dmaapadapterservice" -}} - {{- $name := ( include "common.name.dmaapadapterservice" . ) -}} - {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} diff --git a/smo-install/oran_oom/nonrtric-common/templates/_dmaapmediatorservice.tpl b/smo-install/oran_oom/nonrtric-common/templates/_dmaapmediatorservice.tpl deleted file mode 100644 index d31d0c8d..00000000 --- a/smo-install/oran_oom/nonrtric-common/templates/_dmaapmediatorservice.tpl +++ /dev/null @@ -1,23 +0,0 @@ -################################################################################ -# Copyright (c) 2021 Nordix Foundation. # -# # -# 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. # -################################################################################ -{{- define "common.name.dmaapmediatorservice" -}} - {{- printf "dmaapmediatorservice" -}} -{{- end -}} -{{- define "common.container.dmaapmediatorservice" -}} - {{- $name := ( include "common.name.dmaapmediatorservice" . ) -}} - {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} - diff --git a/smo-install/oran_oom/nonrtric-common/templates/_informationservice.tpl b/smo-install/oran_oom/nonrtric-common/templates/_informationservice.tpl deleted file mode 100644 index bb686b24..00000000 --- a/smo-install/oran_oom/nonrtric-common/templates/_informationservice.tpl +++ /dev/null @@ -1,22 +0,0 @@ -################################################################################ -# Copyright (c) 2020 Nordix Foundation. # -# # -# 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. # -################################################################################ -{{- define "common.name.informationservice" -}} - {{- printf "informationservice" -}} -{{- end -}} -{{- define "common.container.informationservice" -}} - {{- $name := ( include "common.name.informationservice" . ) -}} - {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} diff --git a/smo-install/oran_oom/nonrtric-common/templates/_nonrtricgateway.tpl b/smo-install/oran_oom/nonrtric-common/templates/_ingress.tpl similarity index 68% rename from smo-install/oran_oom/nonrtric-common/templates/_nonrtricgateway.tpl rename to smo-install/oran_oom/nonrtric-common/templates/_ingress.tpl index d14e540b..c5cf507e 100644 --- a/smo-install/oran_oom/nonrtric-common/templates/_nonrtricgateway.tpl +++ b/smo-install/oran_oom/nonrtric-common/templates/_ingress.tpl @@ -1,5 +1,6 @@ +{{/* ################################################################################ -# Copyright (c) 2021 Nordix Foundation. # +# Copyright (c) 2024 NYCU WINLab. # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # @@ -13,16 +14,23 @@ # See the License for the specific language governing permissions and # # limitations under the License. # ################################################################################ - -{{- define "common.name.nonrtricgateway" -}} - {{- printf "nonrtricgateway" -}} -{{- end -}} - -{{- define "common.container.nonrtricgateway" -}} - {{- $name := ( include "common.name.nonrtricgateway" . ) -}} - {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} +*/}} +{{- define "common.ingressClassName" -}} + {{- if and .Values.global .Values.global.ingress -}} + {{- default "kong" .Values.global.ingress.ingressClass -}} + {{- else -}} + {{- print "kong" -}} + {{- end -}} {{- end -}} -{{- define "common.ingressClassName" -}} - {{- printf "kong" -}} +{{- define "common.ingressEnabled" -}} + {{- if and .Values.global .Values.global.ingress -}} + {{- if .Values.global.ingress.enabled -}} + {{- if or .Values.global.ingress.enabled_all .Values.ingress.enabled -}} + true + {{- end -}} + {{- end -}} + {{- else -}} + {{- .Values.ingress.enabled -}} + {{- end -}} {{- end -}} diff --git a/smo-install/oran_oom/nonrtric-common/templates/_labels.tpl b/smo-install/oran_oom/nonrtric-common/templates/_labels.tpl new file mode 100644 index 00000000..1f97eff2 --- /dev/null +++ b/smo-install/oran_oom/nonrtric-common/templates/_labels.tpl @@ -0,0 +1,105 @@ +{{/* +# Copyright © 2019 Orange +# Modifications Copyright (C) 2022 Bell Canada +# Modifications Copyright (c) 2024 NYCU WINLab +# +# 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. +*/}} + +{{/* +Common labels +The function takes several arguments (inside a dictionary): + - .dot : environment (.) + - .labels : labels to add (dict) +*/}} +{{- define "common.labels" -}} +{{- $dot := default . .dot -}} +app.kubernetes.io/name: {{ include "common.name" $dot }} +app.kubernetes.io/version: "{{ (default $dot.Chart.Version $dot.Chart.AppVersion) | replace "+" "_" }}" +{{- if not .ignoreHelmChart }} +helm.sh/chart: {{ $dot.Chart.Name }}-{{ $dot.Chart.Version | replace "+" "_" }} +{{- end }} +app.kubernetes.io/instance: {{ $dot.Release.Name }} +app.kubernetes.io/managed-by: {{ $dot.Release.Service }} +{{- if .labels }} +{{ include "common.tplValue" (dict "value" .labels "context" $dot) }} +{{- end }} +{{- end -}} + +{{/* +Labels to use on deploy.spec.selector.matchLabels and svc.spec.selector +The function takes several arguments (inside a dictionary): + - .dot : environment (.) + - .matchLabels: selectors/matchlLabels to add (dict) +*/}} +{{- define "common.matchLabels" -}} +{{- $dot := default . .dot -}} +{{- $matchLabels := default (dict) .matchLabels -}} +{{- if not $matchLabels.nameNoMatch -}} +app.kubernetes.io/name: {{ include "common.name" $dot }} +{{- end }} +app.kubernetes.io/instance: {{ include "common.release" $dot }} +{{- if $matchLabels }} +{{$_ := unset $matchLabels "nameNoMatch"}} +{{- include "common.tplValue" (dict "value" $matchLabels "context" $dot) }} +{{- end }} +{{- end -}} + +{{/* + Generate "top" metadata for Deployment / StatefulSet / ... + The function takes several arguments (inside a dictionary): + - .dot : environment (.) + - .labels: labels to add (dict) + - .suffix: suffix to name + +*/}} +{{- define "common.resourceMetadata" -}} +{{- $dot := default . .dot -}} +{{- $suffix := default "" .suffix -}} +{{- $labels := default (dict) .labels -}} +{{- $annotations := default (dict) .annotations -}} +name: {{ include "common.name" (dict "suffix" $suffix "dot" $dot )}} +namespace: {{ include "common.namespace" $dot }} +labels: {{- include "common.labels" (dict "labels" $labels "ignoreHelmChart" .ignoreHelmChart "dot" $dot ) | nindent 2 }} +{{- if $annotations }} +annotations: {{- include "common.tplValue" (dict "value" $annotations "context" $dot) | nindent 2}} +{{- end }} +{{- end -}} + +{{/* + Generate selectors for Deployment / StatefulSet / ... + The function takes several arguments (inside a dictionary): + - .dot : environment (.) + - .matchLabels: labels to add (dict) +*/}} +{{- define "common.selectors" -}} +{{- $dot := default . .dot -}} +{{- $matchLabels := default (dict) .matchLabels -}} +matchLabels: {{- include "common.matchLabels" (dict "matchLabels" $matchLabels "dot" $dot) | nindent 2 }} +{{- end -}} + +{{/* + Generate "template" metadata for Deployment / StatefulSet / ... + The function takes several arguments (inside a dictionary) + - .dot : environment (.) + - .labels: labels to add (dict) +*/}} +{{- define "common.templateMetadata" -}} +{{- $dot := default . .dot -}} +{{- $labels := default (dict) .labels -}} +{{- if $dot.Values.podAnnotations -}} +annotations: {{- include "common.tplValue" (dict "value" $dot.Values.podAnnotations "context" $dot) | nindent 2 }} +{{ end -}} +labels: {{- include "common.labels" (dict "labels" $labels "ignoreHelmChart" .ignoreHelmChart "dot" $dot) | nindent 2 }} +name: {{ include "common.name" $dot }} +{{- end -}} diff --git a/smo-install/oran_oom/nonrtric-common/templates/_name.tpl b/smo-install/oran_oom/nonrtric-common/templates/_name.tpl new file mode 100644 index 00000000..d0072c20 --- /dev/null +++ b/smo-install/oran_oom/nonrtric-common/templates/_name.tpl @@ -0,0 +1,37 @@ +{{/* +# Copyright © 2017 Amdocs, Bell Canada +# Modifications Copyright (c) 2024 NYCU WINLab. +# +# 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. +*/}} + +{{/* + Expand the name of a chart. + The function takes from one to two arguments (inside a dictionary): + - .dot : environment (.) + - .suffix : add a suffix to the name +*/}} +{{- define "common.name" -}} + {{- $dot := default . .dot -}} + {{- $suffix := .suffix -}} + {{- default (default $dot.Chart.Name $dot.Values.nameOverride) .nameOverride | trunc 63 | trimSuffix "-" -}}{{ if $suffix }}{{ print "-" $suffix }}{{ end }} +{{- end -}} + +{{- define "common.containername" -}} + {{- $name := ( include "common.name" . ) -}} + {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.release" -}} +{{ .Release.Name }} +{{- end -}} diff --git a/smo-install/oran_oom/nonrtric-common/templates/_namespace.tpl b/smo-install/oran_oom/nonrtric-common/templates/_namespace.tpl new file mode 100644 index 00000000..94c9ee72 --- /dev/null +++ b/smo-install/oran_oom/nonrtric-common/templates/_namespace.tpl @@ -0,0 +1,26 @@ +{{/* +# Copyright © 2017 Amdocs, Bell Canada +# +# 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. +*/}} + +{{/* + Resolve the namespace to apply to a chart. The default namespace suffix + is the name of the chart. This can be overridden if necessary (eg. for subcharts) + using the following value: + + - .Values.nsPrefix : override namespace prefix +*/}} +{{- define "common.namespace" -}} + {{- default .Release.Namespace .Values.nsPrefix -}} +{{- end -}} diff --git a/smo-install/oran_oom/nonrtric-common/templates/_pods.tpl b/smo-install/oran_oom/nonrtric-common/templates/_pods.tpl new file mode 100644 index 00000000..e81bc38e --- /dev/null +++ b/smo-install/oran_oom/nonrtric-common/templates/_pods.tpl @@ -0,0 +1,92 @@ +{{/* +################################################################################ +# Copyright (c) 2024 NYCU WINLab. # +# # +# 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. # +################################################################################ +*/}} + +{{- define "common.containerPorts" -}} +{{- $ports := default (list) .Values.service.ports }} +{{- range $index, $port := $ports }} +{{- if $port.targetPort -}} +- containerPort: {{ $port.targetPort }} + name: {{ $port.name }} +{{- if $port.l4_protocol }} + protocol: {{ $port.l4_protocol }} +{{- else }} + protocol: TCP +{{- end }} +{{- end }} +{{- if $port.targetPort_tls }} +- containerPort: {{ $port.targetPort_tls }} + name: {{ $port.name_tls }} +{{- if $port.l4_protocol }} + protocol: {{ $port.l4_protocol }} +{{- else }} + protocol: TCP +{{- end }} +{{- end }} +{{- end }} +{{- end -}} + +{{- define "common.probePort" -}} +{{ default (first .Values.service.ports).targetPort .Values.service.probePort }} +{{- end -}} + +{{- define "common.tcpsocketReadinessProbe" -}} +{{- $dot := default . .dot -}} +{{- $port := default (include "common.probePort" $dot) .port -}} +readinessProbe: + tcpSocket: + port: {{ $port }} + initialDelaySeconds: {{ $dot.Values.readiness.initialDelaySeconds }} + periodSeconds: {{ $dot.Values.readiness.periodSeconds }} +{{- end -}} + +{{- define "common.tcpsocketLivenessProbe" -}} +{{- $dot := default . .dot -}} +{{- $port := default (include "common.probePort" $dot) .port -}} +livenessProbe: + tcpSocket: + port: {{ $port }} + initialDelaySeconds: {{ $dot.Values.liveness.initialDelaySeconds }} + periodSeconds: {{ $dot.Values.liveness.periodSeconds }} +{{- end -}} + +{{- define "common.tcpsocketProbes" -}} +{{- include "common.tcpsocketReadinessProbe" . }} +{{ include "common.tcpsocketLivenessProbe" . }} +{{- end -}} + +{{- define "common.httpLiveProbe" -}} +{{- $dot := default . .dot }} +{{- $path := default "/status" .path -}} +livenessProbe: + httpGet: + path: {{ $path }} + port: {{ include "common.probePort" . }} + initialDelaySeconds: {{ $dot.Values.liveness.initialDelaySeconds }} + periodSeconds: {{ $dot.Values.liveness.periodSeconds }} +{{- end -}} + +{{- define "common.applicationConfigMountName" -}} +{{ include "common.name" . }}-application-config +{{- end -}} + +{{- define "common.applicationConfigVolume" -}} +- name: {{ include "common.name" . }}-application-config + configMap: + name: {{ include "common.name" . }}-application-configmap +{{- end -}} + diff --git a/smo-install/oran_oom/nonrtric-common/templates/_rappcatalogueservice.tpl b/smo-install/oran_oom/nonrtric-common/templates/_rappcatalogueservice.tpl deleted file mode 100644 index 230c807b..00000000 --- a/smo-install/oran_oom/nonrtric-common/templates/_rappcatalogueservice.tpl +++ /dev/null @@ -1,24 +0,0 @@ -################################################################################ -# Copyright (c) 2020 Nordix Foundation. # -# # -# 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. # -################################################################################ - -{{- define "common.name.rappcatalogueservice" -}} - {{- printf "rappcatalogueservice" -}} -{{- end -}} - -{{- define "common.container.rappcatalogueservice" -}} - {{- $name := ( include "common.name.rappcatalogueservice" . ) -}} - {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} diff --git a/smo-install/oran_oom/nonrtric-common/templates/_service.tpl b/smo-install/oran_oom/nonrtric-common/templates/_service.tpl new file mode 100644 index 00000000..5b81c1d9 --- /dev/null +++ b/smo-install/oran_oom/nonrtric-common/templates/_service.tpl @@ -0,0 +1,137 @@ +{{/* +# Copyright © 2017 Amdocs, Bell Canada +# Modifications Copyright (c) 2024 NYCU WINLab. +# +# 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. +*/}} +{{/* + Resolve the name of a chart's service. + + The default will be the chart name (or .Values.nameOverride if set). + And the use of .Values.service.name overrides all. + + - .Values.service.name: override default service (ie. chart) name +*/}} +{{/* + Expand the service name for a chart. +*/}} +{{- define "common.servicename" -}} + {{- $name := default .Chart.Name .Values.nameOverride -}} + {{- default $name .Values.service.name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* Define the metadata of Service + The function takes from one to four arguments (inside a dictionary): + - .dot : environment (.) + - .suffix : a string which will be added at the end of the name (with a '-'). + - .annotations: the annotations to add + - .labels : labels to add + Usage example: + {{ include "common.serviceMetadata" ( dict "suffix" "myService" "dot" .) }} + {{ include "common.serviceMetadata" ( dict "annotations" .Values.service.annotation "dot" .) }} +*/}} + +{{- define "common.serviceMetadata" -}} + {{- $dot := default . .dot -}} + {{- $suffix := default "" .suffix -}} + {{- $annotations := default "" .annotations -}} + {{- $labels := default (dict) .labels -}} +{{- if $annotations -}} +annotations: +{{ include "common.tplValue" (dict "value" $annotations "context" $dot) | indent 2 }} +{{- end -}} +name: {{ include "common.servicename" $dot }}{{ if $suffix }}{{ print "-" $suffix }}{{ end }} +namespace: {{ include "common.namespace" $dot }} +labels: {{- include "common.labels" (dict "labels" $labels "dot" $dot) | nindent 2 -}} +{{- end -}} + +{{/* Define the ports of Service + The function takes three arguments (inside a dictionary): + - .dot : environment (.) + - .ports : an array of ports + - .serviceType: the type of the service +*/}} +{{- define "common.servicePorts" -}} +{{- $serviceType := .serviceType -}} +{{- $dot := .dot -}} +{{- range $index, $port := .ports -}} +{{- if $port.targetPort -}} +- name: {{ $port.name }} + port: {{ default $port.targetPort $port.internalPort }} + targetPort: {{ $port.targetPort }} +{{- if (and (eq $serviceType "NodePort") $port.nodePort) }} + nodePort: {{ $port.nodePort }} +{{- end }} +{{- if $port.l4_protocol }} + protocol: {{ $port.l4_protocol }} +{{- else }} + protocol: TCP +{{- end }} +{{- if $port.app_protocol }} + appProtocol: {{ $port.app_protocol }} +{{- end }} +{{- end }} +{{- if $port.internalPort_tls }} +- name: {{ $port.name_tls }} + port: {{ default $port.targetPort_tls $port.internalPort_tls }} + targetPort: {{ $port.targetPort_tls }} +{{- if (and (eq $serviceType "NodePort") $port.nodePort_tls) }} + nodePort: {{ $port.nodePort_tls }} +{{- end }} +{{- if $port.l4_protocol }} + protocol: {{ $port.l4_protocol }} +{{- else }} + protocol: TCP +{{- end }} +{{- if $port.app_protocol }} + appProtocol: {{ $port.app_protocol }} +{{- end }} +{{- end }} +{{ end }} +{{- end -}} + +{{/* Create generic service template + The function takes several arguments (inside a dictionary): + - .dot : environment (.) + - .ports : an array of ports + - .serviceType: the type of the service + - .suffix : a string which will be added at the end of the name (with a '-') + - .annotations: the annotations to add + - .publishNotReadyAddresses: if we publish not ready address + - .headless: if the service is headless + - .add_plain_port: add tls port AND plain port + - .labels : labels to add (dict) + - .matchLabels: selectors/machLabels to add (dict) +*/}} +{{- define "common.service" -}} +{{- $dot := default . .dot -}} +{{- $suffix := default "" $dot.Values.service.suffix -}} +{{- $annotations := default "" $dot.Values.service.annotations -}} +{{- $publishNotReadyAddresses := default false $dot.Values.service.publishNotReadyAddresses -}} +{{- $serviceType := $dot.Values.service.type -}} +{{- $ports := $dot.Values.service.ports -}} +{{- $labels := default (dict) .labels -}} +{{- $matchLabels := default (dict) .matchLabels -}} +{{- $ipFamilyPolicy := default "PreferDualStack" $dot.Values.service.ipFamilyPolicy -}} +apiVersion: v1 +kind: Service +metadata: {{- include "common.serviceMetadata" (dict "suffix" $suffix "annotations" $annotations "labels" $labels "dot" $dot) | nindent 2 }} +spec: + ports: {{- include "common.servicePorts" (dict "serviceType" $serviceType "ports" $ports "dot" $dot) | nindent 4 }} + ipFamilyPolicy: {{ $ipFamilyPolicy }} + {{- if $publishNotReadyAddresses }} + publishNotReadyAddresses: true + {{- end }} + type: {{ $serviceType }} + selector: {{- include "common.matchLabels" (dict "matchLabels" $matchLabels "dot" $dot) | nindent 4 }} +{{- end -}} diff --git a/smo-install/oran_oom/nonrtric-common/templates/_policymanagementservice.tpl b/smo-install/oran_oom/nonrtric-common/templates/_statefulset.tpl similarity index 72% rename from smo-install/oran_oom/nonrtric-common/templates/_policymanagementservice.tpl rename to smo-install/oran_oom/nonrtric-common/templates/_statefulset.tpl index b265ec34..b0753abe 100644 --- a/smo-install/oran_oom/nonrtric-common/templates/_policymanagementservice.tpl +++ b/smo-install/oran_oom/nonrtric-common/templates/_statefulset.tpl @@ -1,5 +1,6 @@ +{{/* ################################################################################ -# Copyright (c) 2020 Nordix Foundation. # +# Copyright (c) 2024 NYCU WINLab. # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # @@ -13,12 +14,19 @@ # See the License for the specific language governing permissions and # # limitations under the License. # ################################################################################ +*/}} -{{- define "common.name.policymanagementservice" -}} - {{- printf "policymanagementservice" -}} +{{- define "common.vardataVolumeClaimTemplate" -}} +- metadata: + name: {{ include "common.name" . }}-vardata + spec: + accessModes: [ ReadWriteOnce ] + storageClassName: "{{ .Values.persistence.storageClassName }}" + resources: + requests: + storage: "{{ .Values.persistence.size }}" {{- end -}} -{{- define "common.container.policymanagementservice" -}} - {{- $name := ( include "common.name.policymanagementservice" . ) -}} - {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- define "common.vardataMountName" -}} +{{ include "common.name" . }}-vardata {{- end -}} diff --git a/smo-install/oran_oom/nonrtric-common/templates/_utils.tpl b/smo-install/oran_oom/nonrtric-common/templates/_utils.tpl new file mode 100644 index 00000000..b74ecbda --- /dev/null +++ b/smo-install/oran_oom/nonrtric-common/templates/_utils.tpl @@ -0,0 +1,28 @@ +{{/* +# Copyright © 2019 Orange +# +# 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. +*/}} + +{{/* +Renders a value that contains template. +Usage: +{{ include "common.tplValue" ( dict "value" .Values.path.to.the.Value "context" $) }} +*/}} +{{- define "common.tplValue" -}} + {{- if typeIs "string" .value }} + {{- tpl .value .context }} + {{- else }} + {{- tpl (.value | toYaml) .context }} + {{- end }} +{{- end -}} diff --git a/smo-install/oran_oom/nonrtric-common/values.yaml b/smo-install/oran_oom/nonrtric-common/values.yaml index 10520add..993d88d5 100644 --- a/smo-install/oran_oom/nonrtric-common/values.yaml +++ b/smo-install/oran_oom/nonrtric-common/values.yaml @@ -12,4 +12,4 @@ # 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. # -################################################################################ \ No newline at end of file +################################################################################ diff --git a/smo-install/oran_oom/nonrtric/templates/pv1.yaml b/smo-install/oran_oom/nonrtric/templates/pv1.yaml index b600c991..25440720 100644 --- a/smo-install/oran_oom/nonrtric/templates/pv1.yaml +++ b/smo-install/oran_oom/nonrtric/templates/pv1.yaml @@ -20,7 +20,7 @@ kind: PersistentVolume apiVersion: v1 metadata: name: nonrtric-pv1 - namespace: {{ include "common.namespace.nonrtric" . }} + namespace: {{ include "common.namespace" . }} spec: capacity: storage: {{ .Values.nonrtric.volume1.size}} diff --git a/smo-install/oran_oom/nonrtric/templates/pv2.yaml b/smo-install/oran_oom/nonrtric/templates/pv2.yaml index cdf5eaf3..50ff421f 100644 --- a/smo-install/oran_oom/nonrtric/templates/pv2.yaml +++ b/smo-install/oran_oom/nonrtric/templates/pv2.yaml @@ -20,7 +20,7 @@ kind: PersistentVolume apiVersion: v1 metadata: name: nonrtric-pv2 - namespace: {{ include "common.namespace.nonrtric" . }} + namespace: {{ include "common.namespace" . }} spec: capacity: storage: {{ .Values.nonrtric.volume2.size }} diff --git a/smo-install/oran_oom/nonrtric/templates/pv3.yaml b/smo-install/oran_oom/nonrtric/templates/pv3.yaml index 90ed1aa9..c29edd3b 100644 --- a/smo-install/oran_oom/nonrtric/templates/pv3.yaml +++ b/smo-install/oran_oom/nonrtric/templates/pv3.yaml @@ -20,7 +20,7 @@ kind: PersistentVolume apiVersion: v1 metadata: name: nonrtric-pv3 - namespace: {{ include "common.namespace.nonrtric" . }} + namespace: {{ include "common.namespace" . }} spec: capacity: storage: {{ .Values.nonrtric.volume3.size }} diff --git a/smo-install/oran_oom/nonrtric/values.yaml b/smo-install/oran_oom/nonrtric/values.yaml index 8fdcebb7..441ef31d 100644 --- a/smo-install/oran_oom/nonrtric/values.yaml +++ b/smo-install/oran_oom/nonrtric/values.yaml @@ -15,6 +15,15 @@ # limitations under the License. # ============LICENSE_END================================================= +global: + ingress: + # generally enable ingress for components + enabled: true + # enable all component's Ingress interfaces + enable_all: false + # Ingress class (only for provider "ingress"): e.g. kong, nginx, traefik + ingressClass: + nonrtric: persistence: mountPath: /dockerdata-nfs @@ -51,5 +60,3 @@ kong: installCRDs: false admin: enabled: true -cert-wrapper: - enabled: true diff --git a/smo-install/oran_oom/nonrtricgateway/Chart.yaml b/smo-install/oran_oom/nonrtricgateway/Chart.yaml index 9ca9e2d2..93f4c81f 100644 --- a/smo-install/oran_oom/nonrtricgateway/Chart.yaml +++ b/smo-install/oran_oom/nonrtricgateway/Chart.yaml @@ -23,4 +23,4 @@ version: 1.0.0 dependencies: - name: nonrtric-common version: ^2.0.0 - repository: "@local" \ No newline at end of file + repository: "@local" diff --git a/smo-install/oran_oom/nonrtricgateway/resources/config/application.yaml b/smo-install/oran_oom/nonrtricgateway/resources/config/application.yaml deleted file mode 100644 index e70ae122..00000000 --- a/smo-install/oran_oom/nonrtricgateway/resources/config/application.yaml +++ /dev/null @@ -1,52 +0,0 @@ -################################################################################ -# Copyright (c) 2021 Nordix Foundation. # -# # -# 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. # -################################################################################ - -server: - port: 9090 -spring: - cloud: - gateway: - httpclient: - ssl: - useInsecureTrustManager: true - wiretap: true - httpserver: - wiretap: true - routes: - - id: A1-Policy - uri: {{ .Values.a1PolicyLink }} - predicates: - - Path=/a1-policy/** - - id: A1-EI - uri: https://informationservice:9083 - predicates: - - Path=/data-producer/**,/data-consumer/** -management: - endpoint: - gateway: - enabled: true - endpoints: - web: - exposure: - include: "gateway,loggers,logfile,health,info,metrics,threaddump,heapdump" -logging: - level: - ROOT: ERROR - org.springframework: ERROR - org.springframework.cloud.gateway: INFO - reactor.netty: INFO - file: - name: /var/log/nonrtric-gateway/application.log diff --git a/smo-install/oran_oom/nonrtricgateway/templates/configmap.yaml b/smo-install/oran_oom/nonrtricgateway/templates/configmap.yaml index d391d1ee..12850df1 100644 --- a/smo-install/oran_oom/nonrtricgateway/templates/configmap.yaml +++ b/smo-install/oran_oom/nonrtricgateway/templates/configmap.yaml @@ -14,16 +14,4 @@ # limitations under the License. # ################################################################################ - -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "common.name.nonrtricgateway" . }}-configmap - namespace: {{ include "common.namespace.nonrtric" . }} - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.nonrtricgateway" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: -{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }} \ No newline at end of file +{{ include "common.applicationConfigmap" . }} diff --git a/smo-install/oran_oom/nonrtricgateway/templates/deployment.yaml b/smo-install/oran_oom/nonrtricgateway/templates/deployment.yaml index bd742a9a..02789f18 100644 --- a/smo-install/oran_oom/nonrtricgateway/templates/deployment.yaml +++ b/smo-install/oran_oom/nonrtricgateway/templates/deployment.yaml @@ -16,51 +16,21 @@ kind: Deployment apiVersion: apps/v1 -metadata: - name: {{ include "common.name.nonrtricgateway" . }} - namespace: {{ include "common.namespace.nonrtric" . }} - generation: 1 - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.nonrtricgateway" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} - annotations: - deployment.kubernetes.io/revision: '1' +metadata: {{- include "common.resourceMetadata" . | nindent 2 }} spec: replicas: 1 - selector: - matchLabels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.nonrtricgateway" . }} - release: {{ .Release.Name }} + selector: {{- include "common.selectors" . | nindent 4 }} template: - metadata: - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.nonrtricgateway" . }} - release: {{ .Release.Name }} + metadata: {{- include "common.templateMetadata" . | nindent 6 }} spec: - hostname: {{ include "common.name.nonrtricgateway" . }} + hostname: {{ include "common.name" . }} containers: - - name: {{ include "common.container.nonrtricgateway" . }} - image: {{ .Values.nonrtricgateway.image.registry }}/{{ .Values.nonrtricgateway.image.name }}:{{ .Values.nonrtricgateway.image.tag }} - imagePullPolicy: {{ .Values.nonrtricgateway.imagePullPolicy }} - ports: - - containerPort: {{ .Values.nonrtricgateway.service.targetPort1 }} - protocol: TCP - readinessProbe: - tcpSocket: - port: {{ .Values.nonrtricgateway.service.targetPort1 }} - initialDelaySeconds: {{ .Values.nonrtricgateway.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.nonrtricgateway.liveness.periodSeconds }} - livenessProbe: - tcpSocket: - port: {{ .Values.nonrtricgateway.service.targetPort1 }} - initialDelaySeconds: {{ .Values.nonrtricgateway.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.nonrtricgateway.liveness.periodSeconds }} - volumeMounts: - - name: {{ include "common.name.nonrtricgateway" . }}-config - mountPath: /opt/app/nonrtric-gateway/config - volumes: - - name: {{ include "common.name.nonrtricgateway" . }}-config - configMap: - name: {{ include "common.name.nonrtricgateway" . }}-configmap \ No newline at end of file + - name: {{ include "common.containername" . }} + image: {{ .Values.image.registry }}/{{ .Values.image.name }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.imagePullPolicy }} + ports: {{- include "common.containerPorts" . | nindent 10 }} + {{- include "common.tcpsocketProbes" . | nindent 10 }} + volumeMounts: + - name: {{ include "common.applicationConfigMountName" . }} + mountPath: /opt/app/nonrtric-gateway/config + volumes: {{- include "common.applicationConfigVolume" . | nindent 8 }} diff --git a/smo-install/oran_oom/nonrtricgateway/templates/service.yaml b/smo-install/oran_oom/nonrtricgateway/templates/service.yaml index 085c0e65..48461ebd 100644 --- a/smo-install/oran_oom/nonrtricgateway/templates/service.yaml +++ b/smo-install/oran_oom/nonrtricgateway/templates/service.yaml @@ -14,24 +14,4 @@ # limitations under the License. # ################################################################################ -kind: Service -apiVersion: v1 -metadata: - name: {{ include "common.name.nonrtricgateway" . }} - namespace: {{ include "common.namespace.nonrtric" . }} - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.nonrtricgateway" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - ports: - - name: {{ index .Values.nonrtricgateway.service.httpName }} - port: {{ .Values.nonrtricgateway.service.internalPort1 }} - targetPort: {{ .Values.nonrtricgateway.service.targetPort1 }} - nodePort: {{ .Values.nonrtricgateway.service.externalPort1 }} - protocol: TCP - selector: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.nonrtricgateway" . }} - release: {{ .Release.Name }} - type: NodePort +{{ include "common.service" . }} diff --git a/smo-install/oran_oom/nonrtricgateway/values.yaml b/smo-install/oran_oom/nonrtricgateway/values.yaml index 8625a85c..c37308eb 100644 --- a/smo-install/oran_oom/nonrtricgateway/values.yaml +++ b/smo-install/oran_oom/nonrtricgateway/values.yaml @@ -18,21 +18,62 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -nonrtricgateway: - imagePullPolicy: IfNotPresent - image: - registry: 'nexus3.o-ran-sc.org:10002/o-ran-sc' - name: nonrtric-gateway - tag: 1.2.0 - service: - httpName: http - internalPort1: 9090 - targetPort1: 9090 - externalPort1: 30093 - liveness: - initialDelaySeconds: 20 - periodSeconds: 10 - readiness: - initialDelaySeconds: 20 - periodSeconds: 10 -a1PolicyLink: http://a1policymanagement.onap:8081 +imagePullPolicy: IfNotPresent +image: + registry: 'nexus3.o-ran-sc.org:10002/o-ran-sc' + name: nonrtric-gateway + tag: 1.2.0 +service: + type: NodePort + ports: + - name: http + internalPort: "9090" + targetPort: "9090" + nodePort: "30093" + +liveness: + initialDelaySeconds: 20 + periodSeconds: 10 +readiness: + initialDelaySeconds: 20 + periodSeconds: 10 + +a1PolicyLink: &a1PolicyLink http://a1policymanagement.onap:8081 + +application: + server: + port: 9090 + spring: + cloud: + gateway: + httpclient: + ssl: + useInsecureTrustManager: true + wiretap: true + httpserver: + wiretap: true + routes: + - id: A1-Policy + uri: *a1PolicyLink + predicates: + - Path=/a1-policy/** + - id: A1-EI + uri: https://informationservice:9083 + predicates: + - Path=/data-producer/**,/data-consumer/** + management: + endpoint: + gateway: + enabled: true + endpoints: + web: + exposure: + include: "gateway,loggers,logfile,health,info,metrics,threaddump,heapdump" + logging: + level: + ROOT: ERROR + org.springframework: ERROR + org.springframework.cloud.gateway: INFO + reactor.netty: INFO + file: + name: /var/log/nonrtric-gateway/application.log diff --git a/smo-install/oran_oom/odu-app-ics-version/Chart.yaml b/smo-install/oran_oom/odu-app-ics-version/Chart.yaml index 830e4b4f..24949acb 100755 --- a/smo-install/oran_oom/odu-app-ics-version/Chart.yaml +++ b/smo-install/oran_oom/odu-app-ics-version/Chart.yaml @@ -3,3 +3,8 @@ appVersion: "1.0.0" description: A Helm chart to deploy odu-app-ics-version version name: odu-app-ics-version version: 1.0.0 + +dependencies: + - name: nonrtric-common + version: ^2.0.0 + repository: "@local" diff --git a/smo-install/oran_oom/odu-app-ics-version/templates/_helpers.tpl b/smo-install/oran_oom/odu-app-ics-version/templates/_helpers.tpl deleted file mode 100755 index 8f0fc56d..00000000 --- a/smo-install/oran_oom/odu-app-ics-version/templates/_helpers.tpl +++ /dev/null @@ -1,79 +0,0 @@ -{{/* -# Copyright (C) 2021 Nordix Foundation. All rights reserved. -# ======================================================================== -# 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. -# ============LICENSE_END================================================= -*/}} - -{{/* -Expand the name of the chart. -*/}} -{{- define "odu-app-ics-version.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 "odu-app-ics-version.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 "odu-app-ics-version.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "odu-app-ics-version.labels" -}} -helm.sh/chart: {{ include "odu-app-ics-version.chart" . }} -{{ include "odu-app-ics-version.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "odu-app-ics-version.selectorLabels" -}} -app.kubernetes.io/name: {{ include "odu-app-ics-version.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "odu-app-ics-version.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "odu-app-ics-version.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/smo-install/oran_oom/odu-app-ics-version/templates/deployment.yaml b/smo-install/oran_oom/odu-app-ics-version/templates/deployment.yaml index f431a398..c5b55204 100755 --- a/smo-install/oran_oom/odu-app-ics-version/templates/deployment.yaml +++ b/smo-install/oran_oom/odu-app-ics-version/templates/deployment.yaml @@ -15,23 +15,12 @@ apiVersion: apps/v1 kind: Deployment -metadata: - name: {{ include "odu-app-ics-version.fullname" . }} - labels: - {{- include "odu-app-ics-version.labels" . | nindent 4 }} +metadata: {{- include "common.resourceMetadata" . | nindent 2 }} spec: replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "odu-app-ics-version.selectorLabels" . | nindent 6 }} + selector: {{- include "common.selectors" . | nindent 4 }} template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "odu-app-ics-version.selectorLabels" . | nindent 8 }} + metadata: {{- include "common.templateMetadata" . | nindent 6 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: @@ -40,7 +29,7 @@ spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - - name: {{ .Chart.Name }} + - name: {{ include "common.containername" . }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" diff --git a/smo-install/oran_oom/odu-app-ics-version/templates/service.yaml b/smo-install/oran_oom/odu-app-ics-version/templates/service.yaml index aad3ac1c..0f0441c2 100755 --- a/smo-install/oran_oom/odu-app-ics-version/templates/service.yaml +++ b/smo-install/oran_oom/odu-app-ics-version/templates/service.yaml @@ -13,18 +13,4 @@ # limitations under the License. # ============LICENSE_END================================================= -apiVersion: v1 -kind: Service -metadata: - name: {{ include "odu-app-ics-version.fullname" . }} - labels: - {{- include "odu-app-ics-version.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - selector: - {{- include "odu-app-ics-version.selectorLabels" . | nindent 4 }} +{{ include "common.service" . }} diff --git a/smo-install/oran_oom/odu-app-ics-version/values.yaml b/smo-install/oran_oom/odu-app-ics-version/values.yaml index 54650dbd..27e861dc 100755 --- a/smo-install/oran_oom/odu-app-ics-version/values.yaml +++ b/smo-install/oran_oom/odu-app-ics-version/values.yaml @@ -59,7 +59,9 @@ securityContext: {} service: type: ClusterIP - port: 8095 + ports: + - name: http + targetPort: 8095 resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/smo-install/oran_oom/odu-app/Chart.yaml b/smo-install/oran_oom/odu-app/Chart.yaml index a08d02b1..fa4e5ecf 100755 --- a/smo-install/oran_oom/odu-app/Chart.yaml +++ b/smo-install/oran_oom/odu-app/Chart.yaml @@ -3,3 +3,8 @@ appVersion: "1.0.0" description: A Helm chart to deploy odu-app smo version name: odu-app version: 1.0.0 + +dependencies: + - name: nonrtric-common + version: ^2.0.0 + repository: "@local" diff --git a/smo-install/oran_oom/odu-app/templates/_helpers.tpl b/smo-install/oran_oom/odu-app/templates/_helpers.tpl deleted file mode 100755 index 0220d2e2..00000000 --- a/smo-install/oran_oom/odu-app/templates/_helpers.tpl +++ /dev/null @@ -1,79 +0,0 @@ -{{/* -# Copyright (C) 2021 Nordix Foundation. All rights reserved. -# ======================================================================== -# 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. -# ============LICENSE_END================================================= -*/}} - -{{/* -Expand the name of the chart. -*/}} -{{- define "odu-app.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 "odu-app.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 "odu-app.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "odu-app.labels" -}} -helm.sh/chart: {{ include "odu-app.chart" . }} -{{ include "odu-app.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "odu-app.selectorLabels" -}} -app.kubernetes.io/name: {{ include "odu-app.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "odu-app.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "odu-app.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/smo-install/oran_oom/odu-app/templates/deployment.yaml b/smo-install/oran_oom/odu-app/templates/deployment.yaml index 7978f8fa..8a2f0984 100755 --- a/smo-install/oran_oom/odu-app/templates/deployment.yaml +++ b/smo-install/oran_oom/odu-app/templates/deployment.yaml @@ -15,23 +15,12 @@ apiVersion: apps/v1 kind: Deployment -metadata: - name: {{ include "odu-app.fullname" . }} - labels: - {{- include "odu-app.labels" . | nindent 4 }} +metadata: {{- include "common.resourceMetadata" . | nindent 2 }} spec: replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "odu-app.selectorLabels" . | nindent 6 }} + selector: {{- include "common.selectors" . | nindent 4 }} template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "odu-app.selectorLabels" . | nindent 8 }} + metadata: {{- include "common.templateMetadata" . | nindent 6 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: @@ -40,7 +29,7 @@ spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - - name: {{ .Chart.Name }} + - name: {{ include "common.containername" . }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" @@ -58,10 +47,7 @@ spec: value: "{{ .Values.sdnr.password }}" - name: NODE_ID value: "{{ .Values.simulator.node }}" - ports: - - name: http - containerPort: 80 - protocol: TCP + ports: {{- include "common.containerPorts" . | nindent 10 }} resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} diff --git a/smo-install/oran_oom/odu-app/templates/service.yaml b/smo-install/oran_oom/odu-app/templates/service.yaml index 6c64790d..0f0441c2 100755 --- a/smo-install/oran_oom/odu-app/templates/service.yaml +++ b/smo-install/oran_oom/odu-app/templates/service.yaml @@ -13,18 +13,4 @@ # limitations under the License. # ============LICENSE_END================================================= -apiVersion: v1 -kind: Service -metadata: - name: {{ include "odu-app.fullname" . }} - labels: - {{- include "odu-app.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - selector: - {{- include "odu-app.selectorLabels" . | nindent 4 }} +{{ include "common.service" . }} diff --git a/smo-install/oran_oom/odu-app/values.yaml b/smo-install/oran_oom/odu-app/values.yaml index 8c97d648..96fbe076 100755 --- a/smo-install/oran_oom/odu-app/values.yaml +++ b/smo-install/oran_oom/odu-app/values.yaml @@ -56,7 +56,9 @@ securityContext: {} service: type: ClusterIP - port: 80 + ports: + - name: http + targetPort: 80 resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/smo-install/oran_oom/oru-app/Chart.yaml b/smo-install/oran_oom/oru-app/Chart.yaml index 680882a1..aee48e47 100644 --- a/smo-install/oran_oom/oru-app/Chart.yaml +++ b/smo-install/oran_oom/oru-app/Chart.yaml @@ -3,3 +3,8 @@ appVersion: "1.0.0" description: A Helm chart to deploy oru-app name: oru-app version: 1.0.0 + +dependencies: + - name: nonrtric-common + version: ^2.0.0 + repository: "@local" diff --git a/smo-install/oran_oom/oru-app/templates/configmap.yaml b/smo-install/oran_oom/oru-app/templates/configmap.yaml index 259387f4..b417a21f 100644 --- a/smo-install/oran_oom/oru-app/templates/configmap.yaml +++ b/smo-install/oran_oom/oru-app/templates/configmap.yaml @@ -1,10 +1,5 @@ apiVersion: v1 kind: ConfigMap -metadata: - name: oru-app-configmap - labels: - name: oru-app - release: {{ .Release.Name }} - chart: {{ .Chart.Name }} +metadata: {{ include "common.resourceMetadata" . | nindent 2 }} data: {{ tpl (.Files.Glob "resources/config/*.{json,xml,txt}").AsConfig . | indent 2 }} diff --git a/smo-install/oran_oom/oru-app/templates/configmapenv.yaml b/smo-install/oran_oom/oru-app/templates/configmapenv.yaml index 3a10003f..72a9ffae 100644 --- a/smo-install/oran_oom/oru-app/templates/configmapenv.yaml +++ b/smo-install/oran_oom/oru-app/templates/configmapenv.yaml @@ -1,15 +1,9 @@ apiVersion: v1 kind: ConfigMap -metadata: - name: oru-app-configmapenv - labels: - name: oru-app-env - release: {{ .Release.Name }} - chart: {{ .Chart.Name }} +metadata: {{ include "common.resourceMetadata" (dict "suffix" "configmapenv" "dot" . ) | nindent 2 }} data: MR-HOST: {{ .Values.conf.mrHost | quote }} - MR-PORT: {{ .Values.conf.mrPort | quote }} + MR-PORT: {{ .Values.conf.mrPort | quote }} SDNR-HOST: {{ .Values.conf.sdnrHost | quote }} SDNR-PORT: {{ .Values.conf.sdnrPort | quote }} VERBOSE: {{ .Values.conf.verbose | quote }} - diff --git a/smo-install/oran_oom/oru-app/templates/deployment.yaml b/smo-install/oran_oom/oru-app/templates/deployment.yaml index 6999b957..e13084e6 100644 --- a/smo-install/oran_oom/oru-app/templates/deployment.yaml +++ b/smo-install/oran_oom/oru-app/templates/deployment.yaml @@ -1,32 +1,21 @@ apiVersion: apps/v1 kind: Deployment -metadata: - name: oru-app - labels: - name: oru-app - release: {{ .Release.Name }} - chart: {{ .Chart.Name }} +metadata: {{- include "common.resourceMetadata" . | nindent 2 }} spec: replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - name: oru-app + selector: {{- include "common.selectors" . | nindent 4 }} template: - metadata: - labels: - name: oru-app - release: {{ .Release.Name }} - chart: {{ .Chart.Name }} + metadata: {{- include "common.templateMetadata" . | nindent 6 }} spec: containers: - - name: {{ .Chart.Name }} + - name: {{ include "common.containername" . }} image: "{{ .Values.image.repository }}/{{ .Values.image.name}}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} tty: true stdin: true envFrom: - configMapRef: - name: oru-app-configmapenv + name: {{ include "common.name" . }}-configmapenv volumeMounts: - name: oru-app-config-volume subPath: o-ru-to-o-du-map.txt @@ -39,7 +28,7 @@ spec: volumes: - name: oru-app-config-volume configMap: - name: oru-app-configmap + name: {{ include "common.name" . }} items: - key: o-ru-to-o-du-map.txt path: o-ru-to-o-du-map.txt diff --git a/smo-install/oran_oom/oru-app/templates/service.yaml b/smo-install/oran_oom/oru-app/templates/service.yaml index 46d78c6c..f024c648 100644 --- a/smo-install/oran_oom/oru-app/templates/service.yaml +++ b/smo-install/oran_oom/oru-app/templates/service.yaml @@ -1,17 +1 @@ -apiVersion: v1 -kind: Service -metadata: - name: "oru-app" - labels: - name: oru-app - release: {{ .Release.Name }} - chart: {{ .Chart.Name }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.ports.port }} - nodePort: {{ .Values.service.ports.nodePort }} - selector: - name: oru-app - release: {{ .Release.Name }} - chart: {{ .Chart.Name }} +{{ include "common.service" . }} diff --git a/smo-install/oran_oom/oru-app/values.yaml b/smo-install/oran_oom/oru-app/values.yaml index 66b2f15d..45c5b994 100644 --- a/smo-install/oran_oom/oru-app/values.yaml +++ b/smo-install/oran_oom/oru-app/values.yaml @@ -9,7 +9,8 @@ image: service: type: NodePort ports: - port: 830 + - name: http + targetPort: 830 nodePort: 30835 simulators: diff --git a/smo-install/oran_oom/policymanagementservice/Chart.yaml b/smo-install/oran_oom/policymanagementservice/Chart.yaml index 5b5c0c6e..f47bc806 100644 --- a/smo-install/oran_oom/policymanagementservice/Chart.yaml +++ b/smo-install/oran_oom/policymanagementservice/Chart.yaml @@ -23,4 +23,4 @@ version: 2.0.0 dependencies: - name: nonrtric-common version: ^2.0.0 - repository: "@local" \ No newline at end of file + repository: "@local" diff --git a/smo-install/oran_oom/policymanagementservice/resources/config/application.yaml b/smo-install/oran_oom/policymanagementservice/resources/config/application.yaml deleted file mode 100644 index ffb6f8ca..00000000 --- a/smo-install/oran_oom/policymanagementservice/resources/config/application.yaml +++ /dev/null @@ -1,76 +0,0 @@ -################################################################################ -# Copyright (c) 2020 Nordix Foundation. # -# # -# 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. # -################################################################################ - -spring: - profiles: - active: prod - main: - allow-bean-definition-overriding: true - aop: - auto: false -management: - endpoints: - web: - exposure: - # Enabling of springboot actuator features. See springboot documentation. - include: "loggers,logfile,health,info,metrics,threaddump,heapdump" - -logging: - # Configuration of logging - level: - ROOT: ERROR - org.springframework: ERROR - org.springframework.data: ERROR - org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR - org.onap.ccsdk.oran.a1policymanagementservice: INFO - file: - name: /var/log/policy-agent/application.log - -server: - # Configuration of the HTTP/REST server. The parameters are defined and handeled by the springboot framework. - # See springboot documentation. - port : 8433 - http-port: 8081 - ssl: - key-store-type: JKS - key-store-password: policy_agent - key-store: /opt/app/policy-agent/etc/cert/keystore.jks - key-password: policy_agent - key-alias: policy_agent -app: - # Location of the component configuration file. The file will only be used if the Consul database is not used; - # configuration from the Consul will override the file. - filepath: /var/policy-management-service/application_configuration.json - webclient: - # Configuration of the trust store used for the HTTP client (outgoing requests) - # The file location and the password for the truststore is only relevant if trust-store-used == true - # Note that the same keystore as for the server is used. - trust-store-used: false - trust-store-password: policy_agent - trust-store: /opt/app/policy-agent/etc/cert/truststore.jks - # Configuration of usage of HTTP Proxy for the southbound accesses. - # The HTTP proxy (if configured) will only be used for accessing NearRT RIC:s - http.proxy-host: - http.proxy-port: 0 - http.proxy-type: HTTP - # path where the service can store data - vardata-directory: /var/policy-management-service - # the config-file-schema-path referres to a location in the jar file. If this property is empty or missing, - # no schema validation will be executed. - config-file-schema-path: /application_configuration_schema.json - # A file containing an authorization token, which shall be inserted in each HTTP header (authorization). - # If the file name is empty, no authorization token is sent. - auth-token-file: diff --git a/smo-install/oran_oom/policymanagementservice/resources/data/application_configuration.json b/smo-install/oran_oom/policymanagementservice/resources/data/application_configuration.json deleted file mode 100644 index 56e96aab..00000000 --- a/smo-install/oran_oom/policymanagementservice/resources/data/application_configuration.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "config":{ - "controller": [ - { - "name": "controller1", - "baseUrl": "https://a1controller:8383", - "userName": "admin", - "password": "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U" - } - ], - "ric": [ - { - "name":"ric1", - "baseUrl":"https://a1-sim-osc-0:8185", - "controller": "controller1", - "managedElementIds":[ - "kista_1", - "kista_2" - ] - }, - { - "name":"ric2", - "baseUrl":"https://a1-sim-osc-1:8185", - "controller": "controller1", - "managedElementIds":[ - "kista_1", - "kista_2" - ] - }, - { - "name":"ric3", - "baseUrl":"https://a1-sim-std-0:8185", - "controller": "controller1", - "managedElementIds":[ - "kista_1", - "kista_2" - ] - }, - { - "name":"ric4", - "baseUrl":"https://a1-sim-std-1:8185", - "controller": "controller1", - "managedElementIds":[ - "kista_1", - "kista_2" - ] - }, - { - "name":"ric5", - "baseUrl":"https://a1-sim-std2-0:8185", - "controller": "controller1", - "managedElementIds":[ - "kista_1", - "kista_2" - ] - }, - { - "name":"ric6", - "baseUrl":"https://a1-sim-std2-1:8185", - "controller": "controller1", - "managedElementIds":[ - "kista_1", - "kista_2" - ] - } - ], - "streams_publishes": { - "dmaap_publisher": { - "type":"message_router", - "dmaap_info":{ - "topic_url":"http://message-router.onap:3904/events/A1-POLICY-AGENT-WRITE" - } - } - }, - "streams_subscribes": { - "dmaap_subscriber":{ - "type":"message_router", - "dmaap_info":{ - "topic_url":"http://message-router.onap:3904/events/A1-POLICY-AGENT-READ/users/policy-agent?timeout=15000&limit=100" - } - } - } - } -} diff --git a/smo-install/oran_oom/policymanagementservice/templates/configmap.yaml b/smo-install/oran_oom/policymanagementservice/templates/configmap.yaml index 9c91f7d0..20271d72 100644 --- a/smo-install/oran_oom/policymanagementservice/templates/configmap.yaml +++ b/smo-install/oran_oom/policymanagementservice/templates/configmap.yaml @@ -14,29 +14,11 @@ # limitations under the License. # ################################################################################ - -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "common.name.policymanagementservice" . }}-configmap-config - namespace: {{ include "common.namespace.nonrtric" . }} - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.policymanagementservice" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: -{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }} +{{ include "common.applicationConfigmap" . }} --- apiVersion: v1 kind: ConfigMap -metadata: - name: {{ include "common.name.policymanagementservice" . }}-configmap-data - namespace: {{ include "common.namespace.nonrtric" . }} - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.policymanagementservice" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} +metadata: {{ include "common.resourceMetadata" (dict "suffix" "data-configmap" "dot" . ) | nindent 2 }} data: -{{ tpl (.Files.Glob "resources/data/*").AsConfig . | indent 2 }} \ No newline at end of file + application_configuration.json: | + {{- .Values.config | toRawJson | nindent 4 }} diff --git a/smo-install/oran_oom/policymanagementservice/templates/ingress.yaml b/smo-install/oran_oom/policymanagementservice/templates/ingress.yaml index e9158e2c..9a20b72b 100644 --- a/smo-install/oran_oom/policymanagementservice/templates/ingress.yaml +++ b/smo-install/oran_oom/policymanagementservice/templates/ingress.yaml @@ -16,13 +16,10 @@ ################################################################################ */}} -{{- if .Values.policymanagementservice.ingress.enabled -}} +{{- if (include "common.ingressEnabled" .) -}} apiVersion: networking.k8s.io/v1 kind: Ingress -metadata: - name: {{ include "common.name.policymanagementservice" . }} - namespace: {{ include "common.namespace.nonrtric" . }} - +metadata: {{- include "common.resourceMetadata" . | nindent 2 }} spec: ingressClassName: {{ include "common.ingressClassName" . }} rules: @@ -30,9 +27,9 @@ spec: paths: - backend: service: - name: {{ include "common.name.policymanagementservice" . }} + name: {{ include "common.name" . }} port: - number: {{ .Values.policymanagementservice.service.internalPort1 }} + number: {{ (first .Values.service.ports).internalPort }} path: "/a1-policy" pathType: Prefix {{- end -}} diff --git a/smo-install/oran_oom/policymanagementservice/templates/service.yaml b/smo-install/oran_oom/policymanagementservice/templates/service.yaml index 6d820e21..be38ac46 100644 --- a/smo-install/oran_oom/policymanagementservice/templates/service.yaml +++ b/smo-install/oran_oom/policymanagementservice/templates/service.yaml @@ -14,29 +14,4 @@ # limitations under the License. # ################################################################################ -kind: Service -apiVersion: v1 -metadata: - name: {{ include "common.name.policymanagementservice" . }} - namespace: {{ include "common.namespace.nonrtric" . }} - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.policymanagementservice" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - ports: - {{if eq .Values.policymanagementservice.service.allowHttp true -}} - - name: {{ index .Values.policymanagementservice.service.httpName }} - port: {{ .Values.policymanagementservice.service.internalPort1 }} - targetPort: {{ .Values.policymanagementservice.service.targetPort1 }} - protocol: TCP - {{- end }} - - name: {{ index .Values.policymanagementservice.service.httpsName }} - port: {{ .Values.policymanagementservice.service.internalPort2 }} - targetPort: {{ .Values.policymanagementservice.service.targetPort2 }} - protocol: TCP - selector: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.policymanagementservice" . }} - release: {{ .Release.Name }} - type: ClusterIP +{{ include "common.service" . }} diff --git a/smo-install/oran_oom/policymanagementservice/templates/statefulset.yaml b/smo-install/oran_oom/policymanagementservice/templates/statefulset.yaml index 0930d074..5986f83f 100644 --- a/smo-install/oran_oom/policymanagementservice/templates/statefulset.yaml +++ b/smo-install/oran_oom/policymanagementservice/templates/statefulset.yaml @@ -16,31 +16,15 @@ kind: StatefulSet apiVersion: apps/v1 -metadata: - name: {{ include "common.name.policymanagementservice" . }} - namespace: {{ include "common.namespace.nonrtric" . }} - generation: 1 - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.policymanagementservice" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} - annotations: - deployment.kubernetes.io/revision: '1' +metadata: {{- include "common.resourceMetadata" . | nindent 2 }} spec: - serviceName: {{ include "common.name.policymanagementservice" . }} + serviceName: {{ include "common.name" . }} replicas: 1 - selector: - matchLabels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.policymanagementservice" . }} - release: {{ .Release.Name }} + selector: {{- include "common.selectors" . | nindent 4 }} template: - metadata: - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.policymanagementservice" . }} - release: {{ .Release.Name }} + metadata: {{- include "common.templateMetadata" . | nindent 6 }} spec: - hostname: {{ include "common.name.policymanagementservice" . }} + hostname: {{ include "common.name" . }} initContainers: - name: copy image: busybox:1.28 @@ -50,53 +34,30 @@ spec: - FILE=/var/policy-management-service/application_configuration.json; if [ ! -f $FILE ]; then cp /etc/app/policy-management-service/initialdata/application_configuration.json $FILE; - fi + fi; + chmod 666 $FILE; volumeMounts: - - name: {{ include "common.name.policymanagementservice" . }}-vardata + - name: {{ include "common.vardataMountName" . }} mountPath: "/var/policy-management-service" - - name: {{ include "common.name.policymanagementservice" . }}-policy-data + - name: {{ include "common.name" . }}-policy-data mountPath: /etc/app/policy-management-service/initialdata containers: - - name: {{ include "common.container.policymanagementservice" . }} - image: {{ .Values.policymanagementservice.image.registry }}/{{ .Values.policymanagementservice.image.name }}:{{ .Values.policymanagementservice.image.tag }} - imagePullPolicy: {{ .Values.policymanagementservice.imagePullPolicy }} - ports: - - containerPort: {{ .Values.policymanagementservice.service.targetPort1 }} - protocol: TCP - - containerPort: {{ .Values.policymanagementservice.service.targetPort2 }} - protocol: TCP - readinessProbe: - tcpSocket: - port: {{ .Values.policymanagementservice.service.targetPort1 }} - initialDelaySeconds: {{ .Values.policymanagementservice.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.policymanagementservice.liveness.periodSeconds }} - livenessProbe: - httpGet: - path: /status - port: {{ .Values.policymanagementservice.service.targetPort1 }} - initialDelaySeconds: {{ .Values.policymanagementservice.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.policymanagementservice.liveness.periodSeconds }} + - name: {{ include "common.containername" . }} + image: {{ .Values.image.registry }}/{{ .Values.image.name }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.imagePullPolicy }} + ports: {{- include "common.containerPorts" . | nindent 8 }} + {{- include "common.tcpsocketReadinessProbe" . | nindent 8 }} + {{- include "common.httpLiveProbe" . | nindent 8 }} volumeMounts: - - name: {{ include "common.name.policymanagementservice" . }}-vardata - mountPath: "/var/policy-management-service" - - name: {{ include "common.name.policymanagementservice" . }}-policy-config + - name: {{ include "common.applicationConfigMountName" . }} mountPath: /opt/app/policy-agent/config - - name: {{ include "common.name.policymanagementservice" . }}-policy-data + - name: {{ include "common.vardataMountName" . }} + mountPath: "/var/policy-management-service" + - name: {{ include "common.name" . }}-policy-data mountPath: /etc/app/policy-management-service/initialdata volumes: - - name: {{ include "common.name.policymanagementservice" . }}-policy-config - configMap: - name: {{ include "common.name.policymanagementservice" . }}-configmap-config - - name: {{ include "common.name.policymanagementservice" . }}-policy-data + {{- include "common.applicationConfigVolume" . | nindent 8 }} + - name: {{ include "common.name" . }}-policy-data configMap: - name: {{ include "common.name.policymanagementservice" . }}-configmap-data - volumeClaimTemplates: - - metadata: - name: {{ include "common.name.policymanagementservice" . }}-vardata - spec: - accessModes: - - ReadWriteOnce - storageClassName: "{{ .Values.policymanagementservice.persistence.storageClassName }}" - resources: - requests: - storage: "{{ .Values.policymanagementservice.persistence.size }}" + name: {{ include "common.name" . }}-data-configmap + volumeClaimTemplates: {{- include "common.vardataVolumeClaimTemplate" . | nindent 4 }} diff --git a/smo-install/oran_oom/policymanagementservice/values.yaml b/smo-install/oran_oom/policymanagementservice/values.yaml index b30dfb00..20de309e 100644 --- a/smo-install/oran_oom/policymanagementservice/values.yaml +++ b/smo-install/oran_oom/policymanagementservice/values.yaml @@ -19,31 +19,148 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -policymanagementservice: - imagePullPolicy: IfNotPresent - image: - registry: "nexus3.o-ran-sc.org:10002/o-ran-sc" - name: nonrtric-plt-a1policymanagementservice - tag: 2.7.0 - service: - type: NodePort - allowHttp: true - httpName: http - internalPort1: 8081 - targetPort1: 8081 - nodePort1: 30094 - httpsName: https - internalPort2: 8433 - targetPort2: 8433 - nodePort2: 30095 - liveness: - initialDelaySeconds: 20 - periodSeconds: 10 - readiness: - initialDelaySeconds: 20 - periodSeconds: 10 - persistence: - size: 2Gi - storageClassName: standard - ingress: - enabled: false +imagePullPolicy: IfNotPresent +image: + registry: "nexus3.o-ran-sc.org:10002/o-ran-sc" + name: nonrtric-plt-a1policymanagementservice + tag: 2.7.0 +service: + type: NodePort + ports: + - name: http + internalPort: "8081" + targetPort: "8081" + nodePort: "30094" + name_tls: https + internalPort_tls: "8433" + targetPort_tls: "8433" + nodePort_tls: "30095" +liveness: + initialDelaySeconds: 20 + periodSeconds: 10 +readiness: + initialDelaySeconds: 20 + periodSeconds: 10 +persistence: + size: 2Gi + storageClassName: standard +ingress: + enabled: false + +config: + config: + controller: + - name: controller1 + baseUrl: https://a1controller:8383 + userName: admin + password: Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U + ric: + - name: ric1 + baseUrl: https://a1-sim-osc-0:8185 + controller: controller1 + managedElementIds: + - kista_1 + - kista_2 + - name: ric2 + baseUrl: https://a1-sim-osc-1:8185 + controller: controller1 + managedElementIds: + - kista_1 + - kista_2 + - name: ric3 + baseUrl: https://a1-sim-std-0:8185 + controller: controller1 + managedElementIds: + - kista_1 + - kista_2 + - name: ric4 + baseUrl: https://a1-sim-std-1:8185 + controller: controller1 + managedElementIds: + - kista_1 + - kista_2 + - name: ric5 + baseUrl: https://a1-sim-std2-0:8185 + controller: controller1 + managedElementIds: + - kista_1 + - kista_2 + - name: ric6 + baseUrl: https://a1-sim-std2-1:8185 + controller: controller1 + managedElementIds: + - kista_1 + - kista_2 + streams_publishes: + dmaap_publisher: + type: message_router + dmaap_info: + topic_url: http://message-router.onap:3904/events/A1-POLICY-AGENT-WRITE + streams_subscribes: + dmaap_subscriber: + type: message_router + dmaap_info: + topic_url: http://message-router.onap:3904/events/A1-POLICY-AGENT-READ/users/policy-agent?timeout=15000&limit=100 + + +application: + spring: + profiles: + active: prod + main: + allow-bean-definition-overriding: true + aop: + auto: false + management: + endpoints: + web: + exposure: + # Enabling of springboot actuator features. See springboot documentation. + include: "loggers,logfile,health,info,metrics,threaddump,heapdump" + + logging: + # Configuration of logging + level: + ROOT: ERROR + org.springframework: ERROR + org.springframework.data: ERROR + org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR + org.onap.ccsdk.oran.a1policymanagementservice: INFO + file: + name: /var/log/policy-agent/application.log + + server: + # Configuration of the HTTP/REST server. The parameters are defined and handeled by the springboot framework. + # See springboot documentation. + port : "8433" + http-port: "8081" + ssl: + key-store-type: JKS + key-store-password: policy_agent + key-store: /opt/app/policy-agent/etc/cert/keystore.jks + key-password: policy_agent + key-alias: policy_agent + app: + # Location of the component configuration file. The file will only be used if the Consul database is not used; + # configuration from the Consul will override the file. + filepath: /var/policy-management-service/application_configuration.json + webclient: + # Configuration of the trust store used for the HTTP client (outgoing requests) + # The file location and the password for the truststore is only relevant if trust-store-used == true + # Note that the same keystore as for the server is used. + trust-store-used: false + trust-store-password: policy_agent + trust-store: /opt/app/policy-agent/etc/cert/truststore.jks + # Configuration of usage of HTTP Proxy for the southbound accesses. + # The HTTP proxy (if configured) will only be used for accessing NearRT RIC:s + http.proxy-host: + http.proxy-port: 0 + http.proxy-type: HTTP + # path where the service can store data + vardata-directory: /var/policy-management-service + # the config-file-schema-path referres to a location in the jar file. If this property is empty or missing, + # no schema validation will be executed. + config-file-schema-path: /application_configuration_schema.json + # A file containing an authorization token, which shall be inserted in each HTTP header (authorization). + # If the file name is empty, no authorization token is sent. + auth-token-file: diff --git a/smo-install/oran_oom/rappcatalogueservice/Chart.yaml b/smo-install/oran_oom/rappcatalogueservice/Chart.yaml index 4d28e415..a6eeabb6 100644 --- a/smo-install/oran_oom/rappcatalogueservice/Chart.yaml +++ b/smo-install/oran_oom/rappcatalogueservice/Chart.yaml @@ -23,4 +23,4 @@ version: 1.0.0 dependencies: - name: nonrtric-common version: ^2.0.0 - repository: "@local" \ No newline at end of file + repository: "@local" diff --git a/smo-install/oran_oom/rappcatalogueservice/templates/deployment.yaml b/smo-install/oran_oom/rappcatalogueservice/templates/deployment.yaml index 95304c5d..810c7d3d 100644 --- a/smo-install/oran_oom/rappcatalogueservice/templates/deployment.yaml +++ b/smo-install/oran_oom/rappcatalogueservice/templates/deployment.yaml @@ -16,46 +16,17 @@ kind: Deployment apiVersion: apps/v1 -metadata: - name: {{ include "common.name.rappcatalogueservice" . }} - namespace: {{ include "common.namespace.nonrtric" . }} - generation: 1 - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.rappcatalogueservice" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} - annotations: - deployment.kubernetes.io/revision: '1' +metadata: {{- include "common.resourceMetadata" . | nindent 2 }} spec: replicas: 1 - selector: - matchLabels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.rappcatalogueservice" . }} - release: {{ .Release.Name }} + selector: {{- include "common.selectors" . | nindent 4 }} template: - metadata: - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.rappcatalogueservice" . }} - release: {{ .Release.Name }} + metadata: {{- include "common.templateMetadata" . | nindent 6 }} spec: - hostname: {{ include "common.name.rappcatalogueservice" . }} + hostname: {{ include "common.name" . }} containers: - - name: {{ include "common.container.rappcatalogueservice" . }} - image: {{ .Values.rappcatalogueservice.image.registry }}/{{ .Values.rappcatalogueservice.image.name }}:{{ .Values.rappcatalogueservice.image.tag }} - imagePullPolicy: {{ .Values.rappcatalogueservice.imagePullPolicy }} - ports: - - containerPort: {{ .Values.rappcatalogueservice.service.targetPort1 }} - protocol: TCP - - containerPort: {{ .Values.rappcatalogueservice.service.targetPort2 }} - protocol: TCP - readinessProbe: - tcpSocket: - port: {{ .Values.rappcatalogueservice.service.targetPort1 }} - initialDelaySeconds: {{ .Values.rappcatalogueservice.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.rappcatalogueservice.liveness.periodSeconds }} - livenessProbe: - tcpSocket: - port: {{ .Values.rappcatalogueservice.service.targetPort1 }} - initialDelaySeconds: {{ .Values.rappcatalogueservice.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.rappcatalogueservice.liveness.periodSeconds }} + - name: {{ include "common.containername" . }} + image: {{ .Values.image.registry }}/{{ .Values.image.name }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.imagePullPolicy }} + ports: {{- include "common.containerPorts" . | nindent 8 }} + {{- include "common.tcpsocketProbes" . | nindent 8 }} diff --git a/smo-install/oran_oom/rappcatalogueservice/templates/service.yaml b/smo-install/oran_oom/rappcatalogueservice/templates/service.yaml index 2c056eb5..be38ac46 100644 --- a/smo-install/oran_oom/rappcatalogueservice/templates/service.yaml +++ b/smo-install/oran_oom/rappcatalogueservice/templates/service.yaml @@ -14,29 +14,4 @@ # limitations under the License. # ################################################################################ -kind: Service -apiVersion: v1 -metadata: - name: {{ include "common.name.rappcatalogueservice" . }} - namespace: {{ include "common.namespace.nonrtric" . }} - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.rappcatalogueservice" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - ports: - {{if eq .Values.rappcatalogueservice.service.allowHttp true -}} - - name: {{ index .Values.rappcatalogueservice.service.httpName }} - port: {{ .Values.rappcatalogueservice.service.internalPort1 }} - targetPort: {{ .Values.rappcatalogueservice.service.targetPort1 }} - protocol: TCP - {{- end }} - - name: {{ index .Values.rappcatalogueservice.service.httpsName }} - port: {{ .Values.rappcatalogueservice.service.internalPort2 }} - targetPort: {{ .Values.rappcatalogueservice.service.targetPort2 }} - protocol: TCP - selector: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.rappcatalogueservice" . }} - release: {{ .Release.Name }} - type: ClusterIP +{{ include "common.service" . }} diff --git a/smo-install/oran_oom/rappcatalogueservice/values.yaml b/smo-install/oran_oom/rappcatalogueservice/values.yaml index a59059d3..ecf1ea79 100644 --- a/smo-install/oran_oom/rappcatalogueservice/values.yaml +++ b/smo-install/oran_oom/rappcatalogueservice/values.yaml @@ -18,23 +18,23 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -rappcatalogueservice: - imagePullPolicy: IfNotPresent - image: - registry: 'nexus3.o-ran-sc.org:10002/o-ran-sc' - name: nonrtric-plt-rappcatalogue - tag: 1.2.0 - service: - allowHttp: true - httpName: http - internalPort1: 9085 - targetPort1: 8680 - httpsName: https - internalPort2: 9086 - targetPort2: 8633 - liveness: - initialDelaySeconds: 20 - periodSeconds: 10 - readiness: - initialDelaySeconds: 20 - periodSeconds: 10 +imagePullPolicy: IfNotPresent +image: + registry: 'nexus3.o-ran-sc.org:10002/o-ran-sc' + name: nonrtric-plt-rappcatalogue + tag: 1.2.0 +service: + type: ClusterIP + ports: + - name: http + internalPort: "9085" + targetPort: "8680" + name_tls: https + internalPort_tls: "9086" + targetPort_tls: "8633" +liveness: + initialDelaySeconds: 20 + periodSeconds: 10 +readiness: + initialDelaySeconds: 20 + periodSeconds: 10 diff --git a/smo-install/oran_oom/ric-common/templates/_influxdb.tpl b/smo-install/oran_oom/ric-common/templates/_influxdb.tpl index c6be83cb..006b48d4 100644 --- a/smo-install/oran_oom/ric-common/templates/_influxdb.tpl +++ b/smo-install/oran_oom/ric-common/templates/_influxdb.tpl @@ -1,57 +1,57 @@ -################################################################################ -# Copyright (c) 2021 HCL Technologies Limited. # -# # -# 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. # -################################################################################ - -{{- define "common.name.influxdb" -}} - {{- printf "influxdb" -}} -{{- end -}} - -{{- define "common.fullname.influxdb" -}} - {{- $name := ( include "common.name.influxdb" . ) -}} - {{- $namespace := ( include "common.namespace.platform" . ) -}} - {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{- define "common.influxdb.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{- define "common.influxdb.labels" -}} -helm.sh/chart: {{ include "common.influxdb.chart" . }} -{{ include "common.influxdb.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end -}} - -{{- define "common.influxdb.selectorLabels" -}} -app.kubernetes.io/name: {{ include "common.name.influxdb" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end -}} - -{{- define "common.influxdb.serviceAccountName" -}} - {{- $name := ( include "common.fullname.influxdb" . ) -}} - {{- printf "service-%s-http" $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{- define "common.serviceport.influxdb.http" -}}8086{{- end -}} -{{- define "common.serviceport.influxdb.meta.bind_address" -}}8091{{- end -}} -{{- define "common.serviceport.influxdb.http.bind_address" -}}8086{{- end -}} -{{- define "common.serviceport.influxdb.rpc.bind_address" -}}8088{{- end -}} -{{- define "common.serviceport.influxdb.graphite.bind_address" -}}2003{{- end -}} -{{- define "common.serviceport.influxdb.udp.bind_address" -}}8089{{- end -}} -{{- define "common.serviceport.influxdb.opentsdb.bind_address" -}}4242{{- end -}} -{{- define "common.serviceport.influxdb.collectd.bind_address" -}}25826{{- end -}} +################################################################################ +# Copyright (c) 2021 HCL Technologies Limited. # +# # +# 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. # +################################################################################ + +{{- define "common.name.influxdb" -}} + {{- printf "influxdb" -}} +{{- end -}} + +{{- define "common.fullname.influxdb" -}} + {{- $name := ( include "common.name.influxdb" . ) -}} + {{- $namespace := ( include "common.namespace.platform" . ) -}} + {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.influxdb.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.influxdb.labels" -}} +helm.sh/chart: {{ include "common.influxdb.chart" . }} +{{ include "common.influxdb.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{- define "common.influxdb.selectorLabels" -}} +app.kubernetes.io/name: {{ include "common.name.influxdb" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{- define "common.influxdb.serviceAccountName" -}} + {{- $name := ( include "common.fullname.influxdb" . ) -}} + {{- printf "service-%s-http" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.serviceport.influxdb.http" -}}8086{{- end -}} +{{- define "common.serviceport.influxdb.meta.bind_address" -}}8091{{- end -}} +{{- define "common.serviceport.influxdb.http.bind_address" -}}8086{{- end -}} +{{- define "common.serviceport.influxdb.rpc.bind_address" -}}8088{{- end -}} +{{- define "common.serviceport.influxdb.graphite.bind_address" -}}2003{{- end -}} +{{- define "common.serviceport.influxdb.udp.bind_address" -}}8089{{- end -}} +{{- define "common.serviceport.influxdb.opentsdb.bind_address" -}}4242{{- end -}} +{{- define "common.serviceport.influxdb.collectd.bind_address" -}}25826{{- end -}} diff --git a/smo-install/oran_oom/ric-common/templates/_tiller.tpl b/smo-install/oran_oom/ric-common/templates/_tiller.tpl index d423c396..f9d27094 100644 --- a/smo-install/oran_oom/ric-common/templates/_tiller.tpl +++ b/smo-install/oran_oom/ric-common/templates/_tiller.tpl @@ -27,7 +27,7 @@ {{- end -}} {{- else -}} {{- with index $ctx $currentkey }} - {{- $newctx := dict "ctx" . "printkeys" $restkeys -}} + {{- $newctx := dict "ctx" . "printkeys" $restkeys -}} {{- include "recursiveprinter" $newctx -}} {{- end -}} {{- end -}} @@ -39,7 +39,7 @@ {{- if hasKey $topctx.Values.common "tillers" }} {{- $ctx := index $topctx.Values.common.tillers .key -}} {{- if not (empty $ctx) -}} - {{- $newctx := dict "ctx" $ctx "printkeys" .printkey -}} + {{- $newctx := dict "ctx" $ctx "printkeys" .printkey -}} {{- include "recursiveprinter" $newctx -}} {{- end -}} {{- end -}} diff --git a/smo-install/oran_oom/topology/Chart.yaml b/smo-install/oran_oom/topology/Chart.yaml index 47dd9535..759db6f3 100644 --- a/smo-install/oran_oom/topology/Chart.yaml +++ b/smo-install/oran_oom/topology/Chart.yaml @@ -17,3 +17,8 @@ appVersion: "1.0.0" description: A Helm chart to deploy topology name: topology version: 1.0.0 + +dependencies: + - name: nonrtric-common + version: ^2.0.0 + repository: "@local" diff --git a/smo-install/oran_oom/topology/templates/configmapenv.yaml b/smo-install/oran_oom/topology/templates/configmapenv.yaml index 8a06b082..2991abf5 100644 --- a/smo-install/oran_oom/topology/templates/configmapenv.yaml +++ b/smo-install/oran_oom/topology/templates/configmapenv.yaml @@ -14,15 +14,10 @@ apiVersion: v1 kind: ConfigMap -metadata: - name: topology-configmapenv - labels: - name: topology-env - release: {{ .Release.Name }} - chart: {{ .Chart.Name }} +metadata: {{ include "common.resourceMetadata" (dict "suffix" "configmapenv" "dot" . ) | nindent 2 }} data: AUTH_ENABLED: {{ .Values.conf.authEnabled | quote }} - AUTH_HOST_URL: {{ .Values.conf.authHostUrl | quote }} + AUTH_HOST_URL: {{ .Values.conf.authHostUrl | quote }} PROVIDERS: {{ .Values.conf.providers | quote }} LOAD_PACKAGES: {{ .Values.conf.loadPackages | quote }} diff --git a/smo-install/oran_oom/topology/templates/deployment.yaml b/smo-install/oran_oom/topology/templates/deployment.yaml index 9da2f13f..aa141955 100644 --- a/smo-install/oran_oom/topology/templates/deployment.yaml +++ b/smo-install/oran_oom/topology/templates/deployment.yaml @@ -14,33 +14,22 @@ apiVersion: apps/v1 kind: Deployment -metadata: - name: topology - labels: - name: topology - release: {{ .Release.Name }} - chart: {{ .Chart.Name }} +metadata: {{- include "common.resourceMetadata" . | nindent 2 }} spec: replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - name: topology + selector: {{- include "common.selectors" . | nindent 4 }} template: - metadata: - labels: - name: topology - release: {{ .Release.Name }} - chart: {{ .Chart.Name }} - spec: + metadata: {{- include "common.templateMetadata" . | nindent 6 }} + spec: containers: - - name: {{ .Chart.Name }} + - name: {{ include "common.containername" . }} image: "{{ .Values.image.repository }}/{{ .Values.image.name}}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} tty: true stdin: true envFrom: - configMapRef: - name: topology-configmapenv + name: {{ include "common.name" . }}-configmapenv securityContext: capabilities: add: diff --git a/smo-install/oran_oom/topology/templates/service.yaml b/smo-install/oran_oom/topology/templates/service.yaml index 1ccb79e8..879f61db 100644 --- a/smo-install/oran_oom/topology/templates/service.yaml +++ b/smo-install/oran_oom/topology/templates/service.yaml @@ -12,20 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: v1 -kind: Service -metadata: - name: "topology" - labels: - name: topology - release: {{ .Release.Name }} - chart: {{ .Chart.Name }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.ports.port }} - nodePort: {{ .Values.service.ports.nodePort }} - selector: - name: topology - release: {{ .Release.Name }} - chart: {{ .Chart.Name }} +{{ include "common.service" . }} diff --git a/smo-install/oran_oom/topology/values.yaml b/smo-install/oran_oom/topology/values.yaml index 0781e2b7..d7a6a4f7 100644 --- a/smo-install/oran_oom/topology/values.yaml +++ b/smo-install/oran_oom/topology/values.yaml @@ -23,7 +23,9 @@ image: service: type: NodePort ports: - port: 3001 + - name: http + internalPort: "3001" + targetPort: "3001" nodePort: 32001 conf: -- 2.16.6