Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: don't remove cluster with unhealthy mng #5746

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,21 @@ jobs:
role: ${{ vars.CI_ROLE_NAME }}
region: ${{ inputs.region }}
cluster_name: ${{ steps.generate-cluster-name.outputs.CLUSTER_NAME }}
# In the case of failure, check if the managed node group is unhealthy. If so, do not clean up cluster for further investigation.
# TODO: @jmdeal remove after investigation is complete
- name: detect unhealthy mng
id: detect-unhealthy-mng
shell: bash
if: failure() || cancelled()
run: |
if ! kubectl get nodes -l eks.amazonaws.com/nodegroup -oyaml | yq ".items[].status.conditions" | grep -q "KubeletNotReady"; then
echo UNHEALTHY="false" >> "$GITHUB_OUTPUT"
else
echo UNHEALTHY="true" >> "$GITHUB_OUTPUT"
fi
- name: cleanup karpenter and cluster '${{ steps.generate-cluster-name.outputs.CLUSTER_NAME }}' resources
uses: ./.github/actions/e2e/cleanup
if: always() && inputs.cleanup
if: always() && inputs.cleanup && (steps.detect-unhealthy-mng.conclusion == 'skipped' || steps.detect-unhealthy-mng.outputs.UNHEALTHY == 'false')
with:
account_id: ${{ vars.CI_ACCOUNT_ID }}
role: ${{ vars.CI_ROLE_NAME }}
Expand Down
Loading