-
Notifications
You must be signed in to change notification settings - Fork 2
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
K8s core component validation #116
Merged
ipetrov117
merged 14 commits into
suse-edge:main
from
ipetrov117:k8s-core-component-validation
Dec 11, 2024
Merged
K8s core component validation #116
ipetrov117
merged 14 commits into
suse-edge:main
from
ipetrov117:k8s-core-component-validation
Dec 11, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
atanasdinov
reviewed
Dec 11, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! A couple of questions and suggestions before we merge this. Let me know what you think.
atanasdinov
approved these changes
Dec 11, 2024
atanasdinov
added a commit
that referenced
this pull request
Dec 11, 2024
…y, annotations usage (#117) * Use CustomValidator interface for webhook implementation (#97) * Use CustomValidator interface for webhook implementation Signed-off-by: Atanas Dinov <[email protected]> * Unify webhook register Signed-off-by: Atanas Dinov <[email protected]> --------- Signed-off-by: Atanas Dinov <[email protected]> * Improve node matching (#98) * Improve node matching during Kubernetes upgrades Signed-off-by: Atanas Dinov <[email protected]> * Improve node matching during OS upgrades Signed-off-by: Atanas Dinov <[email protected]> --------- Signed-off-by: Atanas Dinov <[email protected]> * Move away from using annotations in favour of labels (#100) * Move to label usage * Provide better readibility for label addition * Bring back release as annotation * Bump helm.sh/helm/v3 from 3.15.4 to 3.16.2 (#99) Bumps [helm.sh/helm/v3](https://github.com/helm/helm) from 3.15.4 to 3.16.2. - [Release notes](https://github.com/helm/helm/releases) - [Commits](helm/helm@v3.15.4...v3.16.2) --- updated-dependencies: - dependency-name: helm.sh/helm/v3 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Reduce concurrency for OS SUC workers (#107) * Reduce concurrency for OS SUC workers * Fix unit tests * K8s core component validation (#116) * Add core component definitions in release manifest * Align helm chart CRD indentations with kubebuilder generated CRD * Introduce new release manifest CRD changes * make generate * Introduce container comparison logic * Update variable name to improve reusability * Add deployment monitoring permissions to reconciler * Introduce helm release comparison function * Update function to parse K8s distribution * Introduce wait mechanism for K8s core components * Fix typos * Don't fail on job not found errors * Check deployment staus conditions * Fix typos --------- Signed-off-by: Atanas Dinov <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Ivo Petrov <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR suggests an enhancement over the Kubernetes component version upgrade validation that we currently do.
A new
optional
field for KubernetesDistributions has been introduced in the release manifest calledcoreComponents
. If specified this field indicates all components considered to be essential for a Kubernetes version upgrade.With this new addition the
upgrade-controller
Kubernetes verification workflow will look like this:control-plane
, orworker
node to be marked asReady
,Scheduable
and with the correct K8s version.coreComponents
list (if it exists) and wait for the specific component resource type to become ready and be with the correct version.Where will core components be retrieved from?
coreComponents
are all deployed throughHelmChart
resources and their versions can be viewed from theChart Versions
table of each RKE2 release. Example forv1.31.2
- https://github.com/rancher/rke2/releases/tag/v1.31.2%2Brke2r1. Alternatively the chart list can also be viewed from the repository here. Everything.yaml
file from this directory will be deployed using the RKE2 auto-deploy manifests mechanism.coreComponents
both throughHelmCharts
andDeployments
. To get the full core component list that is used for a K3s release, we would need to look at themanifests
directory of a specific K3s release. Example for1.31.2
- https://github.com/k3s-io/k3s/tree/v1.31.2%2Bk3s1/manifests. Everything from this directory will be deployed through the K3s auto-deploy manifests mechanism.How will the release manifest look like when
coreComponents
are defined?A release manifest for K3s/RKE2
1.31.2
version, would look like this:How will the upgrade of K3s/RKE2 core components look like in the release manifest?
RKE2:
Chart Versions
table.coreComponents
for the RKE2 component with the versions from this table.K3s:
manifests
directory.HelmChart
files for changes in their versions:traefik.yaml
Deployment
files for changes in their image versions:local-storage.yaml
coredns.yam
metrics-server/metrics-server-deployment.yaml
What does this PR fix?
By applying this fix, we ensure that we wait for all the core components related to a specific K8s distribution before marking its upgrade as complete. Doing this, we ensure that we do not start the Helm chart upgrade prematurely. We also avoid the problem of the Helm chart upgrade failing, due to it being unable to communicate with a core component that is currently being recreated.
closes: #109
Do all
coreComponents
need to be present on the machine?No. RKE2/K3s support different use-cases, which require different core components. The
upgrade-controller
will only wait for the upgrade ofcoreComponents
that are currently present on the cluster.What use-cases have been tested?
coreComponents
upgrade