Improve oran_oom helm charts 30/12430/5
authorLouis <gamerslouis@gmail.com>
Tue, 19 Dec 2023 12:05:56 +0000 (12:05 +0000)
committerLouis Li <gamerslouis@gmail.com>
Sun, 18 Feb 2024 02:26:12 +0000 (02:26 +0000)
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 <gamerslouis@gmail.com>
104 files changed:
smo-install/helm-override/cnf/oran-override.yaml
smo-install/helm-override/default/oran-override.yaml
smo-install/helm-override/pythonsdk-tests/oran-override.yaml
smo-install/oran_oom/a1controller/Chart.yaml
smo-install/oran_oom/a1controller/templates/deployment.yaml
smo-install/oran_oom/a1controller/templates/service.yaml
smo-install/oran_oom/a1controller/values.yaml
smo-install/oran_oom/a1simulator/Chart.yaml
smo-install/oran_oom/aux-common/templates/_ingress.tpl
smo-install/oran_oom/aux-common/templates/_namespace.tpl
smo-install/oran_oom/aux-common/templates/_service.tpl
smo-install/oran_oom/controlpanel/templates/configmap.yaml
smo-install/oran_oom/controlpanel/templates/deployment.yaml
smo-install/oran_oom/controlpanel/templates/service.yaml
smo-install/oran_oom/controlpanel/values.yaml
smo-install/oran_oom/dmaapadapterservice/Chart.yaml
smo-install/oran_oom/dmaapadapterservice/resources/config/application.yaml [deleted file]
smo-install/oran_oom/dmaapadapterservice/resources/data/application_configuration.json [deleted file]
smo-install/oran_oom/dmaapadapterservice/templates/configmap.yaml
smo-install/oran_oom/dmaapadapterservice/templates/service.yaml
smo-install/oran_oom/dmaapadapterservice/templates/statefulset.yaml
smo-install/oran_oom/dmaapadapterservice/values.yaml
smo-install/oran_oom/dmaapmediatorservice/resources/config/application.yaml [deleted file]
smo-install/oran_oom/dmaapmediatorservice/resources/data/type_config.json [deleted file]
smo-install/oran_oom/dmaapmediatorservice/resources/dmaap-topic-init.sh [moved from smo-install/oran_oom/nonrtric-common/templates/_helmmanager.tpl with 73% similarity]
smo-install/oran_oom/dmaapmediatorservice/templates/_helpers.tpl [moved from smo-install/oran_oom/nonrtric-common/templates/_a1simulator.tpl with 58% similarity]
smo-install/oran_oom/dmaapmediatorservice/templates/configmap.yaml
smo-install/oran_oom/dmaapmediatorservice/templates/service.yaml
smo-install/oran_oom/dmaapmediatorservice/templates/statefulset.yaml
smo-install/oran_oom/dmaapmediatorservice/values.yaml
smo-install/oran_oom/helmmanager/Chart.yaml
smo-install/oran_oom/helmmanager/templates/service.yaml
smo-install/oran_oom/helmmanager/templates/serviceaccount.yaml
smo-install/oran_oom/helmmanager/templates/statefulset.yaml
smo-install/oran_oom/helmmanager/values.yaml
smo-install/oran_oom/informationservice/Chart.yaml
smo-install/oran_oom/informationservice/resources/config/application.yaml [deleted file]
smo-install/oran_oom/informationservice/templates/configmap.yaml
smo-install/oran_oom/informationservice/templates/ingress.yaml
smo-install/oran_oom/informationservice/templates/service.yaml
smo-install/oran_oom/informationservice/templates/statefulset.yaml
smo-install/oran_oom/informationservice/values.yaml
smo-install/oran_oom/nonrtric-common/Chart.yaml
smo-install/oran_oom/nonrtric-common/templates/_a1controller.tpl [deleted file]
smo-install/oran_oom/nonrtric-common/templates/_configmap.tpl [moved from smo-install/oran_oom/nonrtric-common/templates/_common.tpl with 72% similarity]
smo-install/oran_oom/nonrtric-common/templates/_controlpanel.tpl [deleted file]
smo-install/oran_oom/nonrtric-common/templates/_dmaapadapterservice.tpl [deleted file]
smo-install/oran_oom/nonrtric-common/templates/_dmaapmediatorservice.tpl [deleted file]
smo-install/oran_oom/nonrtric-common/templates/_informationservice.tpl [deleted file]
smo-install/oran_oom/nonrtric-common/templates/_ingress.tpl [moved from smo-install/oran_oom/nonrtric-common/templates/_nonrtricgateway.tpl with 68% similarity]
smo-install/oran_oom/nonrtric-common/templates/_labels.tpl [new file with mode: 0644]
smo-install/oran_oom/nonrtric-common/templates/_name.tpl [new file with mode: 0644]
smo-install/oran_oom/nonrtric-common/templates/_namespace.tpl [new file with mode: 0644]
smo-install/oran_oom/nonrtric-common/templates/_pods.tpl [new file with mode: 0644]
smo-install/oran_oom/nonrtric-common/templates/_rappcatalogueservice.tpl [deleted file]
smo-install/oran_oom/nonrtric-common/templates/_service.tpl [new file with mode: 0644]
smo-install/oran_oom/nonrtric-common/templates/_statefulset.tpl [moved from smo-install/oran_oom/nonrtric-common/templates/_policymanagementservice.tpl with 72% similarity]
smo-install/oran_oom/nonrtric-common/templates/_utils.tpl [new file with mode: 0644]
smo-install/oran_oom/nonrtric-common/values.yaml
smo-install/oran_oom/nonrtric/templates/pv1.yaml
smo-install/oran_oom/nonrtric/templates/pv2.yaml
smo-install/oran_oom/nonrtric/templates/pv3.yaml
smo-install/oran_oom/nonrtric/values.yaml
smo-install/oran_oom/nonrtricgateway/Chart.yaml
smo-install/oran_oom/nonrtricgateway/resources/config/application.yaml [deleted file]
smo-install/oran_oom/nonrtricgateway/templates/configmap.yaml
smo-install/oran_oom/nonrtricgateway/templates/deployment.yaml
smo-install/oran_oom/nonrtricgateway/templates/service.yaml
smo-install/oran_oom/nonrtricgateway/values.yaml
smo-install/oran_oom/odu-app-ics-version/Chart.yaml
smo-install/oran_oom/odu-app-ics-version/templates/_helpers.tpl [deleted file]
smo-install/oran_oom/odu-app-ics-version/templates/deployment.yaml
smo-install/oran_oom/odu-app-ics-version/templates/service.yaml
smo-install/oran_oom/odu-app-ics-version/values.yaml
smo-install/oran_oom/odu-app/Chart.yaml
smo-install/oran_oom/odu-app/templates/_helpers.tpl [deleted file]
smo-install/oran_oom/odu-app/templates/deployment.yaml
smo-install/oran_oom/odu-app/templates/service.yaml
smo-install/oran_oom/odu-app/values.yaml
smo-install/oran_oom/oru-app/Chart.yaml
smo-install/oran_oom/oru-app/templates/configmap.yaml
smo-install/oran_oom/oru-app/templates/configmapenv.yaml
smo-install/oran_oom/oru-app/templates/deployment.yaml
smo-install/oran_oom/oru-app/templates/service.yaml
smo-install/oran_oom/oru-app/values.yaml
smo-install/oran_oom/policymanagementservice/Chart.yaml
smo-install/oran_oom/policymanagementservice/resources/config/application.yaml [deleted file]
smo-install/oran_oom/policymanagementservice/resources/data/application_configuration.json [deleted file]
smo-install/oran_oom/policymanagementservice/templates/configmap.yaml
smo-install/oran_oom/policymanagementservice/templates/ingress.yaml
smo-install/oran_oom/policymanagementservice/templates/service.yaml
smo-install/oran_oom/policymanagementservice/templates/statefulset.yaml
smo-install/oran_oom/policymanagementservice/values.yaml
smo-install/oran_oom/rappcatalogueservice/Chart.yaml
smo-install/oran_oom/rappcatalogueservice/templates/deployment.yaml
smo-install/oran_oom/rappcatalogueservice/templates/service.yaml
smo-install/oran_oom/rappcatalogueservice/values.yaml
smo-install/oran_oom/ric-common/templates/_influxdb.tpl
smo-install/oran_oom/ric-common/templates/_tiller.tpl
smo-install/oran_oom/topology/Chart.yaml
smo-install/oran_oom/topology/templates/configmapenv.yaml
smo-install/oran_oom/topology/templates/deployment.yaml
smo-install/oran_oom/topology/templates/service.yaml
smo-install/oran_oom/topology/values.yaml

