Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DSD-3180] Added new env variable & restructured the deployment scripts #297

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions helm/oidc-ui/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ function installing_oidc-ui() {

ESIGNET_HOST=$(kubectl get cm global -o jsonpath={.data.mosip-esignet-host})

echo "Create configmaps oidc-ui-cm, delete if exists"
kubectl -n $NS delete --ignore-not-found=true configmap oidc-ui-cm
kubectl -n $NS create configmap oidc-ui-cm --from-literal="REACT_APP_API_BASE_URL=http://esignet.$NS/v1/esignet" --from-literal="REACT_APP_SBI_DOMAIN_URI=http://esignet.$NS"

echo Installing OIDC UI
helm -n $NS install oidc-ui mosip/oidc-ui --set istio.hosts\[0\]=$ESIGNET_HOST
helm -n $NS install oidc-ui mosip/oidc-ui \
--set oidc_ui.configmaps.oidc-ui.REACT_APP_API_BASE_URL="http://esignet.$NS/v1/esignet" \
--set oidc_ui.configmaps.oidc-ui.REACT_APP_SBI_DOMAIN_URI="http://esignet.$NS" \
--set oidc_ui.configmaps.oidc-ui.OIDC_UI_PUBLIC_URL=''\
--set istio.hosts\[0\]=$ESIGNET_HOST \
--version $CHART_VERSION

kubectl -n $NS get deploy -o name | xargs -n1 -t kubectl -n $NS rollout status

Expand All @@ -43,4 +44,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_oidc-ui # calling function
installing_oidc-ui # calling function
25 changes: 23 additions & 2 deletions helm/oidc-ui/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "common.names.fullname" . }}
name: {{ template "common.names.fullname" . }}-nginx-cm
namespace: {{ .Release.Namespace }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
Expand Down Expand Up @@ -71,4 +71,25 @@ data:
try_files $uri $uri/ /index.html;
}
}
}
}
{{- if .Values.oidc_ui.configmaps }}
{{- range $cm_name, $cm_value := .Values.oidc_ui.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 }}
2 changes: 1 addition & 1 deletion helm/oidc-ui/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ spec:
volumes:
- name: nginx-config
configMap:
name: {{ template "common.names.fullname" . }}
name: {{ template "common.names.fullname" . }}-nginx-cm
items:
- key: nginx.conf
path: nginx.conf
7 changes: 6 additions & 1 deletion helm/oidc-ui/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ extraEnvVarsCM:
- config-server-share
- artifactory-share
- softhsm-esignet-share
- oidc-ui-cm
- oidc-ui

## Secret with extra environment variables
##
Expand Down Expand Up @@ -420,6 +420,11 @@ metrics:
oidc_ui:
oidc_ui_port: '3000'
oidc_service_host: 'esignet.esignet'
configmaps:
oidc-ui:
REACT_APP_API_BASE_URL: 'http://esignet.esignet/v1/esignet'
REACT_APP_SBI_DOMAIN_URI: 'http://esignet.$NS'
OIDC_UI_PUBLIC_URL: ''

## OIDC UI swagger should have only internal access. Hence linked to internal gateway
## We create a gateway for esignet specific URL(s) listed under `hosts`
Expand Down