Skip to content

Commit

Permalink
Added initial readiness for the Spring
Browse files Browse the repository at this point in the history
  • Loading branch information
yodigos committed Sep 25, 2024
1 parent 6dc872f commit e24be97
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 2 deletions.
18 changes: 18 additions & 0 deletions tests/e2e/workload-lifecycle/01-install-test-apps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ spec:
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3000
readinessProbe:
tcpSocket:
port: 3000
initialDelaySeconds: 20
---
kind: Service
apiVersion: v1
Expand Down Expand Up @@ -303,6 +307,10 @@ spec:
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3000
readinessProbe:
tcpSocket:
port: 3000
initialDelaySeconds: 20
---
kind: Service
apiVersion: v1
Expand Down Expand Up @@ -339,6 +347,12 @@ spec:
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3000
readinessProbe:
tcpSocket:
port: 3000
initialDelaySeconds: 20


---
kind: Service
apiVersion: v1
Expand Down Expand Up @@ -377,6 +391,10 @@ spec:
env:
- name: JAVA_OPTS
value: "-Dnot.work=true"
readinessProbe:
tcpSocket:
port: 3000
initialDelaySeconds: 20

---
kind: Service
Expand Down
16 changes: 16 additions & 0 deletions tests/e2e/workload-lifecycle/02-update-workload-manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ spec:
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3000
readinessProbe:
tcpSocket:
port: 3000
initialDelaySeconds: 20
---
kind: Deployment
apiVersion: apps/v1
Expand All @@ -225,6 +229,10 @@ spec:
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3000
readinessProbe:
tcpSocket:
port: 3000
initialDelaySeconds: 20
---
kind: Deployment
apiVersion: apps/v1
Expand All @@ -250,6 +258,10 @@ spec:
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3000
readinessProbe:
tcpSocket:
port: 3000
initialDelaySeconds: 20

---
kind: Deployment
Expand All @@ -276,5 +288,9 @@ spec:
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3000
readinessProbe:
tcpSocket:
port: 3000
initialDelaySeconds: 20

---
28 changes: 26 additions & 2 deletions tests/e2e/workload-lifecycle/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,19 @@ spec:
content: |
set -e
sleep 20
NAMESPACE="default"
DEPLOYMENTS=$(kubectl get deployments -n $NAMESPACE -o jsonpath='{.items[*].metadata.name}')
for DEPLOYMENT in $DEPLOYMENTS; do
echo "Waiting for deployment $DEPLOYMENT to finish rollout..."
kubectl rollout status deployment/$DEPLOYMENT -n $NAMESPACE
if [ $? -ne 0 ]; then
echo "Deployment $DEPLOYMENT failed to finish rollout."
exit 1
fi
done
# Apply the job
kubectl apply -f 01-generate-traffic.yaml
Expand Down Expand Up @@ -136,8 +148,20 @@ spec:
content: |
set -e
sleep 20
NAMESPACE="default"
DEPLOYMENTS=$(kubectl get deployments -n $NAMESPACE -o jsonpath='{.items[*].metadata.name}')
for DEPLOYMENT in $DEPLOYMENTS; do
echo "Waiting for deployment $DEPLOYMENT to finish rollout..."
kubectl rollout status deployment/$DEPLOYMENT -n $NAMESPACE
if [ $? -ne 0 ]; then
echo "Deployment $DEPLOYMENT failed to finish rollout."
exit 1
fi
done
kubectl apply -f 01-generate-traffic.yaml
job_name=$(kubectl get -f 01-generate-traffic.yaml -o=jsonpath='{.metadata.name}')
kubectl wait --for=condition=complete job/$job_name
Expand Down

0 comments on commit e24be97

Please sign in to comment.