index d000c29..222a8bd 100644 (file)
@@ -61,24 +61,22 @@ common:
   ingressClassName: kong
 
 informationservice:
   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:
 
 
 # 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
 
   ingress:
     enabled: true
 
@@ -89,16 +87,14 @@ kong:
     enabled: true
 
 helmmanager:
     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:
-  controlpanel:
-    ingress:
-      enabled: false
+  ingress:
+    enabled: false
 
 oru-app:
   simulators:
 
 oru-app:
   simulators:
index d40e97a..222a8bd 100644 (file)
@@ -61,24 +61,22 @@ common:
   ingressClassName: kong
 
 informationservice:
   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:
 
 
 # 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
 
   ingress:
     enabled: true
 
@@ -89,16 +87,14 @@ kong:
     enabled: true
 
 helmmanager:
     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:
-  controlpanel:
-    ingress:
-      enabled: false
+  ingress:
+    enabled: false
 
 oru-app:
   simulators:
 
 oru-app:
   simulators:
index b722d13..58eded0 100644 (file)
@@ -61,24 +61,22 @@ common:
   ingressClassName: kong
 
 informationservice:
   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:
 
 
 # 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
 
   ingress:
     enabled: true
 
@@ -89,16 +87,14 @@ kong:
     enabled: true
 
 helmmanager:
     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:
-  controlpanel:
-    ingress:
-      enabled: false
+  ingress:
+    enabled: false
 
 oru-app:
   simulators:
 
 oru-app:
   simulators:
index a2e0688..53f199f 100644 (file)
@@ -23,4 +23,4 @@ version: 2.0.0
 dependencies:
   - name: nonrtric-common
     version: ^2.0.0
 dependencies:
   - name: nonrtric-common
     version: ^2.0.0
-    repository: "@local"
\ No newline at end of file
+    repository: "@local"
index 86bc466..d1a646b 100644 (file)
 
 kind: Deployment
 apiVersion: apps/v1
 
 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:
 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:
   template:
-    metadata:
-      labels:
-        app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.a1controller" . }}
-        release: {{ .Release.Name }}
+    metadata: {{- include "common.templateMetadata" . | nindent 6 }}
     spec:
     spec:
-      hostname: {{ include "common.name.a1controller" . }}
+      hostname: {{ include "common.name" . }}
       containers:
       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
           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'
           env:
             - name: MYSQL_ROOT_PASSWORD
               value: 'itsASecret'
@@ -80,32 +61,16 @@ spec:
               value: 'a1adapter'
             - name: AAI_TRUSTSTORE_PASSWORD
               value: 'changeit'
               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
 ---
 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:
 spec:
-  selector:
-    matchLabels:
-      app: db
+  selector: {{- include "common.selectors" $selectorsCtx | nindent 4 }}
   template:
   template:
-    metadata:
-      labels:
-        app: db
+    metadata: {{- include "common.templateMetadata" $templateMetadataCtx | nindent 6 }}
     spec:
       containers:
         - name: sdnc-db-container
     spec:
       containers:
         - name: sdnc-db-container
index 5259bb8..be38ac4 100644 (file)
 #   limitations under the License.                                             #
 ################################################################################
 
 #   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" . }}
index 28bd09c..bae7cfb 100644 (file)
 # Default values for a1controller.
 # This is a YAML-formatted file.
 # Declare variables to be passed into your templates.
 # 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
