Enable https port
Issue-ID: NONRTRIC-224
Change-Id: I65b80da2f45007c57d4246d6f7f40085756c7126
Signed-off-by: Lathish <lathishbabu.ganesan@est.tech>
diff --git a/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml b/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml
index 4a7d3f0..7602504 100644
--- a/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml
+++ b/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml
@@ -66,8 +66,21 @@
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 @@
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 acf2092..2ffa5b7 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 d2fbd57..0d08ea4 100644
--- a/nonrtric/helm/controlpanel/templates/deployment.yaml
+++ b/nonrtric/helm/controlpanel/templates/deployment.yaml
@@ -45,9 +45,10 @@
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 @@
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 cf0d36f..1a61ed7 100644
--- a/nonrtric/helm/controlpanel/templates/service.yaml
+++ b/nonrtric/helm/controlpanel/templates/service.yaml
@@ -27,10 +27,18 @@
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
- targetPort: {{ .Values.controlpanel.service.internalPort }}
+ {{- 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
diff --git a/nonrtric/helm/controlpanel/values.yaml b/nonrtric/helm/controlpanel/values.yaml
index 23fe2fd..d7a6285 100644
--- a/nonrtric/helm/controlpanel/values.yaml
+++ b/nonrtric/helm/controlpanel/values.yaml
@@ -26,5 +26,18 @@
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 9f05959..1a54154 100644
--- a/nonrtric/helm/policymanagementservice/templates/deployment.yaml
+++ b/nonrtric/helm/policymanagementservice/templates/deployment.yaml
@@ -45,13 +45,21 @@
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 f7bde7c..2358692 100644
--- a/nonrtric/helm/policymanagementservice/templates/service.yaml
+++ b/nonrtric/helm/policymanagementservice/templates/service.yaml
@@ -26,10 +26,18 @@
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 bafe095..45593cd 100644
--- a/nonrtric/helm/policymanagementservice/values.yaml
+++ b/nonrtric/helm/policymanagementservice/values.yaml
@@ -25,7 +25,20 @@
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