Skip to content

Commit

Permalink
wait for all pods to complete before testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam0Brien committed Nov 22, 2024
1 parent a75dba4 commit cef1e1d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 32 deletions.
9 changes: 2 additions & 7 deletions deploy/kind/e2e/e2e-batch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
spec:
completions: 1
backoffLimit: 0
template: # curl -v http://spicedb-cr:50051/readyz
template:
spec:
initContainers:
- name: wait-for-inventory
Expand All @@ -21,12 +21,7 @@ spec:
done
echo "Inventory service is ready!"
# echo "Waiting for relations-service to be ready..."
# while ! curl -s http://relationships-service:9000/api/authz/readyz; do
# echo "Relations service not ready yet. Sleeping for 5 seconds..."
# sleep 5
# done
# echo "Inventory service is ready!"
containers:
- name: e2e-http-tests
image: localhost/inventory-e2e-tests:e2e-test
Expand Down
5 changes: 0 additions & 5 deletions deploy/kind/relations/spicedb-kind-setup/kind-kube/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions deploy/kind/relations/spicedb-kind-setup/postgres/README.md

This file was deleted.

31 changes: 16 additions & 15 deletions scripts/start-inventory-kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,8 @@ ${DOCKER} save -o inventory-e2e-tests.tar localhost/inventory-e2e-tests:e2e-test
kind load image-archive inventory-api.tar --name inventory-cluster
kind load image-archive inventory-e2e-tests.tar --name inventory-cluster

#kubectl create configmap inventory-api-psks --from-file=config/psks.yaml
#
#kubectl apply -f https://strimzi.io/install/latest\?namespace\=default
#kubectl apply -f deploy/kind/inventory/kessel-inventory.yaml
#kubectl apply -f deploy/kind/inventory/invdatabase.yaml
#kubectl apply -f deploy/kind/e2e/e2e-batch.yaml
#kubectl apply -f deploy/kind/inventory/strimzi.yaml

# Create the kessel namespace
kubectl create namespace kessel

# Deploy ConfigMap for inventory-api
kubectl create configmap inventory-api-psks --from-file=config/psks.yaml

# Deploy Inventory dependencies
kubectl apply -f https://strimzi.io/install/latest\?namespace\=default
kubectl apply -f deploy/kind/inventory/kessel-inventory.yaml
kubectl apply -f deploy/kind/inventory/invdatabase.yaml
Expand All @@ -45,10 +32,9 @@ kubectl apply -f deploy/kind/inventory/strimzi.yaml
kubectl apply -f https://projectcontour.io/quickstart/contour.yaml
kubectl get crd httpproxies.projectcontour.io

# add configmap
# add configmap for spicedb schema
kubectl create configmap spicedb-schema --from-file=deploy/schema.zed

# Deploy SpiceDB and Relations-API in the kessel namespace
kubectl apply -f deploy/kind/relations/spicedb-kind-setup/postgres/secret.yaml
kubectl apply -f deploy/kind/relations/spicedb-kind-setup/postgres/postgresql.yaml
kubectl apply -f deploy/kind/relations/spicedb-kind-setup/postgres/storage.yaml
Expand All @@ -59,5 +45,20 @@ kubectl apply -f deploy/kind/relations/spicedb-kind-setup/relations-api/secret.y
kubectl apply -f deploy/kind/relations/spicedb-kind-setup/relations-api/deployment.yaml
kubectl apply -f deploy/kind/relations/spicedb-kind-setup/relations-api/svc.yaml



echo "Waiting for all pods to be fully ready..."
while true; do
PODS_READY=$(kubectl get pods --no-headers | awk '{print $2}' | grep -v '1/1\|2/2' | wc -l)
if [ "$PODS_READY" -eq 0 ]; then
echo "All pods are ready!"
break
else
echo "Waiting for pods to be ready... ($PODS_READY not ready yet)"
sleep 5
fi
done

kubectl apply -f deploy/kind/e2e/e2e-batch.yaml

echo "Setup complete."

0 comments on commit cef1e1d

Please sign in to comment.