index d4570a4..daa3758 100644 (file)
@@ -7,4 +7,4 @@ version: 2.1.0
 dependencies:
   - name: nonrtric-common
     version: ^2.0.0
 dependencies:
   - name: nonrtric-common
     version: ^2.0.0
-    repository: "@local"
\ No newline at end of file
+    repository: "@local"
index b4afe63..5851de8 100644 (file)
@@ -81,4 +81,4 @@ spec:
 {{- end -}}
 {{- end -}}
 {{- end -}}
 {{- end -}}
 {{- end -}}
 {{- end -}}
-{{- end -}}
\ No newline at end of file
+{{- end -}}
index 94c9ee7..a1971ad 100644 (file)
 # limitations under the License.
 */}}
 
 # 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" -}}
 {{- define "common.namespace" -}}
-  {{- default .Release.Namespace .Values.nsPrefix -}}
+{{- .Release.Namespace -}}
 {{- end -}}
 {{- end -}}
index 77b77d0..ececa62 100644 (file)
@@ -28,4 +28,4 @@
 {{- define "common.servicename" -}}
   {{- $name := default .Chart.Name .Values.nameOverride -}}
   {{- default $name .Values.service.name | trunc 63 | trimSuffix "-" -}}
 {{- 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 -}}
index cf0f7da..2847f21 100644 (file)
 apiVersion: v1
 kind: ConfigMap
 metadata:
 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:
 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 }}
 {{ tpl (.Files.Glob "resources-ngw/*").AsConfig . | indent 2 }}
 {{ else }}
 {{ tpl (.Files.Glob "resources-ing/*").AsConfig . | indent 2 }}
index eb8fcce..ff93fd5 100644 (file)
 
 kind: Deployment
 apiVersion: apps/v1
 
 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:
 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:
   template:
-    metadata:
-      labels:
-        app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.controlpanel" . }}
-        release: {{ .Release.Name }}
+    metadata: {{- include "common.templateMetadata" . | nindent 6 }}
     spec:
     spec:
-      hostname: {{ include "common.name.controlpanel" . }}
+      hostname: {{ include "common.name" . }}
       containers:
       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
           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:
       volumes:
         - name: configmap
           configMap:
-            name: {{ include "common.name.controlpanel" . }}-configmap
\ No newline at end of file
+            name: {{ include "common.name" . }}-configmap
index 1a61ed7..be38ac4 100644 (file)
 #   limitations under the License.                                             #
 ################################################################################
 
 #   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" . }}
index fe4f2e3..f1d439a 100644 (file)
 # This is a YAML-formatted file.
 # Declare variables to be passed into your templates.
 
 # 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
index 15d22c4..14558b1 100644 (file)
@@ -23,4 +23,4 @@ version: 1.0.0
 dependencies:
   - name: nonrtric-common
     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/dmaapadapterservice/resources/config/application.yaml b/smo-install/oran_oom/dmaapadapterservice/resources/config/application.yaml
deleted file mode 100644 (file)
index f2d5e59..0000000
+++ /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 (file)
index 137e353..0000000
+++ /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
-    }
-   ]
- }
index e055213..cbd8da9 100644 (file)
 ################################################################################
 
 
 ################################################################################
 
 
-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
 ---
 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:
 data:
-{{ tpl (.Files.Glob "resources/data/*").AsConfig . | indent 2 }}
+  type_config.json: |
+    {{- (dict "types" .Values.types) | toRawJson | nindent 4 }}
index b2f0ad6..48461eb 100644 (file)
 #   limitations under the License.                                             #
 ################################################################################
 
 #   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" . }}
index bc28297..aff1a27 100644 (file)
 
 kind: StatefulSet
 apiVersion: apps/v1
 
 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:
 spec:
-  serviceName: {{ include "common.name.dmaapadapterservice" . }}
+  serviceName: {{ include "common.name" . }}
   replicas: 1
   replicas: 1
-  selector:
-    matchLabels:
-      app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.dmaapadapterservice" . }}
-      release: {{ .Release.Name }}
+  selector: {{- include "common.selectors" . | nindent 4 }}
   template:
   template:
-    metadata:
-      labels:
-        app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.dmaapadapterservice" . }}
-        release: {{ .Release.Name }}
+    metadata: {{- include "common.templateMetadata" . | nindent 6 }}
     spec:
     spec:
-      hostname: {{ include "common.name.dmaapadapterservice" . }}
+      hostname: {{ include "common.name" . }}
       containers:
       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:
         volumeMounts:
-        - name: {{ include "common.name.dmaapadapterservice" . }}-dmaapadapter-config
+        - name: {{ include "common.applicationConfigMountName" . }}
           mountPath: /opt/app/dmaap-adapter-service/config
           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:
           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:
           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
index 38e5e0b..40665dc 100644 (file)
 # This is a YAML-formatted file.
 # Declare variables to be passed into your templates.
 
 # 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 (file)
index 75b11ad..0000000
+++ /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 (file)
index 3a82a95..0000000
+++ /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"
-        }
-   ]
- }
@@ -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.           #
 #                                                                              #
 #   Licensed under the Apache License, Version 2.0 (the "License");            #
 #   you may not use this file except in compliance with the License.           #
 #   limitations under the License.                                             #
 ################################################################################
 
 #   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
@@ -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.           #
 #                                                                              #
 #   Licensed under the Apache License, Version 2.0 (the "License");            #
 #   you may not use this file except in compliance with the License.           #
 #   See the License for the specific language governing permissions and        #
 #   limitations under the License.                                             #
 ################################################################################
 #   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 -}}
 
 {{- 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 }}
index 8958996..2dce181 100644 (file)
 
 apiVersion: v1
 kind: ConfigMap
 
 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:
 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 -}}
index d09fde4..48461eb 100644 (file)
 #   limitations under the License.                                             #
 ################################################################################
 
 #   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" . }}
