From a2003f1b6c9b64bb8492513fd66b42b75bd749fb Mon Sep 17 00:00:00 2001 From: Challa Rao <47347156+challabeehyv@users.noreply.github.com> Date: Fri, 1 Mar 2024 16:55:12 +0530 Subject: [PATCH] Revert "[DSD-4641] updated helm" --- helm/inji-web/README.md | 2 +- helm/inji-web/install.sh | 11 +++---- helm/inji-web/templates/clusterrole.yaml | 33 ++++--------------- .../templates/clusterrolebinding.yaml | 2 +- helm/inji-web/templates/configmap.yaml | 24 ++++++++++++-- helm/inji-web/values.yaml | 13 ++++++-- 6 files changed, 45 insertions(+), 40 deletions(-) diff --git a/helm/inji-web/README.md b/helm/inji-web/README.md index eb754b34..04bc265c 100644 --- a/helm/inji-web/README.md +++ b/helm/inji-web/README.md @@ -1,4 +1,4 @@ -# injiweb ui +# oidc-ui ## Overview Refer [Commons](https://docs.mosip.io/1.2.0/modules/commons). diff --git a/helm/inji-web/install.sh b/helm/inji-web/install.sh index 8c745cf5..38ffd06a 100755 --- a/helm/inji-web/install.sh +++ b/helm/inji-web/install.sh @@ -20,18 +20,17 @@ function installing_inji-web() { helm repo update echo Copy configmaps - # ./copy_cm.sh + ./copy_cm.sh ESIGNET_HOST=$(kubectl get cm global -o jsonpath={.data.mosip-esignet-host}) - INJI_HOST=$(kubectl get cm global -o jsonpath={.data.mosip-injiweb-host}) + echo Installing INJIWEB - helm -n $NS install inji-web mosip/inji-web \ + helm -n $NS install inji-web /home/bhuminathan/injiwebfinal/inji-web/helm/inji-web \ -f values.yaml \ - --set esignet_redirect_url=$ESIGNET_HOST \ - --set istio.hosts\[0\]=$INJI_HOST \ + --set istio.hosts\[0\]=$ESIGNET_HOST \ --version $CHART_VERSION -# kubectl -n $NS get deploy -o name | xargs -n1 -t kubectl -n $NS rollout status + kubectl -n $NS get deploy -o name | xargs -n1 -t kubectl -n $NS rollout status echo Installed inji-web return 0 diff --git a/helm/inji-web/templates/clusterrole.yaml b/helm/inji-web/templates/clusterrole.yaml index 36d3057e..50f771dd 100644 --- a/helm/inji-web/templates/clusterrole.yaml +++ b/helm/inji-web/templates/clusterrole.yaml @@ -1,29 +1,10 @@ -apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} +--- +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: {{ include "common.names.fullname" . }} - namespace: {{ .Release.Namespace | quote }} - 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 }} - {{- end }} + name: {{ template "inji-web.serviceAccountName" . }}-pods-role + namespace: {{ .Release.Namespace }} rules: - - apiGroups: - - "*" - resources: - - endpoints - - pods - - services - - configmaps - - secrets - - virtualservices - - gateways - verbs: - - get - - list - - create - - update - - patch + - apiGroups: [""] + resources: ["pods"] + verbs: ["get","patch","list","watch"] diff --git a/helm/inji-web/templates/clusterrolebinding.yaml b/helm/inji-web/templates/clusterrolebinding.yaml index 88124f27..0690cda7 100644 --- a/helm/inji-web/templates/clusterrolebinding.yaml +++ b/helm/inji-web/templates/clusterrolebinding.yaml @@ -5,7 +5,7 @@ metadata: {{- if .Values.commonLabels }} {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} {{- end }} - name: {{ template "common.names.fullname" . }} + name: {{ template "inji-web.serviceAccountName" . }}-pods-role {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} diff --git a/helm/inji-web/templates/configmap.yaml b/helm/inji-web/templates/configmap.yaml index d84ac4a9..60e70889 100644 --- a/helm/inji-web/templates/configmap.yaml +++ b/helm/inji-web/templates/configmap.yaml @@ -42,12 +42,30 @@ data: proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $server_name; } - location /authorize { - return 301 https://{{ .Values.esignet_redirect_url }}$request_uri; - } location / { try_files $uri $uri/ /index.html; } } } +{{- if .Values.inji_web.configmaps }} + {{- range $cm_name, $cm_value := .Values.inji_web.configmaps }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ $cm_name }} + namespace: {{ $.Release.Namespace }} + labels: {{- include "common.labels.standard" $ | nindent 8 }} + {{- if $.Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" $.Values.commonLabels "context" $ ) | nindent 8 }} + {{- end }} + {{- if $.Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 8 }} + {{- end }} +data: + {{- range $key, $value := $cm_value }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- end }} + {{- end }} \ No newline at end of file diff --git a/helm/inji-web/values.yaml b/helm/inji-web/values.yaml index 042d2308..488cbccb 100755 --- a/helm/inji-web/values.yaml +++ b/helm/inji-web/values.yaml @@ -51,7 +51,7 @@ service: image: registry: docker.io - repository: mosipdev/inji-web + repository: bn46/inji-web tag: develop ## Specify a imagePullPolicy @@ -250,6 +250,7 @@ extraEnvVarsCM: - artifactory-share - softhsm-esignet-share - oidc-ui + - inji-web ## Secret with extra environment variables ## @@ -419,8 +420,14 @@ metrics: ## Slash is important! inji_web: inji_web_port: '3004' - inji_web_service_host: 'mimoto.mimoto' -esignet_redirect_url: 'esignet.sandbox.xyz.net' + inji_web_service_host: 'https://api-internal.sandbox.xxx.net' + configmaps: + inji-web: + REACT_APP_ESIGNET_UI_URL: 'https://api-internal.sandbox.xxx.net/v1/esignet' + REACT_APP_ESIGNET_REDIRECT_URL: '' + REACT_APP_MIMOTO_URL: 'https://api.sandbox.xxx.net/v1/mimoto' + + ## injiweb UI swagger should have only internal access. Hence linked to internal gateway ## We create a gateway for esignet specific URL(s) listed under `hosts` istio: