From edacf959197b35aa2c78de12652f6401cfdeef29 Mon Sep 17 00:00:00 2001 From: Abhishek S <127825992+abhishek8shankar@users.noreply.github.com> Date: Fri, 20 Dec 2024 17:43:53 +0530 Subject: [PATCH] [MOSIP-38169] Updated deployment scripts for pmp-revamp-ui (#1052) * [MOSIP-38169] Updated deployment scripts for pmp-revamp-ui Signed-off-by: Abhi * [MOSIP-38169] Updated deployment scripts for pmp-revamp-ui Signed-off-by: Abhishek S <127825992+abhishek8shankar@users.noreply.github.com> --------- Signed-off-by: Abhi Signed-off-by: Abhishek S <127825992+abhishek8shankar@users.noreply.github.com> --- deploy/pmp-revamp-ui/install.sh | 2 +- helm/pmp-revamp-ui/templates/configmap.yaml | 41 +++++++++++++------- helm/pmp-revamp-ui/templates/deployment.yaml | 4 +- helm/pmp-revamp-ui/values.yaml | 10 ++--- 4 files changed, 35 insertions(+), 22 deletions(-) diff --git a/deploy/pmp-revamp-ui/install.sh b/deploy/pmp-revamp-ui/install.sh index c5cc39ef3..3a33ef951 100644 --- a/deploy/pmp-revamp-ui/install.sh +++ b/deploy/pmp-revamp-ui/install.sh @@ -50,4 +50,4 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true set -o nounset ## set -u : exit the script if you try to use an uninitialised variable set -o errtrace # trace ERR through 'time command' and other functions set -o pipefail # trace ERR through pipes -installing_pmp_ui # calling function \ No newline at end of file +installing_pmp_revamp_ui # calling function \ No newline at end of file diff --git a/helm/pmp-revamp-ui/templates/configmap.yaml b/helm/pmp-revamp-ui/templates/configmap.yaml index c9bce5ae4..94e91421c 100644 --- a/helm/pmp-revamp-ui/templates/configmap.yaml +++ b/helm/pmp-revamp-ui/templates/configmap.yaml @@ -3,39 +3,53 @@ kind: ConfigMap metadata: name: {{ template "common.names.fullname" . }} namespace: {{ .Release.Namespace }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: + {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + annotations: + {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} data: + REACT_APP_PARTNER_MANAGER_API_BASE_URL: {{ .Values.pmp_revamp.pms_partner_manager_internal_service_url }} + REACT_APP_POLICY_MANAGER_API_BASE_URL: {{ .Values.pmp_revamp.pms_policy_manager_internal_service_url }} + default.conf: | + server { + listen 3000; + server_name localhost; + add_header X-Frame-Options DENY; + + location / { + root /usr/share/nginx/html; + } + } nginx.conf: |- worker_processes 1; - + events { worker_connections 1024; } - + http { access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; server { listen 3000; server_name localhost; - + root /usr/share/nginx/html; index index.html index.htm; include /etc/nginx/mime.types; - + gzip on; gzip_min_length 1000; gzip_proxied expired no-cache no-store private auth; gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript; - + location /v1/partnermanager { - proxy_pass {{ .Values.pmp_new.pms_partner_manager_internal_service_url }}; + proxy_pass {{ .Values.pmp_revamp.pms_partner_manager_internal_service_url }}; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; @@ -43,16 +57,15 @@ data: proxy_set_header X-Forwarded-Host $server_name; } location /v1/policymanager { - proxy_pass {{ .Values.pmp_new.pms_policy_manager_internal_service_url }}; + proxy_pass {{ .Values.pmp_revamp.pms_policy_manager_internal_service_url }}; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $server_name; } - + location / { - # alias /usr/share/nginx/html; try_files $uri $uri/ /index.html; } } diff --git a/helm/pmp-revamp-ui/templates/deployment.yaml b/helm/pmp-revamp-ui/templates/deployment.yaml index c2585e0e5..0493dd749 100644 --- a/helm/pmp-revamp-ui/templates/deployment.yaml +++ b/helm/pmp-revamp-ui/templates/deployment.yaml @@ -94,9 +94,9 @@ spec: - name: JDK_JAVA_OPTIONS value: {{ .Values.additionalResources.javaOpts }} - name: REACT_APP_PARTNER_MANAGER_API_BASE_URL - value: {{ .Values.pmp_new.react_app_partner_manager_api_base_url }} + value: {{ .Values.pmp_revamp.react_app_partner_manager_api_base_url }} - name: REACT_APP_POLICY_MANAGER_API_BASE_URL - value: {{ .Values.pmp_new.react_app_policy_manager_api_base_url }} + value: {{ .Values.pmp_revamp.react_app_policy_manager_api_base_url }} {{- if .Values.extraEnvVars }} {{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }} {{- end }} diff --git a/helm/pmp-revamp-ui/values.yaml b/helm/pmp-revamp-ui/values.yaml index 107d1c0d2..c5c3a11ea 100644 --- a/helm/pmp-revamp-ui/values.yaml +++ b/helm/pmp-revamp-ui/values.yaml @@ -413,11 +413,11 @@ metrics: # severity: error rules: [] -pmp_new: - react_app_partner_manager_api_base_url: 'https://api-internal.sandbox.xyz.net/v1/partnermanager' - react_app_policy_manager_api_base_url: 'https://api-internal.sandbox.xyz.net/v1/policymanager' - pms_partner_manager_internal_service_url: 'http://pms-partner.pms/v1/partnermanager' - pms_policy_manager_internal_service_url: 'http://pms-policy.pms/v1/policymanager' +pmp_revamp: + react_app_partner_manager_api_base_url: 'https://$INTERNAL_API_HOST/v1/partnermanager' + react_app_policy_manager_api_base_url: 'https://$INTERNAL_API_HOST/v1/policymanager' + pms_partner_manager_internal_service_url: 'http://$PARTNER_MANAGER_SERVICE_NAME.$NS/v1/partnermanager' + pms_policy_manager_internal_service_url: 'http://$POLICY_MANAGER_SERVICE_NAME.$NS/v1/policymanager' ## The url below is to access pmp API services. ## CAUTION: Domain name to access pmp UI must be secure/internal/over vpn.