index c8df034..e3211e2 100644 (file)
@@ -1,82 +1,59 @@
-################################################################################\r
-#   Copyright (c) 2021 Nordix Foundation.                                      #\r
-#                                                                              #\r
-#   Licensed under the Apache License, Version 2.0 (the "License");            #\r
-#   you may not use this file except in compliance with the License.           #\r
-#   You may obtain a copy of the License at                                    #\r
-#                                                                              #\r
-#       http://www.apache.org/licenses/LICENSE-2.0                             #\r
-#                                                                              #\r
-#   Unless required by applicable law or agreed to in writing, software        #\r
-#   distributed under the License is distributed on an "AS IS" BASIS,          #\r
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #\r
-#   See the License for the specific language governing permissions and        #\r
-#   limitations under the License.                                             #\r
-################################################################################\r
-\r
-kind: StatefulSet\r
-apiVersion: apps/v1\r
-metadata:\r
-  name: {{ include "common.name.dmaapmediatorservice" . }}\r
-  namespace: {{ include "common.namespace.nonrtric" . }}\r
-  generation: 1\r
-  labels:\r
-    app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.dmaapmediatorservice" . }}\r
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}\r
-    release: {{ .Release.Name }}\r
-    heritage: {{ .Release.Service }}\r
-  annotations:\r
-    deployment.kubernetes.io/revision: '1'\r
-spec:\r
-  serviceName: {{ include "common.name.dmaapmediatorservice" . }}\r
-  replicas: 1\r
-  selector:\r
-    matchLabels:\r
-      app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.dmaapmediatorservice" . }}\r
-      release: {{ .Release.Name }}\r
-  template:\r
-    metadata:\r
-      labels:\r
-        app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.dmaapmediatorservice" . }}\r
-        release: {{ .Release.Name }}\r
-    spec:\r
-      hostname: {{ include "common.name.dmaapmediatorservice" . }}\r
-      containers:\r
-      - name: {{ include "common.container.dmaapmediatorservice" . }}\r
-        image: {{ .Values.dmaapmediatorservice.image.registry }}/{{ .Values.dmaapmediatorservice.image.name }}:{{ .Values.dmaapmediatorservice.image.tag }}\r
-        imagePullPolicy: {{ .Values.dmaapmediatorservice.imagePullPolicy }}\r
-        ports:\r
-        - containerPort: {{ .Values.dmaapmediatorservice.service.targetPort1 }}\r
-          protocol: TCP\r
-        - containerPort: {{ .Values.dmaapmediatorservice.service.targetPort2 }}\r
-          protocol: TCP\r
-        readinessProbe:\r
-          tcpSocket:\r
-            port: {{ .Values.dmaapmediatorservice.service.targetPort2 }}\r
-          initialDelaySeconds: {{ .Values.dmaapmediatorservice.liveness.initialDelaySeconds }}\r
-          periodSeconds: {{ .Values.dmaapmediatorservice.liveness.periodSeconds }}\r
-        livenessProbe:\r
-          tcpSocket:\r
-            port: {{ .Values.dmaapmediatorservice.service.targetPort2 }}\r
-          initialDelaySeconds: {{ .Values.dmaapmediatorservice.liveness.initialDelaySeconds }}\r
-          periodSeconds: {{ .Values.dmaapmediatorservice.liveness.periodSeconds }}\r
-        volumeMounts:\r
-        - name: {{ include "common.name.dmaapmediatorservice" . }}-dmaapmediator-data\r
-          mountPath: /configs/type_config.json\r
-          subPath: type_config.json\r
-\r
-        env:\r
-          - name: INFO_PRODUCER_HOST\r
-            value: https://{{ include "common.name.dmaapmediatorservice" . }}\r
-          - name: INFO_PRODUCER_PORT\r
-            value: "{{ .Values.dmaapmediatorservice.service.internalPort2 }}"\r
-          - name: INFO_COORD_ADDR\r
-            value: https://informationservice:9083\r
-          - name: DMAAP_MR_ADDR\r
-            value: http://message-router.onap:3904\r
-          - name: LOG_LEVEL\r
-            value: Info\r
-      volumes:\r
-        - name: {{ include "common.name.dmaapmediatorservice" . }}-dmaapmediator-data\r
-          configMap:\r
-            name: {{ include "common.name.dmaapmediatorservice" . }}-configmap-data\r
+################################################################################
+#   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 }}
index bec03b9..7acf5e6 100644 (file)
 # This is a YAML-formatted file.
 # Declare variables to be passed into your templates.
 
 # 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
index 511176b..26aa796 100644 (file)
@@ -22,4 +22,4 @@ version: 1.0.0
 dependencies:
   - name: nonrtric-common
     version: ^2.0.0
 dependencies:
   - name: nonrtric-common
     version: ^2.0.0
-    repository: "@local"
\ No newline at end of file
+    repository: "@local"
index 90ae614..48461eb 100644 (file)
 #   See the License for the specific language governing permissions and        #
 #   limitations under the License.                                             #
 ################################################################################
 #   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" . }}
index 60c081d..a2f4242 100644 (file)
 apiVersion: v1
 kind: ServiceAccount
 metadata:
 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:
 ---
 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
 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
 roleRef:
  kind: ClusterRole
- name: {{ .Values.helmmanager.clusterRoleName }}
+ name: {{ .Values.clusterRoleName }}
  apiGroup: rbac.authorization.k8s.io
  apiGroup: rbac.authorization.k8s.io
index d980ecb..25e361c 100644 (file)
 
 kind: StatefulSet
 apiVersion: apps/v1
 
 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:
 spec:
-  serviceName: {{ include "common.name.helmmanager" . }}
+  serviceName: {{ include "common.name" . }}
   replicas: 1
   replicas: 1
-  selector:
-    matchLabels:
-      app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.helmmanager" . }}
-      release: {{ .Release.Name }}
+  selector: {{- include "common.selectors" . | nindent 4 }}
   template:
   template:
-    metadata:
-      labels:
-        app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.helmmanager" . }}
-        release: {{ .Release.Name }}
+    metadata: {{- include "common.templateMetadata" . | nindent 6 }}
     spec:
     spec:
-      hostname: {{ include "common.name.helmmanager" . }}
+      hostname: {{ include "common.name" . }}
       containers:
       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:
         volumeMounts:
-        - name: {{ include "common.name.helmmanager" . }}-vardata
+        - name: {{ include "common.vardataMountName" . }}
           mountPath: "/var/helm-manager-service"
           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 }}
index fe194e7..d21d38c 100644 (file)
 # This is a YAML-formatted file.
 # Declare variables to be passed into your templates.
 
 # 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
index 900578d..2ce8040 100644 (file)
@@ -23,4 +23,4 @@ version: 1.0.0
 dependencies:
   - name: nonrtric-common
     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/informationservice/resources/config/application.yaml b/smo-install/oran_oom/informationservice/resources/config/application.yaml
deleted file mode 100644 (file)
index 38bf7f0..0000000
+++ /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
index 4d4df9f..269b2d7 100644 (file)
 #   limitations under the License.                                             #
 ################################################################################
 
 #   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" . }}
index d872407..63ac9ec 100644 (file)
 ################################################################################
 */}}
 
 ################################################################################
 */}}
 
-{{- if .Values.informationservice.ingress.enabled -}}
+{{- if (include "common.ingressEnabled" .) -}}
 apiVersion: networking.k8s.io/v1
 kind: Ingress
 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:
 spec:
   ingressClassName: {{ include "common.ingressClassName" . }}
   rules:
@@ -31,15 +28,15 @@ spec:
           - path: "/data-producer"
             backend:
               service:
           - path: "/data-producer"
             backend:
               service:
-                name: {{ include "common.name.informationservice" . }}
+                name: {{ include "common.name" . }}
                 port:
                 port:
-                  number: {{ .Values.informationservice.service.internalPort1 }}
+                  number: {{ (first .Values.service.ports).internalPort }}
             pathType: Prefix
           - path: "/data-consumer"
             backend:
               service:
             pathType: Prefix
           - path: "/data-consumer"
             backend:
               service:
-                name: {{ include "common.name.informationservice" . }}
+                name: {{ include "common.name" . }}
                 port:
                 port:
-                  number: {{ .Values.informationservice.service.internalPort1 }}
+                  number: {{ (first .Values.service.ports).internalPort }}
             pathType: Prefix
 {{- end -}}
             pathType: Prefix
 {{- end -}}
index ba5783c..be38ac4 100644 (file)
 #   limitations under the License.                                             #
 ################################################################################
 
 #   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" . }}
index a597324..f9d8348 100644 (file)
 
 kind: StatefulSet
 apiVersion: apps/v1
 
 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:
 spec:
-  serviceName: {{ include "common.name.informationservice" . }}
+  serviceName: {{ include "common.name" . }}
   replicas: 1
   replicas: 1
-  selector:
-    matchLabels:
-      app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.informationservice" . }}
-      release: {{ .Release.Name }}
+  selector: {{- include "common.selectors" . | nindent 4 }}
   template:
   template:
-    metadata:
-      labels:
-        app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.informationservice" . }}
-        release: {{ .Release.Name }}
+    metadata: {{- include "common.templateMetadata" . | nindent 6 }}
     spec:
     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:
       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:
         volumeMounts:
-        - name: {{ include "common.name.informationservice" . }}-information-config
+        - name: {{ include "common.applicationConfigMountName" . }}
           mountPath: /opt/app/information-coordinator-service/config
           mountPath: /opt/app/information-coordinator-service/config
-        - name: {{ include "common.name.informationservice" . }}-vardata
+        - name: {{ include "common.vardataMountName" . }}
           mountPath: /var/information-coordinator-service
           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 }}
index 7d7aadf..2df11d4 100644 (file)
 # This is a YAML-formatted file.
 # Declare variables to be passed into your templates.
 
 # 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
index 3798faf..1f64891 100644 (file)
@@ -17,4 +17,4 @@
 apiVersion: v2
 description: NONRTRIC Common templates for inclusion in other charts
 name: nonrtric-common
 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 (file)
index afb5097..0000000
+++ /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
@@ -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.           #
 #                                                                              #
 #   Licensed under the Apache License, Version 2.0 (the "License");            #
 #   you may not use this file except in compliance with the License.           #
 #   See the License for the specific language governing permissions and        #
 #   limitations under the License.                                             #
 ################################################################################
 #   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 (file)
index 1f1430e..0000000
+++ /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 (file)
index 0d73046..0000000
+++ /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 (file)
index d31d0c8..0000000
+++ /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 (file)
index bb686b2..0000000
+++ /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 -}}
@@ -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.           #
 #                                                                              #
 #   Licensed under the Apache License, Version 2.0 (the "License");            #
 #   you may not use this file except in compliance with the License.           #
 #   See the License for the specific language governing permissions and        #
 #   limitations under the License.                                             #
 ################################################################################
 #   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 -}}
 
 {{- 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 -}}
 {{- 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 (file)
index 0000000..1f97eff
--- /dev/null
@@ -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 (file)
index 0000000..d0072c2
--- /dev/null
@@ -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 (file)
index 0000000..94c9ee7
--- /dev/null
@@ -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 (file)
index 0000000..e81bc38
--- /dev/null
@@ -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 (file)
index 230c807..0000000
+++ /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 (file)
index 0000000..5b81c1d
--- /dev/null
@@ -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 -}}
@@ -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.           #
 #                                                                              #
 #   Licensed under the Apache License, Version 2.0 (the "License");            #
 #   you may not use this file except in compliance with the License.           #
 #   See the License for the specific language governing permissions and        #
 #   limitations under the License.                                             #
 ################################################################################
 #   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 -}}
 
 {{- 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 -}}
 {{- 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 (file)
index 0000000..b74ecbd
--- /dev/null
@@ -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 -}}
index 10520ad..993d88d 100644 (file)
@@ -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.                                             #
 #   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
+################################################################################
index b600c99..2544072 100644 (file)
@@ -20,7 +20,7 @@ kind: PersistentVolume
 apiVersion: v1
 metadata:
   name: nonrtric-pv1
 apiVersion: v1
 metadata:
   name: nonrtric-pv1
-  namespace: {{ include "common.namespace.nonrtric" . }}
+  namespace: {{ include "common.namespace" . }}
 spec:
   capacity:
     storage: {{ .Values.nonrtric.volume1.size}}
 spec:
   capacity:
     storage: {{ .Values.nonrtric.volume1.size}}
index cdf5eaf..50ff421 100644 (file)
@@ -20,7 +20,7 @@ kind: PersistentVolume
 apiVersion: v1
 metadata:
   name: nonrtric-pv2
 apiVersion: v1
 metadata:
   name: nonrtric-pv2
-  namespace: {{ include "common.namespace.nonrtric" . }}
+  namespace: {{ include "common.namespace" . }}
 spec:
   capacity:
     storage: {{ .Values.nonrtric.volume2.size }}
 spec:
   capacity:
     storage: {{ .Values.nonrtric.volume2.size }}
index 90ed1aa..c29edd3 100644 (file)
@@ -20,7 +20,7 @@ kind: PersistentVolume
 apiVersion: v1
 metadata:
   name: nonrtric-pv3
 apiVersion: v1
 metadata:
   name: nonrtric-pv3
-  namespace: {{ include "common.namespace.nonrtric" . }}
+  namespace: {{ include "common.namespace" . }}
 spec:
   capacity:
     storage: {{ .Values.nonrtric.volume3.size }}
 spec:
   capacity:
     storage: {{ .Values.nonrtric.volume3.size }}
index 8fdcebb..441ef31 100644 (file)
 #  limitations under the License.
 #  ============LICENSE_END=================================================
 
 #  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
 nonrtric:
   persistence:
     mountPath: /dockerdata-nfs
@@ -51,5 +60,3 @@ kong:
     installCRDs: false
   admin:
     enabled: true
     installCRDs: false
   admin:
     enabled: true
-cert-wrapper:
-  enabled: true
index 9ca9e2d..93f4c81 100644 (file)
@@ -23,4 +23,4 @@ version: 1.0.0
 dependencies:
   - name: nonrtric-common
     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/nonrtricgateway/resources/config/application.yaml b/smo-install/oran_oom/nonrtricgateway/resources/config/application.yaml
deleted file mode 100644 (file)
index e70ae12..0000000
+++ /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
index d391d1e..12850df 100644 (file)
 #   limitations under the License.                                             #
 ################################################################################
 
 #   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" . }}
index bd742a9..02789f1 100644 (file)
 
 kind: Deployment
 apiVersion: apps/v1
 
 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
 spec:
   replicas: 1
-  selector:
-    matchLabels:
-      app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.nonrtricgateway" . }}
-      release: {{ .Release.Name }}
+  selector: {{- include "common.selectors" . | nindent 4 }}
   template:
   template:
-    metadata:
-      labels:
-        app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.nonrtricgateway" . }}
-        release: {{ .Release.Name }}
+    metadata: {{- include "common.templateMetadata" . | nindent 6 }}
     spec:
     spec:
-      hostname: {{ include "common.name.nonrtricgateway" . }}
+      hostname: {{ include "common.name" . }}
       containers:
       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 }}
index 085c0e6..48461eb 100644 (file)
 #   limitations under the License.                                             #
 ################################################################################
 
 #   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" . }}
index 8625a85..c37308e 100644 (file)
 # This is a YAML-formatted file.
 # Declare variables to be passed into your templates.
 
 # 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
index 830e4b4..24949ac 100755 (executable)
@@ -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
 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 (executable)
index 8f0fc56..0000000
+++ /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 }}
index f431a39..c5b5520 100755 (executable)
 
 apiVersion: apps/v1
 kind: Deployment
 
 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 }}
 spec:
   replicas: {{ .Values.replicaCount }}
-  selector:
-    matchLabels:
-      {{- include "odu-app-ics-version.selectorLabels" . | nindent 6 }}
+  selector: {{- include "common.selectors" . | nindent 4 }}
   template:
   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:
     spec:
       {{- with .Values.imagePullSecrets }}
       imagePullSecrets:
@@ -40,7 +29,7 @@ spec:
       securityContext:
         {{- toYaml .Values.podSecurityContext | nindent 8 }}
       containers:
       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 }}"
           securityContext:
             {{- toYaml .Values.securityContext | nindent 12 }}
           image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
index aad3ac1..0f0441c 100755 (executable)
 #  limitations under the License.
 #  ============LICENSE_END=================================================
 
 #  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" . }}
index 54650db..27e861d 100755 (executable)
@@ -59,7 +59,9 @@ securityContext: {}
 
 service:
   type: ClusterIP
 
 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
 
 resources: {}
   # We usually recommend not to specify default resources and to leave this as a conscious
index a08d02b..fa4e5ec 100755 (executable)
@@ -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
 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 (executable)
index 0220d2e..0000000
+++ /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 }}
index 7978f8f..8a2f098 100755 (executable)
 
 apiVersion: apps/v1
 kind: Deployment
 
 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 }}
 spec:
   replicas: {{ .Values.replicaCount }}
-  selector:
-    matchLabels:
-      {{- include "odu-app.selectorLabels" . | nindent 6 }}
+  selector: {{- include "common.selectors" . | nindent 4 }}
   template:
   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:
     spec:
       {{- with .Values.imagePullSecrets }}
       imagePullSecrets:
@@ -40,7 +29,7 @@ spec:
       securityContext:
         {{- toYaml .Values.podSecurityContext | nindent 8 }}
       containers:
       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 }}"
           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 }}"
             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 }}
           resources:
             {{- toYaml .Values.resources | nindent 12 }}
       {{- with .Values.nodeSelector }}
index 6c64790..0f0441c 100755 (executable)
 #  limitations under the License.
 #  ============LICENSE_END=================================================
 
 #  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" . }}
index 8c97d64..96fbe07 100755 (executable)
@@ -56,7 +56,9 @@ securityContext: {}
 
 service:
   type: ClusterIP
 
 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
 
 resources: {}
   # We usually recommend not to specify default resources and to leave this as a conscious
index 680882a..aee48e4 100644 (file)
@@ -3,3 +3,8 @@ appVersion: "1.0.0"
 description: A Helm chart to deploy oru-app
 name: oru-app
 version: 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"
index 259387f..b417a21 100644 (file)
@@ -1,10 +1,5 @@
 apiVersion: v1
 kind: ConfigMap
 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 }}
 data:
 {{ tpl (.Files.Glob "resources/config/*.{json,xml,txt}").AsConfig . | indent 2 }}
index 3a10003..72a9ffa 100644 (file)
@@ -1,15 +1,9 @@
 apiVersion: v1
 kind: ConfigMap
 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 }}
 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 }}
   SDNR-HOST: {{ .Values.conf.sdnrHost | quote }}
   SDNR-PORT: {{ .Values.conf.sdnrPort | quote }}
   VERBOSE: {{ .Values.conf.verbose | quote }}
-
index 6999b95..e13084e 100644 (file)
@@ -1,32 +1,21 @@
 apiVersion: apps/v1
 kind: Deployment
 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 }}
 spec:
   replicas: {{ .Values.replicaCount }}
-  selector:
-    matchLabels:
-      name: oru-app
+  selector: {{- include "common.selectors" . | nindent 4 }}
   template:
   template:
-    metadata:
-      labels:
-        name: oru-app
-        release: {{ .Release.Name }}
-        chart: {{ .Chart.Name }}
+    metadata: {{- include "common.templateMetadata" . | nindent 6 }}
     spec:
       containers:
     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:
           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
           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:
       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
           items:
           - key: o-ru-to-o-du-map.txt
             path: o-ru-to-o-du-map.txt
index 46d78c6..f024c64 100644 (file)
@@ -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" . }}
index 66b2f15..45c5b99 100644 (file)
@@ -9,7 +9,8 @@ image:
 service:
   type: NodePort
   ports:
 service:
   type: NodePort
   ports:
-    port: 830
+  - name: http
+    targetPort: 830
     nodePort: 30835
 
 simulators:
     nodePort: 30835
 
 simulators:
index 5b5c0c6..f47bc80 100644 (file)
@@ -23,4 +23,4 @@ version: 2.0.0
 dependencies:
   - name: nonrtric-common
     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 (file)
index ffb6f8c..0000000
+++ /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 (file)
index 56e96aa..0000000
+++ /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"
-          }
-        }
-      }
-    }
-}
index 9c91f7d..20271d7 100644 (file)
 #   limitations under the License.                                             #
 ################################################################################
 
 #   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
 ---
 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:
 data:
-{{ tpl (.Files.Glob "resources/data/*").AsConfig . | indent 2 }}
\ No newline at end of file
+  application_configuration.json: |
+    {{- .Values.config | toRawJson | nindent 4 }}
index e9158e2..9a20b72 100644 (file)
 ################################################################################
 */}}
 
 ################################################################################
 */}}
 
-{{- if .Values.policymanagementservice.ingress.enabled -}}
+{{- if (include "common.ingressEnabled" .) -}}
 apiVersion: networking.k8s.io/v1
 kind: Ingress
 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:
 spec:
   ingressClassName: {{ include "common.ingressClassName" . }}
   rules:
@@ -30,9 +27,9 @@ spec:
         paths:
           - backend:
               service:
         paths:
           - backend:
               service:
-                name: {{ include "common.name.policymanagementservice" . }}
+                name: {{ include "common.name" . }}
                 port:
                 port:
-                  number: {{ .Values.policymanagementservice.service.internalPort1 }}
+                  number: {{ (first .Values.service.ports).internalPort }}
             path: "/a1-policy"
             pathType: Prefix
 {{- end -}}
             path: "/a1-policy"
             pathType: Prefix
 {{- end -}}
index 6d820e2..be38ac4 100644 (file)
 #   limitations under the License.                                             #
 ################################################################################
 
 #   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" . }}
index 0930d07..5986f83 100644 (file)
 
 kind: StatefulSet
 apiVersion: apps/v1
 
 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:
 spec:
-  serviceName: {{ include "common.name.policymanagementservice" . }}
+  serviceName: {{ include "common.name" . }}
   replicas: 1
   replicas: 1
-  selector:
-    matchLabels:
-      app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.policymanagementservice" . }}
-      release: {{ .Release.Name }}
+  selector: {{- include "common.selectors" . | nindent 4 }}
   template:
   template:
-    metadata:
-      labels:
-        app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.policymanagementservice" . }}
-        release: {{ .Release.Name }}
+    metadata: {{- include "common.templateMetadata" . | nindent 6 }}
     spec:
     spec:
-      hostname: {{ include "common.name.policymanagementservice" . }}
+      hostname: {{ include "common.name" . }}
       initContainers:
       - name: copy
         image: busybox:1.28
       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;
         - 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:
         volumeMounts:
-        - name: {{ include "common.name.policymanagementservice" . }}-vardata
+        - name: {{ include "common.vardataMountName" . }}
           mountPath: "/var/policy-management-service"
           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:
           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:
         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
           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:
           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:
           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 }}
index b30dfb0..20de309 100644 (file)
 # This is a YAML-formatted file.
 # Declare variables to be passed into your templates.
 
 # 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:
index 4d28e41..a6eeabb 100644 (file)
@@ -23,4 +23,4 @@ version: 1.0.0
 dependencies:
   - name: nonrtric-common
     version: ^2.0.0
 dependencies:
   - name: nonrtric-common
     version: ^2.0.0
-    repository: "@local"
\ No newline at end of file
+    repository: "@local"
index 95304c5..810c7d3 100644 (file)
 
 kind: Deployment
 apiVersion: apps/v1
 
 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
 spec:
   replicas: 1
-  selector:
-    matchLabels:
-      app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.rappcatalogueservice" . }}
-      release: {{ .Release.Name }}
+  selector: {{- include "common.selectors" . | nindent 4 }}
   template:
   template:
