Skip to content

Commit

Permalink
deploy: 롤링업데이트 후에 실행중인 pod를 제외한 pods 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
GitJIHO committed Jan 5, 2025
1 parent b9e8c40 commit 271efba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/docker-push-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ jobs:
- name: Delete old Pods after successful rollout
run: |
NEW_POD=$(kubectl get pods -l app=knutoyproject -o jsonpath='{.items[?(@.status.phase=="Running")].metadata.name}' --kubeconfig ~/.kube/config --insecure-skip-tls-verify | head -n 1)
kubectl get pods -l app=knutoyproject --kubeconfig ~/.kube/config --insecure-skip-tls-verify -o jsonpath='{.items[?(@.metadata.name!="'$NEW_POD'")].metadata.name}' | xargs kubectl delete pod --kubeconfig ~/.kube/config --insecure-skip-tls-verify
kubectl get pods -l app=knutoyproject --kubeconfig ~/.kube/config --insecure-skip-tls-verify -o jsonpath='{.items[?(@.metadata.name!="'"$NEW_POD"'")].metadata.name}' | xargs -I {} kubectl delete pod {} --kubeconfig ~/.kube/config --insecure-skip-tls-verify

0 comments on commit 271efba

Please sign in to comment.