RD: Updated wait_for_mongodb.sh script and commented out liveness and readiness checks

Change-Id: I989b153f1c3df8016b838488672b30e062ef2656
This commit is contained in:
ipatini 2024-05-09 13:10:58 +03:00
parent a5ca07090c
commit 68b8bc9f34
2 changed files with 11 additions and 11 deletions

View File

@ -42,14 +42,14 @@ spec:
- name: http - name: http
containerPort: 8080 containerPort: 8080
protocol: TCP protocol: TCP
livenessProbe: # livenessProbe:
httpGet: # httpGet:
path: / # path: /
port: http # port: http
readinessProbe: # readinessProbe:
httpGet: # httpGet:
path: / # path: /
port: http # port: http
resources: resources:
{{- toYaml .Values.resources | nindent 12 }} {{- toYaml .Values.resources | nindent 12 }}
- name: {{ .Chart.Name }}-mongodb - name: {{ .Chart.Name }}-mongodb

View File

@ -1,12 +1,12 @@
#!/bin/bash #!/bin/bash
# Define MongoDB connection details # Define MongoDB connection details
MONGODB_HOST="localhost" if [ -z "$MONGODB_HOST" ]; then MONGODB_HOST="localhost"; fi
MONGODB_PORT="27017" if [ -z "$MONGODB_PORT" ]; then MONGODB_PORT="27017"; fi
# Function to check if MongoDB is ready # Function to check if MongoDB is ready
wait_for_mongodb() { wait_for_mongodb() {
echo "Waiting for MongoDB to be ready..." echo "Waiting for MongoDB ($MONGODB_HOST:$MONGODB_PORT) to be ready..."
until nc -z $MONGODB_HOST $MONGODB_PORT until nc -z $MONGODB_HOST $MONGODB_PORT
do do
sleep 1 sleep 1