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

Add preflight validation to check management components vs cluster components version skew #7800

Conversation

cxbrowne1207
Copy link
Member

@cxbrowne1207 cxbrowne1207 commented Mar 6, 2024

Issue #, if available:

Description of changes:
We have added to the docs that the suppported version difference of management components can be at most 1 EKS Anywhere minor version greater than the EKS Anywhere version of cluster components. However, we have no pre-flight validation that ensures that. This PR adds that preflight validation.

Testing (if applicable):

  • Unit testing
  • Manual testing:
    • Created cluster with v0.19.0 release
    • Upgraded management components with main
s-1-27-eks-22"}
2024-03-06T22:22:54.328Z        V0      ✅ Vsphere provider setup and validation
2024-03-06T22:22:54.328Z        V6      Getting KubeadmControlPlane CRDs        {"cluster": "mgmt"}
2024-03-06T22:22:54.328Z        V6      Executing command       {"cmd": "/usr/bin/docker exec -i eksa_1709763772371803610 kubectl get kubeadmcontrolplanes.controlplane.cluster.x-k8s.io mgmt -o json --kubeconfig mgmt/mgmt-eks-a-cluster.kubeconfig --namespace eksa-system"}
2024-03-06T22:22:54.525Z        V0      ✅ Control plane ready
2024-03-06T22:22:54.525Z        V6      Executing command       {"cmd": "/usr/bin/docker exec -i eksa_1709763772371803610 kubectl get customresourcedefinition clusters.cluster.x-k8s.io --kubeconfig mgmt/mgmt-eks-a-cluster.kubeconfig"}
2024-03-06T22:22:54.692Z        V0      ✅ Cluster CRDs ready
2024-03-06T22:22:54.692Z        V6      Executing command       {"cmd": "/usr/bin/docker exec -i eksa_1709763772371803610 kubectl get clusters.anywhere.eks.amazonaws.com -A -o jsonpath={.items[0]} --kubeconfig mgmt/mgmt-eks-a-cluster.kubeconfig --field-selector=metadata.name=mgmt"}
2024-03-06T22:22:54.911Z        V0      ✅ Validate management components version to cluster version skew
2024-03-06T22:22:54.911Z        V4      Task finished   {"task_name": "validate", "duration": "2.067429957s"}
2024-03-06T22:22:54.911Z        V4      ----------------------------------
2024-03-06T22:22:54.911Z        V4      Task start      {"task_name": "upgrade-core-components-mc"}
2024-03-06T22:22:54.911Z        V0      Upgrading core components
2024-03-06T22:22:54.911Z        V6      Executing command       {"cmd": "/usr/bin/docker exec -i eksa_1709763772371803610 kubectl get --ignore-not-found -o json --kubeconfig mgmt/mgmt-eks-a-cluster.kubeconfig EKSARelease.v1alpha1.anywhere.eks.amazonaws.com --namespace eksa-system eksa-v0-19-0"}
2024-03-06T22:22:55.082Z        V6      Executing command       {"cmd": "/usr/bin/docker exec -i eksa_170

Documentation added/planned (if applicable):

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@eks-distro-bot
Copy link
Collaborator

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@eks-distro-bot eks-distro-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 6, 2024
@cxbrowne1207 cxbrowne1207 changed the title Add preflight validation to ensure management components are only one minor version ahead of cluster components Add preflight validation to check management components vs cluster components version skew Mar 6, 2024
@cxbrowne1207 cxbrowne1207 force-pushed the preflight-validation--management-components-version branch from 3c45616 to fcafeed Compare March 6, 2024 22:21
Copy link

codecov bot commented Mar 6, 2024

Codecov Report

Attention: Patch coverage is 39.28571% with 17 lines in your changes are missing coverage. Please review.

Project coverage is 73.54%. Comparing base (7ba9b3c) to head (b79ffea).
Report is 8 commits behind head on main.

❗ Current head b79ffea differs from pull request most recent head 150d868. Consider uploading reports for the commit 150d868 to get more accurate results

Files Patch % Lines
...kflows/management/upgrade_management_components.go 0.00% 10 Missing ⚠️
pkg/validations/cluster.go 64.70% 3 Missing and 3 partials ⚠️
...eksctl-anywhere/cmd/upgrademanagementcomponents.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7800      +/-   ##
==========================================
- Coverage   73.55%   73.54%   -0.02%     
==========================================
  Files         588      588              
  Lines       37176    37200      +24     
==========================================
+ Hits        27346    27357      +11     
- Misses       8035     8045      +10     
- Partials     1795     1798       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cxbrowne1207 cxbrowne1207 force-pushed the preflight-validation--management-components-version branch from c148af0 to 3539692 Compare March 6, 2024 22:29
@cxbrowne1207 cxbrowne1207 marked this pull request as ready for review March 6, 2024 22:29
@cxbrowne1207 cxbrowne1207 force-pushed the preflight-validation--management-components-version branch from 3539692 to b79ffea Compare March 7, 2024 17:26
pkg/validations/cluster.go Outdated Show resolved Hide resolved
pkg/validations/cluster.go Show resolved Hide resolved
pkg/workflows/management/upgrade_management_components.go Outdated Show resolved Hide resolved
@cxbrowne1207 cxbrowne1207 force-pushed the preflight-validation--management-components-version branch from 243a817 to 150d868 Compare March 8, 2024 18:53
@cxbrowne1207
Copy link
Member Author

/approve

@eks-distro-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cxbrowne1207

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@eks-distro-bot eks-distro-bot merged commit 858ab9c into aws:main Mar 8, 2024
8 checks passed
@cxbrowne1207
Copy link
Member Author

/cherry-pick release-0.19

@eks-distro-pr-bot
Copy link
Contributor

@cxbrowne1207: new pull request created: #7812

In response to this:

/cherry-pick release-0.19

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants