From: Lusheng Ji Date: Fri, 29 May 2020 17:41:41 +0000 (+0000) Subject: Merge "Enable https port" X-Git-Tag: f-release~102 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=2047196f688aa19a83dc1e68c5f12d2933d92bc9;hp=aaf2c67f6ca136ab51efe275ce48d75076f696f4;p=it%2Fdep.git Merge "Enable https port" --- diff --git a/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml b/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml index 77582e51..6231bd92 100644 --- a/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml +++ b/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml @@ -77,8 +77,21 @@ controlpanel: tag: 1.0.0 replicaCount: 1 service: - internalPort: 8080 - externalPort: 30090 + allowHttp: true + httpName: http + internalPort1: 8080 + targetPort1: 8080 + externalPort1: 30091 + httpsName: https + internalPort2: 8081 + targetPort2: 8082 + externalPort2: 30092 + liveness: + initialDelaySeconds: 20 + periodSeconds: 10 + readiness: + initialDelaySeconds: 20 + periodSeconds: 10 # Need to check the external port Availability policymanagementservice: @@ -89,5 +102,18 @@ policymanagementservice: name: nonrtric-policy-agent tag: 1.0.0 service: - internalPort: 8081 - externalPort: 30091 \ No newline at end of file + allowHttp: true + httpName: http + internalPort1: 9080 + targetPort1: 8081 + externalPort1: 30093 + httpsName: https + internalPort2: 9081 + targetPort2: 8433 + externalPort2: 30094 + liveness: + initialDelaySeconds: 20 + periodSeconds: 10 + readiness: + initialDelaySeconds: 20 + periodSeconds: 10 \ No newline at end of file diff --git a/nonrtric/helm/controlpanel/resources/application.properties b/nonrtric/helm/controlpanel/resources/application.properties index acf20928..2ffa5b7c 100644 --- a/nonrtric/helm/controlpanel/resources/application.properties +++ b/nonrtric/helm/controlpanel/resources/application.properties @@ -14,8 +14,15 @@ # limitations under the License. # ################################################################################ server.port = 8082 +server.ssl.key-store-type = PKCS12 +server.ssl.key-store-password = ericsson_kwdjfhw +server.ssl.key-store = classpath:keystore.jks +server.ssl.key-password = ericsson_kwdjfhw server.http.port = 8080 -policycontroller.url.prefix = http://policymanagementservice:8081 +# https api +policycontroller.url.prefix = https://policymanagementservice:9081 +# http api +#policycontroller.url.prefix = http://policymanagementservice:9080 userfile = users.json portalapi.decryptor = org.oransc.portal.nonrtric.controlpanel.portalapi.PortalSdkDecryptorAes portalapi.usercookie = UserId diff --git a/nonrtric/helm/controlpanel/templates/deployment.yaml b/nonrtric/helm/controlpanel/templates/deployment.yaml index d2fbd579..0d08ea44 100644 --- a/nonrtric/helm/controlpanel/templates/deployment.yaml +++ b/nonrtric/helm/controlpanel/templates/deployment.yaml @@ -45,9 +45,10 @@ spec: image: {{ .Values.controlpanel.image.registry }}/{{ .Values.controlpanel.image.name }}:{{ .Values.controlpanel.image.tag }} imagePullPolicy: {{ .Values.controlpanel.imagePullPolicy }} ports: - - name: http - containerPort: {{ .Values.controlpanel.service.internalPort }} - protocol: TCP + - containerPort: {{ .Values.controlpanel.service.targetPort1 }} + protocol: TCP + - containerPort: {{ .Values.controlpanel.service.targetPort2 }} + protocol: TCP volumeMounts: - name: configmap mountPath: /maven/application.properties @@ -55,9 +56,14 @@ spec: readOnly: true readinessProbe: tcpSocket: - port: {{ .Values.controlpanel.service.internalPort }} - initialDelaySeconds: 15 - periodSeconds: 15 + 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: diff --git a/nonrtric/helm/controlpanel/templates/service.yaml b/nonrtric/helm/controlpanel/templates/service.yaml index cf0d36fb..1a61ed75 100644 --- a/nonrtric/helm/controlpanel/templates/service.yaml +++ b/nonrtric/helm/controlpanel/templates/service.yaml @@ -27,10 +27,18 @@ metadata: spec: type: NodePort ports: - - port: {{ .Values.controlpanel.service.internalPort }} - nodePort: {{ .Values.controlpanel.service.externalPort }} + {{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 - targetPort: {{ .Values.controlpanel.service.internalPort }} selector: app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.controlpanel" . }} release: {{ .Release.Name }} \ No newline at end of file diff --git a/nonrtric/helm/controlpanel/values.yaml b/nonrtric/helm/controlpanel/values.yaml index 23fe2fda..d7a6285d 100644 --- a/nonrtric/helm/controlpanel/values.yaml +++ b/nonrtric/helm/controlpanel/values.yaml @@ -26,5 +26,18 @@ controlpanel: tag: 1.0.0 replicaCount: 1 service: - internalPort: 8080 - externalPort: 30090 + allowHttp: true + httpName: http + internalPort1: 8080 + targetPort1: 8080 + externalPort1: 30091 + httpsName: https + internalPort2: 8081 + targetPort2: 8082 + externalPort2: 30092 + liveness: + initialDelaySeconds: 20 + periodSeconds: 10 + readiness: + initialDelaySeconds: 20 + periodSeconds: 10 diff --git a/nonrtric/helm/policymanagementservice/templates/deployment.yaml b/nonrtric/helm/policymanagementservice/templates/deployment.yaml index 9f059590..1a541542 100644 --- a/nonrtric/helm/policymanagementservice/templates/deployment.yaml +++ b/nonrtric/helm/policymanagementservice/templates/deployment.yaml @@ -45,13 +45,21 @@ spec: image: {{ .Values.policymanagementservice.image.registry }}/{{ .Values.policymanagementservice.image.name }}:{{ .Values.policymanagementservice.image.tag }} imagePullPolicy: {{ .Values.policymanagementservice.imagePullPolicy }} ports: - - containerPort: {{ .Values.policymanagementservice.service.internalPort }} + - containerPort: {{ .Values.policymanagementservice.service.targetPort1 }} + protocol: TCP + - containerPort: {{ .Values.policymanagementservice.service.targetPort2 }} protocol: TCP readinessProbe: tcpSocket: - port: {{ .Values.policymanagementservice.service.internalPort }} - initialDelaySeconds: 5 - periodSeconds: 15 + 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 }} volumeMounts: - name: {{ include "common.name.policymanagementservice" . }}-policy-conf mountPath: /opt/app/policy-agent/config/application_configuration.json diff --git a/nonrtric/helm/policymanagementservice/templates/service.yaml b/nonrtric/helm/policymanagementservice/templates/service.yaml index f7bde7cd..23586928 100644 --- a/nonrtric/helm/policymanagementservice/templates/service.yaml +++ b/nonrtric/helm/policymanagementservice/templates/service.yaml @@ -26,10 +26,18 @@ metadata: heritage: {{ .Release.Service }} spec: ports: - - name: {{ .Values.policymanagementservice.service.name }} - protocol: TCP - port: {{ .Values.policymanagementservice.service.internalPort }} - nodePort: {{ .Values.policymanagementservice.service.externalPort }} + {{if eq .Values.policymanagementservice.service.allowHttp true -}} + - name: {{ index .Values.policymanagementservice.service.httpName }} + port: {{ .Values.policymanagementservice.service.internalPort1 }} + targetPort: {{ .Values.policymanagementservice.service.targetPort1 }} + nodePort: {{ .Values.policymanagementservice.service.externalPort1 }} + protocol: TCP + {{- end }} + - name: {{ index .Values.policymanagementservice.service.httpsName }} + port: {{ .Values.policymanagementservice.service.internalPort2 }} + targetPort: {{ .Values.policymanagementservice.service.targetPort2 }} + nodePort: {{ .Values.policymanagementservice.service.externalPort2 }} + protocol: TCP selector: app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.policymanagementservice" . }} release: {{ .Release.Name }} diff --git a/nonrtric/helm/policymanagementservice/values.yaml b/nonrtric/helm/policymanagementservice/values.yaml index bafe0954..45593cde 100644 --- a/nonrtric/helm/policymanagementservice/values.yaml +++ b/nonrtric/helm/policymanagementservice/values.yaml @@ -25,7 +25,20 @@ policymanagementservice: name: nonrtric-policy-agent tag: 1.0.0 service: - internalPort: 8081 - externalPort: 30091 + allowHttp: true + httpName: http + internalPort1: 9080 + targetPort1: 8081 + externalPort1: 30093 + httpsName: https + internalPort2: 9081 + targetPort2: 8433 + externalPort2: 30094 + liveness: + initialDelaySeconds: 20 + periodSeconds: 10 + readiness: + initialDelaySeconds: 20 + periodSeconds: 10