Skip to content

Commit

Permalink
Merge pull request #706 from syedsalman3753/develop
Browse files Browse the repository at this point in the history
[DSD-5585] Fixed deployment pmp-reactjs-ui issues
  • Loading branch information
ckm007 authored Jul 4, 2024
2 parents 30bbad9 + 3c13745 commit b0a382c
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 18 deletions.
53 changes: 41 additions & 12 deletions charts/pmp-reactjs-ui/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,49 @@ metadata:
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data:
REACT_APP_PARTNER_MANAGER_API_BASE_URL: {{ .Values.pmp_new.react_app_partner_manager_api_base_url }}/v1/partnermanager
REACT_APP_POLICY_MANAGER_API_BASE_URL: {{ .Values.pmp_new.react_app_policy_manager_api_base_url }}/v1/policymanager
nginx.conf: |-
server {
listen 3000;
server_name localhost;
add_header X-Frame-Options DENY;
worker_processes 1;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
#index index.html index.htm;
events {
worker_connections 1024;
}
location / {
root /usr/share/nginx/html;
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_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 /v1/policymanager {
proxy_pass {{ .Values.pmp_new.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;
}
}
}
17 changes: 16 additions & 1 deletion charts/pmp-reactjs-ui/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ spec:
value: {{ .Values.containerSecurityContext.runAsUser }}
- 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 }}
- name: REACT_APP_POLICY_MANAGER_API_BASE_URL
value: {{ .Values.pmp_new.react_app_policy_manager_api_base_url }}
{{- if .Values.extraEnvVars }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
Expand All @@ -107,6 +111,10 @@ spec:
- secretRef:
name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }}
{{- end }}
volumeMounts:
- name: nginx-config
mountPath: {{ .Values.nginx.volume_mount_path }}
subPath: {{ .Values.nginx.sub_path }}
ports:
- name: spring-service
containerPort: {{ .Values.springServicePort }}
Expand All @@ -130,4 +138,11 @@ spec:
{{- end }}
{{- if .Values.sidecars }}
{{- include "common.tplvalues.render" ( dict "value" .Values.sidecars "context" $) | nindent 8 }}
{{- end }}
{{- end }}
volumes:
- name: nginx-config
configMap:
name: {{ template "common.names.fullname" . }}
items:
- key: nginx.conf
path: nginx.conf
15 changes: 10 additions & 5 deletions charts/pmp-reactjs-ui/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ service:

image:
registry: docker.io
repository: mosipdev/pmp-reactjs-ui
repository: mosipqa/pmp-reactjs-ui
tag: develop

## Specify a imagePullPolicy
Expand Down Expand Up @@ -249,7 +249,6 @@ extraEnvVarsCM:
- global
- config-server-share
- artifactory-share
- pmp-reactjs-ui

## Secret with extra environment variables
##
Expand Down Expand Up @@ -415,13 +414,19 @@ metrics:
rules: []

pmp_new:
react_app_partner_manager_api_base_url: 'https://api-internal.sandbox.xyz.net'
react_app_policy_manager_api_base_url: 'https://api-internal.sandbox.xyz.net'
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'

## The url below is to access pmp API services.
## CAUTION: Domain name to acess pmp UI must be secure/internal/over vpn.
## CAUTION: Domain name to access pmp UI must be secure/internal/over vpn.
## Slash is important!

nginx:
volume_mount_path: /etc/nginx/nginx.conf
sub_path: nginx.conf

## pmp UI swagger should have only internal access. Hence linked to internal gateway
## We create a gateway for pmp specific URL(s) listed under `hosts`
istio:
Expand Down
8 changes: 8 additions & 0 deletions charts/pms-partner/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ spec:
value: {{ .Values.containerSecurityContext.runAsUser }}
- name: JDK_JAVA_OPTIONS
value: {{ .Values.additionalResources.javaOpts }}
{{- if .Values.springConfigNameEnv }}
- name: spring_config_name_env
value: {{ .Values.springConfigNameEnv }}
{{- end }}
{{- if .Values.activeProfileEnv }}
- name: active_profile_env
value: {{ .Values.activeProfileEnv }}
{{- end }}
{{- if .Values.extraEnvVars }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
Expand Down
4 changes: 4 additions & 0 deletions charts/pms-partner/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -451,3 +451,7 @@ istio:
- PATCH
- PUT
- DELETE

# Set configuration
# springConfigNameEnv:
# activeProfileEnv:
8 changes: 8 additions & 0 deletions charts/pms-policy/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ spec:
value: {{ .Values.containerSecurityContext.runAsUser }}
- name: JDK_JAVA_OPTIONS
value: {{ .Values.additionalResources.javaOpts }}
{{- if .Values.springConfigNameEnv }}
- name: spring_config_name_env
value: {{ .Values.springConfigNameEnv }}
{{- end }}
{{- if .Values.activeProfileEnv }}
- name: active_profile_env
value: {{ .Values.activeProfileEnv }}
{{- end }}
{{- if .Values.extraEnvVars }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
Expand Down
4 changes: 4 additions & 0 deletions charts/pms-policy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -451,3 +451,7 @@ istio:
- PATCH
- PUT
- DELETE

# Set configuration
# springConfigNameEnv:
# activeProfileEnv:

0 comments on commit b0a382c

Please sign in to comment.