Allow workers to use cached config#7685
Open
azmifarih wants to merge 1 commit into
Open
Conversation
Workers currently block startup when the Kubernetes API is unavailable because they must fetch the worker profile ConfigMap before starting local components. This prevents previously joined workers from starting kubelet with their cached configuration during temporary control plane outages. Add an opt-in worker flag that falls back to the cached worker profile only when the API is unavailable and the cached profile matches the requested profile. Fixes: k0sproject#7379 Signed-off-by: Muhammad Azmi Farih <muazfa@gmail.com>
Member
|
@azmifarih What's the use case where you need this functionality? |
Author
The main use case is edge/offline recovery. If a worker that has already joined the cluster reboots while the control plane is temporarily unreachable, it currently blocks on fetching the worker profile ConfigMap. That means kubelet does not start, so local/static pod workloads on the worker cannot recover. |
Contributor
|
This pull request has merge conflicts that need to be resolved. |
This file contains hidden or 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
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.
Fixes #7379
Adds
--allow-cached-configfor workers. When enabled, k0s still tries to load the worker profile from the Kubernetes API first. If the API server is unavailable, it falls back to the cached worker profile when the cached profile exists and matches the requested profile.Default behavior is unchanged.
Type of change
How Has This Been Tested?
Unit tests:
Manual bootloose verification:
check-basicbootloose cluster./var/lib/k0s/worker-profile.yamlexists onworker0.worker0with--allow-cached-config.k0s,containerd, andkubeletwere running on the worker.Readyand all kube-system pods wereRunning.Checklist