-    metadata:
-      labels:
-        app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.rappcatalogueservice" . }}
-        release: {{ .Release.Name }}
+    metadata: {{- include "common.templateMetadata" . | nindent 6 }}
     spec:
     spec:
-      hostname: {{ include "common.name.rappcatalogueservice" . }}
+      hostname: {{ include "common.name" . }}
       containers:
       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 }}
index 2c056eb..be38ac4 100644 (file)
 #   limitations under the License.                                             #
 ################################################################################
 
 #   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" . }}
index a59059d..ecf1ea7 100644 (file)
 # This is a YAML-formatted file.
 # Declare variables to be passed into your templates.
 
 # 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
index c6be83c..006b48d 100644 (file)
@@ -1,57 +1,57 @@
-################################################################################\r
-#   Copyright (c) 2021 HCL Technologies Limited.                               #\r
-#                                                                              #\r
-#   Licensed under the Apache License, Version 2.0 (the "License");            #\r
-#   you may not use this file except in compliance with the License.           #\r
-#   You may obtain a copy of the License at                                    #\r
-#                                                                              #\r
-#       http://www.apache.org/licenses/LICENSE-2.0                             #\r
-#                                                                              #\r
-#   Unless required by applicable law or agreed to in writing, software        #\r
-#   distributed under the License is distributed on an "AS IS" BASIS,          #\r
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #\r
-#   See the License for the specific language governing permissions and        #\r
-#   limitations under the License.                                             #\r
-################################################################################\r
-\r
-{{- define "common.name.influxdb" -}}\r
-  {{- printf "influxdb" -}}\r
-{{- end -}}\r
-\r
-{{- define "common.fullname.influxdb" -}}\r
-  {{- $name := ( include "common.name.influxdb" . ) -}}\r
-  {{- $namespace := ( include "common.namespace.platform" . ) -}}\r
-  {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}}\r
-{{- end -}}\r
-\r
-{{- define "common.influxdb.chart" -}}\r
-{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}\r
-{{- end -}}\r
-\r
-{{- define "common.influxdb.labels" -}}\r
-helm.sh/chart: {{ include "common.influxdb.chart" . }}\r
-{{ include "common.influxdb.selectorLabels" . }}\r
-{{- if .Chart.AppVersion }}\r
-app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}\r
-{{- end }}\r
-app.kubernetes.io/managed-by: {{ .Release.Service }}\r
-{{- end -}}\r
-\r
-{{- define "common.influxdb.selectorLabels" -}}\r
-app.kubernetes.io/name: {{ include "common.name.influxdb" . }}\r
-app.kubernetes.io/instance: {{ .Release.Name }}\r
-{{- end -}}\r
-\r
-{{- define "common.influxdb.serviceAccountName" -}}\r
-  {{- $name := ( include "common.fullname.influxdb" . ) -}}\r
-  {{- printf "service-%s-http" $name | trunc 63 | trimSuffix "-" -}}\r
-{{- end -}}\r
-\r
-{{- define "common.serviceport.influxdb.http" -}}8086{{- end -}}\r
-{{- define "common.serviceport.influxdb.meta.bind_address" -}}8091{{- end -}}\r
-{{- define "common.serviceport.influxdb.http.bind_address" -}}8086{{- end -}}\r
-{{- define "common.serviceport.influxdb.rpc.bind_address" -}}8088{{- end -}}\r
-{{- define "common.serviceport.influxdb.graphite.bind_address" -}}2003{{- end -}}\r
-{{- define "common.serviceport.influxdb.udp.bind_address" -}}8089{{- end -}}\r
-{{- define "common.serviceport.influxdb.opentsdb.bind_address" -}}4242{{- end -}}\r
-{{- define "common.serviceport.influxdb.collectd.bind_address" -}}25826{{- end -}}\r
+################################################################################
+#   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 -}}
index d423c39..f9d2709 100644 (file)
@@ -27,7 +27,7 @@
     {{- end -}}
   {{- else -}}
     {{- with index $ctx $currentkey }}
     {{- end -}}
   {{- else -}}
     {{- with index $ctx $currentkey }}
-      {{- $newctx := dict "ctx" . "printkeys" $restkeys -}} 
+      {{- $newctx := dict "ctx" . "printkeys" $restkeys -}}
       {{- include "recursiveprinter" $newctx -}}
     {{- end -}}
   {{- end -}}
       {{- 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) -}}
     {{- 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 -}}
         {{- include "recursiveprinter" $newctx -}}
       {{- end -}}
     {{- end -}}
index 47dd953..759db6f 100644 (file)
@@ -17,3 +17,8 @@ appVersion: "1.0.0"
 description: A Helm chart to deploy topology
 name: topology
 version: 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"
index 8a06b08..2991abf 100644 (file)
 
 apiVersion: v1
 kind: ConfigMap
 
 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 }}
 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 }}
 
   PROVIDERS: {{ .Values.conf.providers | quote }}
   LOAD_PACKAGES: {{ .Values.conf.loadPackages | quote }}
 
index 9da2f13..aa14195 100644 (file)
 
 apiVersion: apps/v1
 kind: Deployment
 
 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 }}
 spec:
   replicas: {{ .Values.replicaCount }}
-  selector:
-    matchLabels:
-      name: topology
+  selector: {{- include "common.selectors" . | nindent 4 }}
   template:
   template:
-    metadata:
-      labels:
-        name: topology
-        release: {{ .Release.Name }}
-        chart: {{ .Chart.Name }}
-    spec:    
+    metadata: {{- include "common.templateMetadata" . | nindent 6 }}
+    spec:
       containers:
       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:
           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:
           securityContext:
             capabilities:
               add:
index 1ccb79e..879f61d 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
 # 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" . }}
index 0781e2b..d7a6a4f 100644 (file)
@@ -23,7 +23,9 @@ image:
 service:
   type: NodePort
   ports:
 service:
   type: NodePort
   ports:
-    port: 3001
+  - name: http
+    internalPort: "3001"
+    targetPort: "3001"
     nodePort: 32001
 
 conf:
     nodePort: 32001
 
 conf: