Skip to content

Commit

Permalink
use rollout status to check if kubearmor has deployed
Browse files Browse the repository at this point in the history
Signed-off-by: rksharma95 <[email protected]>
  • Loading branch information
rksharma95 committed Dec 26, 2024
1 parent 09e674b commit 0b63c36
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 32 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ci-latest-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ jobs:
sed -i '/image: kubearmor\/kubearmor-controller:latest/!{/image: kubearmor\/kubearmor-relay-server:latest/!s/latest/${{ steps.vars.outputs.tag }}/g}' pkg/KubeArmorOperator/config/samples/kubearmor-test.yaml
fi
kubectl apply -f pkg/KubeArmorOperator/config/samples/kubearmor-test.yaml
kubectl wait -n kubearmor --timeout=5m --for=jsonpath='{.status.phase}'=Running kubearmorconfigs/kubearmorconfig-test
kubectl wait --timeout=7m --for=condition=ready pod -l kubearmor-app,kubearmor-app!=kubearmor-snitch,kubearmor-app!=kubearmor-controller -n kubearmor
kubectl wait --timeout=1m --for=condition=ready pod -l kubearmor-app=kubearmor-controller -n kubearmor
kubectl rollout status deployment -n kubearmor -l kubearmor-app=kubearmor-relay -n kubearmor
kubectl rollout status daemonset -l kubearmor-app=kubearmor -n kubearmor
kubectl rollout status deployment -l kubearmor-app=kubearmor-controller -n kubearmor
kubectl wait --timeout=1m --for=condition=ready pod -l kubearmor-app,kubearmor-app!=kubearmor-snitch -n kubearmor
kubectl get pods -A
- name: Test KubeArmor using Ginkgo
Expand Down
30 changes: 5 additions & 25 deletions .github/workflows/ci-test-controllers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,31 +87,11 @@ jobs:
kubectl apply -f -
fi
kubectl wait -n kubearmor --timeout=5m --for=jsonpath='{.status.phase}'=Running kubearmorconfigs/kubearmorconfig-test
timeout 7m bash -c -- '
while true; do
all_running=true
echo "Checking pod status..."
for pod_status in $(kubectl get pod -n kubearmor -l kubearmor-app,kubearmor-app!=kubearmor-snitch --output=jsonpath="{.items[*].status.phase}" 2>/dev/null); do
if [ "$pod_status" != "Running" ]; then
all_running=false
echo "Waiting for pods to be Running..."
break
fi
done
if $all_running; then
echo "All pods are Running."
break
fi
if kubectl get pod -n kubearmor -l kubearmor-app,kubearmor-app!=kubearmor-snitch | grep CrashLoopBackOff; then
echo "Error: Pod in CrashLoopBackOff state"
exit 1
fi
sleep 1
done
'
kubectl rollout status deployment -n kubearmor -l kubearmor-app=kubearmor-relay -n kubearmor
kubectl rollout status daemonset -l kubearmor-app=kubearmor -n kubearmor
kubectl rollout status deployment -l kubearmor-app=kubearmor-controller -n kubearmor
kubectl wait --timeout=1m --for=condition=ready pod -l kubearmor-app,kubearmor-app!=kubearmor-snitch -n kubearmor
kubectl get pods -A
- name: Test KubeArmor using Ginkgo
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/ci-test-ginkgo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,10 @@ jobs:
fi
kubectl wait -n kubearmor --timeout=5m --for=jsonpath='{.status.phase}'=Running kubearmorconfigs/kubearmorconfig-test
kubectl wait --timeout=7m --for=condition=ready pod -l kubearmor-app,kubearmor-app!=kubearmor-snitch,kubearmor-app!=kubearmor-controller -n kubearmor
kubectl wait --timeout=1m --for=condition=ready pod -l kubearmor-app=kubearmor-controller -n kubearmor
kubectl rollout status deployment -n kubearmor -l kubearmor-app=kubearmor-relay -n kubearmor
kubectl rollout status daemonset -l kubearmor-app=kubearmor -n kubearmor
kubectl rollout status deployment -l kubearmor-app=kubearmor-controller -n kubearmor
kubectl wait --timeout=1m --for=condition=ready pod -l kubearmor-app,kubearmor-app!=kubearmor-snitch -n kubearmor
kubectl get pods -A
sleep 10
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/ci-test-ubi-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ jobs:
fi
kubectl wait -n kubearmor --timeout=5m --for=jsonpath='{.status.phase}'=Running kubearmorconfigs/kubearmorconfig-test
kubectl wait --timeout=7m --for=condition=ready pod -l kubearmor-app,kubearmor-app!=kubearmor-snitch,kubearmor-app!=kubearmor-controller -n kubearmor
kubectl wait --timeout=1m --for=condition=ready pod -l kubearmor-app=kubearmor-controller -n kubearmor
kubectl rollout status deployment -n kubearmor -l kubearmor-app=kubearmor-relay -n kubearmor
kubectl rollout status daemonset -l kubearmor-app=kubearmor -n kubearmor
kubectl rollout status deployment -l kubearmor-app=kubearmor-controller -n kubearmor
kubectl wait --timeout=1m --for=condition=ready pod -l kubearmor-app,kubearmor-app!=kubearmor-snitch -n kubearmor
kubectl get pods -A
- name: Operator may take upto 10 sec to enable TLS, Sleep for 15Sec
Expand Down

0 comments on commit 0b63c36

Please sign in to comment.