Skip to content

Commit

Permalink
test: k3s deploy action
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondanythings committed Aug 25, 2024
1 parent d95dfd1 commit 6bb420e
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions .github/workflows/k3s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -212,44 +212,3 @@ jobs:
run: |
kubectl apply -f deployment.yaml
- name: Verify deployment
run: |
# 최대 대기 시간 설정 (2분 = 120초)
timeout=120
start_time=$(date +%s)
while true; do
current_time=$(date +%s)
elapsed=$((current_time - start_time))
# 배포 상태 확인
STATUS=$(kubectl rollout status deployment/${{ env.MODULE }}-deployment -n default --timeout=10s)
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
echo "Deployment successful!"
exit 0
fi
# 타임아웃 체크
if [ $elapsed -ge $timeout ]; then
echo "Deployment verification timed out after ${timeout} seconds"
kubectl get pods -n default -l app=${{ env.MODULE }}
kubectl describe deployment ${{ env.MODULE }}-deployment -n default
exit 1
fi
remaining=$((timeout - elapsed))
echo "Waiting for deployment to complete... (${elapsed}s elapsed, ${remaining}s remaining)"
# 남은 시간이 10초 이하면 1초씩, 그 외에는 10초씩 대기
if [ $remaining -le 10 ]; then
sleep 1
else
sleep 10
fi
done
# - name: Clean up old images
# if: success()
# run: |
# kubectl exec -it $(kubectl get pods -l app=${{ env.MODULE }} -n ${{ env.NAMESPACE }} -o jsonpath='{.items[0].metadata.name}') -n ${{ env.NAMESPACE }} -- docker image prune -a -f

0 comments on commit 6bb420e

Please sign in to comment.