Skip to content

Commit

Permalink
Merge pull request #933 from mosip/DSD-6382
Browse files Browse the repository at this point in the history
[DSD-6382] adding fixes for issues reported during dev round
  • Loading branch information
ckm007 authored Oct 4, 2024
2 parents 4fa1c67 + 7a751a0 commit 20e7552
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 17 deletions.
1 change: 1 addition & 0 deletions deploy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
esignet-global-cm.yaml
1 change: 0 additions & 1 deletion deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* __Monitoring__ : Setup monitoring consisting elasticsearch, kibana, grafana using [steps](https://github.com/mosip/k8s-infra/tree/v1.2.0.2/monitoring).
### Install Pre-requisites
* `esignet-global` configmap: For eSignet K8's env, `esignet-global` configmap in `esignet` namespace contains Domain related information. Follow below steps to add domain details for `esignet-global` configmap.
* Make sure kubeconfig file is already set and k8 cluster is accessible and kubectl is installed.
* Copy `esignet-global-cm.yaml.sample` to `esignet-global-cm.yaml`.
* Update the domain names in `esignet-global-cm.yaml` correctly for your environment.
* Install pre-requisites
Expand Down
19 changes: 15 additions & 4 deletions deploy/initialise-prereq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,22 @@ function initialising_Prerequisites() {
echo Please enter the recaptcha admin secret key for domain $ESIGNET_HOST
read ESECRET_KEY

echo Setting up captcha secrets
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 -
while true; do
read -p "Do you want to continue configuring Captcha secrets for esignet ? (y/n) : " ans
if [ $ans='Y' ] || [ $ans='y' ]; then
echo "Please create captcha site and secret key for esignet domain: esignet.sandbox.xyz.net"
echo "Setting up captcha secrets"
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 Setting up dummy values for esignet misp license key
kubectl -n $NS create secret generic esignet-misp-onboarder-key --from-literal=mosip-esignet-misp-key='' --dry-run=client -o yaml | kubectl apply -f -
elif [ "$ans" = "N" ] || [ "$ans" = "n" ]; then
exit 1
else
echo "Please provide a correct option (Y or N)"
fi
done

echo Setting up dummy values for esignet misp license key
kubectl -n $NS create secret generic esignet-misp-onboarder-key --from-literal=mosip-esignet-misp-key='' --dry-run=client -o yaml | kubectl apply -f -

echo "All prerequisite services initialised successfully."
return 0
Expand Down
3 changes: 1 addition & 2 deletions deploy/install-prereq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,12 @@ function installing_prerequisites() {
["softhsm"]="Do you want to install softhsm for esignet service in softhsm namespace? Opt "n" in case it already exists in Softhsm namespace: "
["keycloak"]="Do you want to deploy keycloak in the keycloak namespace? Opt "n" in case it already exists in keycloak namespace : "
["kafka"]="Do you want to deploy Kafka in the kafka namespace? Opt "n" in case it already exists in kafka namespace : "
["redis"]="Do you want to deploy redis in Redis namespace? Opt "n" in case it already exists in Redis namespace : "
)

echo "Installing prerequisite services"

for module in "${modules[@]}"; do
if [ "$module" == "istio-gateway" ] || [ "$module" == "postgres" ]; then
if [ "$module" == "istio-gateway" ] || [ "$module" == "postgres" ] || [ "$module" == "redis" ]; then
cd "$ROOT_DIR/$module"
./install.sh
elif [[ -n "${prompts[$module]}" ]]; then
Expand Down
1 change: 1 addition & 0 deletions deploy/postgres/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
db-common-secrets.yaml
esignet-postgres-postgresql.yaml
postgres-host.yaml
.*.swp
2 changes: 1 addition & 1 deletion deploy/postgres/postgres-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function initialize_db() {
if [ "$ans" = "Y" ] || [ "$ans" = "y" ]; then
break
elif [ "$ans" = "N" ] || [ "$ans" = "n" ]; then
exit
exit 1
else
echo "Please provide a correct option (Y or N)"
fi
Expand Down
34 changes: 29 additions & 5 deletions deploy/redis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,37 @@ if [ $# -ge 1 ] ; then
export KUBECONFIG=$1
fi

NS=redis
CHART_VERSION=17.3.14
function installing_redis() {

echo Create $NS namespace
kubectl create ns $NS
while true; do
read -p "Do you want to install Redis in redis namespace? (y/n) :" ans
if [ "$ans" = "n" ] || [ "$ans" = "N" ]; then
read -p "Please confirm if redis-config is already present in redis namespace. (y/n):" response
if [ "$response" = "Y" ] || [ "$response" = "y" ]; then
echo "Skipping Redis installation as well as redis-config creation."
exit 1
elif [ "$response" = "N" ] || [ "$response" = "n" ]; then
echo "Skipping Redis installation and continuing with redis-config creation."
kubectl apply -f redis-config.yaml
echo "redis-config configmap creation completed."
exit 1
else
echo "Incorrect response. Please re-execute the redis installation script."
exit 1
fi
elif [ "$ans" = "y" ] || [ "$ans" = "Y" ]; then
break
else
echo "Please provide a correct option (Y or N)"
fi
done

NS=redis
CHART_VERSION=17.3.14

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

function installing_redis() {
echo Istio label
kubectl label ns $NS istio-injection=enabled --overwrite

Expand Down
8 changes: 4 additions & 4 deletions helm/esignet/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -273,22 +273,22 @@ extraEnvVars: |
- name: DATABASE_HOST
valueFrom:
configMapKeyRef:
name: postgres-config
name: esignet-postgres-config
key: database-host
- name: DATABASE_PORT
valueFrom:
configMapKeyRef:
name: postgres-config
name: esignet-postgres-config
key: database-port
- name: DATABASE_NAME
valueFrom:
configMapKeyRef:
name: postgres-config
name: esignet-postgres-config
key: database-name
- name: DATABASE_USERNAME
valueFrom:
configMapKeyRef:
name: postgres-config
name: esignet-postgres-config
key: database-username
- name: DB_DBUSER_PASSWORD
valueFrom:
Expand Down

0 comments on commit 20e7552

Please sign in to comment.