Add Service watchers and chia-healthcheck sidecar #33
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Smoke tests | |
on: pull_request | |
jobs: | |
smoke-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Create k8s Kind Cluster | |
uses: helm/kind-action@v1 | |
- name: Install kubectl | |
uses: azure/setup-kubectl@v4 | |
- name: Install chia operator custom resources | |
run: | | |
make install | |
- name: Run the operator in the background | |
run: | | |
make run & | |
- name: Install chia components | |
run: | | |
kubectl apply -f ./config/samples/chiaca.yaml | |
kubectl apply -f ./config/samples/chianode.yaml | |
- name: Wait for ChiaCA Secret | |
run: | | |
found=0 | |
timeout=300 | |
endtime=$((SECONDS+timeout)) | |
while [ ${SECONDS} -lt ${endtime} ]; do | |
if kubectl get secret chiaca-secret &> /dev/null; then | |
echo "ChiaCA Secret found" | |
found=1 | |
break | |
else | |
echo "Secret not found yet. Waiting..." | |
sleep 5 | |
fi | |
done | |
if [ "$found" -eq 0 ]; then | |
echo "Timeout reached waiting for ChiaCA Secret to be created." | |
echo "Getting Kubernetes Pods from the default namespace:" | |
kubectl get pods | |
echo "Getting Kubernetes Secrets from the default namespace:" | |
kubectl get secrets | |
exit 1 | |
fi | |
- name: Wait for Running ChiaNode | |
run: | | |
found=0 | |
timeout=300 | |
endtime=$((SECONDS+timeout)) | |
while [ $SECONDS -lt $endtime ]; do | |
pod_status=$(kubectl get pod chianode-sample-node-0 -o jsonpath='{.status.phase}') | |
if [ "$pod_status" = "Running" ]; then | |
echo "Pod is running." | |
found=1 | |
break # Exit the loop if Pod is running | |
elif [ "$pod_status" = "Pending" ]; then | |
echo "Pod is pending. Waiting..." | |
elif [ "$pod_status" = "Failed" ] || [ "$pod_status" = "Unknown" ]; then | |
echo "Pod has failed or is in an unknown state. Exiting..." | |
exit 1 | |
else | |
echo "Pod is in state: $pod_status. Waiting..." | |
fi | |
sleep 5 | |
done | |
# Check if timeout was reached or if Pod is now up | |
if [ "$found" -eq 0 ]; then | |
echo "Timeout reached waiting for ChiaNode Pod to enter Running status." | |
echo "Getting Kubernetes Pods from the default namespace:" | |
kubectl get pods | |
exit 1 | |
fi |