Skip to content

Commit

Permalink
[DSD-6445] (#974)
Browse files Browse the repository at this point in the history
* [DSD-6445 updated the readme n install script]

Signed-off-by: techno-376 <[email protected]>

* [DSD-6445]

Signed-off-by: techno-376 <[email protected]>

* [DSD-6445]

Signed-off-by: techno-376 <[email protected]>

* Update install-prereq.sh

Signed-off-by: Rakshitha650 <[email protected]>

* Update install.sh

Signed-off-by: Rakshitha650 <[email protected]>

---------

Signed-off-by: techno-376 <[email protected]>
Signed-off-by: Rakshitha650 <[email protected]>
Co-authored-by: techno-376 <[email protected]>
Co-authored-by: Rakshitha650 <[email protected]>
  • Loading branch information
3 people authored Oct 23, 2024
1 parent 0c670bf commit dbeb9d7
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
```
### Initialise pre-requisites
* Update values file for postgres init [here](postgres/init_values.yaml).
* Create a google recaptcha v2 ("I am not a Robot") from Google with required domain name ex:[sandbox.mosip.net] [Recaptcha Admin](https://www.google.com/recaptcha/about/).
* Execute `initialise-prereq.sh` script to initialise postgres and keycloak and set esignet captcha.
```
./initialise-prereq.sh
Expand Down
13 changes: 13 additions & 0 deletions deploy/captcha/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ function installing_captcha() {
helm -n $NS install captcha mosip/captcha --version $CHART_VERSION --set metrics.serviceMonitor.enabled=$servicemonitorflag --wait

echo Installed captcha service
# Check if the second environment variable exists
ENV_VAR_EXISTS=$(kubectl -n captcha get deployment captcha -o jsonpath="{.spec.template.spec.containers[0].env[?(@.name=='MOSIP_CAPTCHA_SECRET_ESIGNET')].name}")

if [[ -z "$ENV_VAR_EXISTS" ]]; then
# If the environment variable does not exist, add it
echo "Environment variable 'MOSIP_CAPTCHA_SECRET_ESIGNET' does not exist. Adding it..."
kubectl patch deployment -n captcha captcha --type='json' -p='[{"op": "add", "path": "/spec/template/spec/containers/0/env/-", "value": {"name": "MOSIP_CAPTCHA_SECRET_ESIGNET", "valueFrom": {"secretKeyRef": {"name": "esignet-captcha", "key": "esignet-captcha-secret-key"}}}}]'
else
# If the environment variable exists, update it
echo "Environment variable 'MOSIP_CAPTCHA_SECRET_ESIGNET' exists. Updating it..."
kubectl patch deployment -n captcha captcha --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/env[?(@.name==\"MOSIP_CAPTCHA_SECRET_ESIGNET\")]", "value": {"name": "MOSIP_CAPTCHA_SECRET_ESIGNET", "valueFrom": {"secretKeyRef": {"name": "esignet-captcha", "key": "esignet-captcha-secret-key"}}}}]'
fi

return 0
}

Expand Down
2 changes: 2 additions & 0 deletions deploy/initialise-prereq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ while true; do
kubectl -n $NS create secret generic esignet-captcha --from-literal=esignet-captcha-site-key=$ESITE_KEY --from-literal=esignet-captcha-secret-key=$ESECRET_KEY --dry-run=client -o yaml | kubectl apply -f -
echo "Captcha secrets for esignet configured sucessfully"

kubectl create ns captcha || true

./copy_cm_func.sh secret esignet-captcha $NS captcha

# Check if the second environment variable exists
Expand Down
1 change: 1 addition & 0 deletions deploy/install-prereq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ if [ $# -ge 1 ]; then
fi

ROOT_DIR=$(pwd)
kubectl create ns esignet || true

function prompt_for_deployment() {
local module_name=$1
Expand Down
1 change: 1 addition & 0 deletions deploy/keycloak/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function installing_keycloak() {
## TODO: enable istio injection after testing well.
kubectl label ns $NS istio-injection=disabled --overwrite
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add mosip https://mosip.github.io/mosip-helm
helm repo update

echo Installing
Expand Down
2 changes: 1 addition & 1 deletion deploy/oidc-ui/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function installing_oidc-ui() {
CHART_VERSION=1.5.0-develop

echo Create $NS namespace
kubectl create ns $NS
kubectl create ns $NS || true

echo Istio label
kubectl label ns $NS istio-injection=enabled --overwrite
Expand Down
4 changes: 2 additions & 2 deletions deploy/softhsm/install.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ if [ $# -ge 1 ] ; then
export KUBECONFIG=$1
fi

NS=softhsm
CHART_VERSION=12.0.1
SOFTHSM_NS=softhsm
SOFTHSM_CHART_VERSION=12.0.1

function installing_softhsm() {
echo Create $NS namespaces
Expand Down

0 comments on commit dbeb9d7

Please sign in to comment.