From 32a43aaef378cc15082309a7ee6e5bae026d7114 Mon Sep 17 00:00:00 2001 From: Lathish Date: Wed, 20 May 2020 23:18:18 +0100 Subject: [PATCH] Enable https port Issue-ID: NONRTRIC-224 Change-Id: I65b80da2f45007c57d4246d6f7f40085756c7126 Signed-off-by: Lathish --- nonrtric/RECIPE_EXAMPLE/example_recipe.yaml | 34 +++++++++++++++++++--- .../controlpanel/resources/application.properties | 9 +++++- .../helm/controlpanel/templates/deployment.yaml | 18 ++++++++---- nonrtric/helm/controlpanel/templates/service.yaml | 14 +++++++-- nonrtric/helm/controlpanel/values.yaml | 17 +++++++++-- .../templates/deployment.yaml | 16 +++++++--- .../policymanagementservice/templates/service.yaml | 16 +++++++--- nonrtric/helm/policymanagementservice/values.yaml | 17 +++++++++-- 8 files changed, 115 insertions(+), 26 deletions(-) diff --git a/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml b/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml index 4a7d3f0b..76025042 100644 --- a/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml +++ b/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml @@ -66,8 +66,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: @@ -78,5 +91,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 -- 2.16.6