diff --git a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-block.yaml b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-block.yaml index 7122cc9b1d..12544c8303 100644 --- a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-block.yaml +++ b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-block.yaml @@ -71,7 +71,7 @@ items: # Used to format the block device (put filesystem on it). # This allows Mongo to use the filesystem which lives on block device. initContainers: - - image: docker.io/library/mongo:latest + - image: docker.io/library/mongo:7.0 imagePullPolicy: IfNotPresent securityContext: privileged: true @@ -102,7 +102,7 @@ items: - name: block-volume-pv devicePath: /dev/xvdx containers: - - image: docker.io/library/mongo:latest + - image: docker.io/library/mongo:7.0 name: mongo securityContext: privileged: true @@ -117,8 +117,10 @@ items: - containerPort: 27017 name: mongo resources: - limits: + requests: memory: 512Mi + limits: + memory: 1Gi command: - "sh" - "-c" @@ -131,11 +133,26 @@ items: volumeDevices: - name: block-volume-pv devicePath: /dev/xvdx - livenessProbe: - tcpSocket: - port: mongo - initialDelaySeconds: 5 + readinessProbe: + exec: + command: + - /bin/bash + - -c + - "mongosh --eval 'db.runCommand(\"ping\")' --quiet" + initialDelaySeconds: 30 periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 3 + livenessProbe: + exec: + command: + - /bin/bash + - -c + - "mongosh --eval 'db.runCommand(\"ping\")' --quiet" + initialDelaySeconds: 60 + periodSeconds: 30 + timeoutSeconds: 10 + failureThreshold: 3 startupProbe: exec: command: @@ -143,11 +160,11 @@ items: - -c - | mongosh admin --authenticationDatabase admin -u "$MONGO_INITDB_ROOT_USERNAME" -p "$MONGO_INITDB_ROOT_PASSWORD" --eval 'db.adminCommand("ping")' - initialDelaySeconds: 5 - periodSeconds: 30 - timeoutSeconds: 2 + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 5 successThreshold: 1 - failureThreshold: 40 # 40x30sec before restart pod + failureThreshold: 12 # 12x10sec = 2min before restart pod - image: docker.io/curlimages/curl:8.5.0 name: curl-tool command: ["/bin/sleep", "infinity"] diff --git a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-csi.yaml b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-csi.yaml index fada2b9628..07c81581f9 100644 --- a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-csi.yaml +++ b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-csi.yaml @@ -67,7 +67,7 @@ items: spec: serviceAccountName: mongo-persistent-sa containers: - - image: docker.io/library/mongo:latest + - image: docker.io/library/mongo:7.0 imagePullPolicy: IfNotPresent name: mongo securityContext: @@ -83,16 +83,33 @@ items: - containerPort: 27017 name: mongo resources: - limits: + requests: memory: 512Mi + limits: + memory: 1Gi volumeMounts: - name: mongo-data mountPath: /data/db - livenessProbe: - tcpSocket: - port: mongo - initialDelaySeconds: 5 + readinessProbe: + exec: + command: + - /bin/bash + - -c + - "mongosh --eval 'db.runCommand(\"ping\")' --quiet" + initialDelaySeconds: 30 periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 3 + livenessProbe: + exec: + command: + - /bin/bash + - -c + - "mongosh --eval 'db.runCommand(\"ping\")' --quiet" + initialDelaySeconds: 60 + periodSeconds: 30 + timeoutSeconds: 10 + failureThreshold: 3 startupProbe: exec: command: @@ -100,11 +117,11 @@ items: - -c - | mongosh admin --authenticationDatabase admin -u "$MONGO_INITDB_ROOT_USERNAME" -p "$MONGO_INITDB_ROOT_PASSWORD" --eval 'db.adminCommand("ping")' - initialDelaySeconds: 5 - periodSeconds: 30 - timeoutSeconds: 2 + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 5 successThreshold: 1 - failureThreshold: 40 # 40x30sec before restart pod + failureThreshold: 12 # 12x10sec = 2min before restart pod - image: docker.io/curlimages/curl:8.5.0 name: curl-tool command: ["/bin/sleep", "infinity"] diff --git a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent.yaml b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent.yaml index 0f05d35544..addb097dd0 100644 --- a/tests/e2e/sample-applications/mongo-persistent/mongo-persistent.yaml +++ b/tests/e2e/sample-applications/mongo-persistent/mongo-persistent.yaml @@ -80,7 +80,7 @@ items: spec: serviceAccountName: mongo-persistent-sa containers: - - image: docker.io/library/mongo:latest + - image: docker.io/library/mongo:7.0 imagePullPolicy: IfNotPresent name: mongo securityContext: @@ -96,16 +96,33 @@ items: - containerPort: 27017 name: mongo resources: - limits: + requests: memory: 512Mi + limits: + memory: 1Gi volumeMounts: - name: mongo-data mountPath: /data/db - livenessProbe: - tcpSocket: - port: mongo - initialDelaySeconds: 5 + readinessProbe: + exec: + command: + - /bin/bash + - -c + - "mongosh --eval 'db.runCommand(\"ping\")' --quiet" + initialDelaySeconds: 30 periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 3 + livenessProbe: + exec: + command: + - /bin/bash + - -c + - "mongosh --eval 'db.runCommand(\"ping\")' --quiet" + initialDelaySeconds: 60 + periodSeconds: 30 + timeoutSeconds: 10 + failureThreshold: 3 startupProbe: exec: command: @@ -113,11 +130,11 @@ items: - -c - | mongosh admin --authenticationDatabase admin -u "$MONGO_INITDB_ROOT_USERNAME" -p "$MONGO_INITDB_ROOT_PASSWORD" --eval 'db.adminCommand("ping")' - initialDelaySeconds: 5 - periodSeconds: 30 - timeoutSeconds: 2 + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 5 successThreshold: 1 - failureThreshold: 40 # 40x30sec before restart pod + failureThreshold: 12 # 12x10sec = 2min before restart pod - image: docker.io/curlimages/curl:8.5.0 name: curl-tool command: ["/bin/sleep", "infinity"]