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-6382] updated chart version in helm and deployment scripts #932

Merged
merged 2 commits into from
Oct 4, 2024
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
11 changes: 8 additions & 3 deletions deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@
* __Logging__ : Setup logging as per [steps](https://github.com/mosip/k8s-infra/tree/v1.2.0.2/logging).
* __Monitoring__ : Setup monitoring consisting elasticsearch, kibana, grafana using [steps](https://github.com/mosip/k8s-infra/tree/v1.2.0.2/monitoring).
### Install Pre-requisites
```
./install-prereq.sh
```
* `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
```
./install-prereq.sh
```
### Initialise pre-requisites
* Update values file for postgres init [here](postgres/init_values.yaml).
* Execute `initialise-prereq.sh` script to initialise postgres and keycloak and set esignet captcha.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion deploy/esignet/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [ $# -ge 1 ] ; then
fi

NS=esignet
CHART_VERSION=0.0.1-test
CHART_VERSION=1.5.0-develop

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

Expand Down
32 changes: 10 additions & 22 deletions deploy/install-prereq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ if [ $# -ge 1 ]; then
fi

ROOT_DIR=$(pwd)
SOFTHSM_NS=softhsm
SOFTHSM_CHART_VERSION=12.0.1

function prompt_for_deployment() {
local module_name=$1
Expand All @@ -30,36 +28,26 @@ function prompt_for_deployment() {

function installing_prerequisites() {

helm repo add mosip https://mosip.github.io/mosip-helm
helm repo update

# Create esignet, softhsm namespace if not present
kubectl create ns esignet || true
kubectl create ns "$SOFTHSM_NS" || true

# Apply esignet-global config-map
kubectl apply -f esignet-global-cm.yaml

echo "Istio label"
kubectl label ns "$SOFTHSM_NS" istio-injection=enabled --overwrite

# Deploy Softhsm for Esignet.
echo "Installing Softhsm for esignet"
helm -n "$SOFTHSM_NS" install esignet-softhsm mosip/softhsm -f softhsm-values.yaml --version "$SOFTHSM_CHART_VERSION" --wait
echo "Installed Softhsm for esignet"
echo "Creating esignet-global configmap in esignet namespace"
kubectl -n esignet apply -f esignet-global-cm.yaml

declare -a modules=("istio-gateway" "postgres" "keycloak" "kafka" "redis")
declare -a modules=("istio-gateway" "postgres" "keycloak" "kafka" "redis" "softhsm")
declare -A prompts=(
["keycloak"]="Do you want to deploy keycloak in the keycloak namespace?"
["kafka"]="Do you want to deploy Kafka in the kafka namespace?"
["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" == "redis" ] || [ "$module" == "postgres" ]; then
if [ "$module" == "istio-gateway" ] || [ "$module" == "postgres" ]; then
cd "$ROOT_DIR/$module"
./install.sh
elif [[ -n "${prompts[$module]}" ]]; then
prompt_for_deployment "$module" "${prompts[$module]}"
fi
done
echo "All prerequisite services deployed successfully."
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 @@ -7,7 +7,7 @@ if [ $# -ge 1 ] ; then
fi

NS=esignet
CHART_VERSION=0.0.1-test
CHART_VERSION=1.5.0-develop

echo Create $NS namespace
kubectl create ns $NS
Expand Down
29 changes: 22 additions & 7 deletions deploy/postgres/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,35 @@ function installing_postgres() {

# Prompt the user if they want to install PostgreSQL
while true; do
read -p "Do you want to install Postgres? Opt for 'n' if you have Postgres already installed. (y/n): " answer
read -p "Do you want to install default Postgres in esignet namespace? (y/n): " answer
if [ "$answer" = "Y" ] || [ "$answer" = "y" ]; then
echo "Continuing with Postgres server deployment..."
break
break # Proceed with the installation
elif [ "$answer" = "N" ] || [ "$answer" = "n" ]; then
echo "Skipping Postgres installation. Running generate_secret.py to create Postgres secrets..."
python3 generate-secret-cm.py # Ensure that Python and the script are available in the environment
echo "Secrets generated. Exiting script."
exit 0 # Exit the script after generating secrets
# Prompt the user for further options
while true; do
echo "You opted not to install Postgres. What would you like to do next?"
echo "1. Skip Postgres server installation and configuration in esignet namespace."
echo "2. Configure external Postgres details by generating secrets and configmap in esignet namespace."

read -p "Enter your choice (1/2): " option

if [ "$option" = "1" ]; then
echo "Skipping Postgres server installation and configuration in esignet namespace."
exit 0 # Exit the script as the user chose to skip Postgres installation
elif [ "$option" = "2" ]; then
echo "Running generate_secret.py to create Postgres secrets and configmap..."
python3 generate-secret-cm.py # Ensure Python and the script are available in the environment
echo "Secrets generated successfully."
exit 0 # Exit the script after generating secrets and configmap
else
echo "Not a correct option. Please try again or press Ctrl + C to exit."
fi
done
else
echo "Please provide a correct option (Y or N)"
fi
done

# set commands for error handling.
set -e
set -o errexit ## set -e : exit the script if any statement returns a non-true return value
Expand Down
6 changes: 3 additions & 3 deletions deploy/postgres/postgres-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ function initialize_db() {
then
echo Removing existing mosip_esignet installation and secret
helm -n $NS delete esignet-postgres-init || true
kubectl delete secret db-common-secrets -n $NS || true
kubectl -n NS delete secret db-common-secrets || true
echo Initializing DB
helm -n $NS install esignet-postgres-init mosip/postgres-init --version $CHART_VERSION -f init_values.yaml --wait --wait-for-jobs
break
elif [ "$yn" = "N" ] || [ "$yn" = "n" ]; then
echo "Skipping postgres initialisation as per your input"
echo "Skipping eSignet postgres DB initialisation as per your input"
break
else
echo "Incorrect Input"
echo "Incorrect Input. Please choose again"
break
fi
done
Expand Down
34 changes: 34 additions & 0 deletions deploy/softhsm/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
# Installs Softhsm service for Esignet
## Usage: ./install.sh [kubeconfig]

if [ $# -ge 1 ] ; then
export KUBECONFIG=$1
fi

NS=softhsm
CHART_VERSION=12.0.1

function installing_softhsm() {
echo Create $NS namespaces
kubectl create ns $NS || true

echo Istio label
kubectl label ns $NS istio-injection=enabled --overwrite
helm repo update

# Deploy Softhsm for Esignet.
echo "Installing Softhsm for esignet"
helm -n "$SOFTHSM_NS" install esignet-softhsm mosip/softhsm -f softhsm-values.yaml --version "$SOFTHSM_CHART_VERSION" --wait
echo "Installed Softhsm for esignet"

return 0
}

# set commands for error handling.
set -e
set -o errexit ## set -e : exit the script if any statement returns a non-true return value
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_softhsm # calling function
File renamed without changes.
2 changes: 1 addition & 1 deletion helm/esignet/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: esignet
description: A Helm chart for MOSIP esignet module
type: application
version: 0.0.1-test
version: 1.5.0-develop
appVersion: ""
dependencies:
- name: common
Expand Down
2 changes: 1 addition & 1 deletion helm/esignet/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ service:
image:
registry: docker.io
repository: mosipdev/esignet
tag: develop
tag: release-1.5.x
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
Expand Down
2 changes: 1 addition & 1 deletion helm/oidc-ui/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: oidc-ui
description: A Helm chart for MOSIP OIDC UI module
type: application
version: 0.0.1-test
version: 1.5.0-develop
appVersion: ""
dependencies:
- name: common
Expand Down
2 changes: 1 addition & 1 deletion helm/oidc-ui/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ service:
image:
registry: docker.io
repository: mosipdev/oidc-ui
tag: develop
tag: release-1.5.x

## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
Expand Down
2 changes: 1 addition & 1 deletion partner-onboarder/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if [ "$flag" = "n" ]; then
fi

NS=esignet
CHART_VERSION=0.0.1-develop
CHART_VERSION=1.5.0-ES-develop

echo Create $NS namespace
kubectl create ns $NS || true
Expand Down
10 changes: 5 additions & 5 deletions partner-onboarder/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
image:
registry: docker.io
repository: mosipdev/partner-onboarder
tag: develop
#image:
# registry: docker.io
# repository: mosipdev/partner-onboarder
# tag: develop

onboarding:
modules:
Expand All @@ -17,7 +17,7 @@ onboarding:
# ns_esignet: esignet
# ns_signup: signup
# secrets:
# s3:
# s3:
# s3-user-secret: 'password'
# volumes:
# reports:
Expand Down
Loading