mirror of https://github.com/k3s-io/k3s
Merge pull request #32102 from errordeveloper/fix-32085
Automatic merge from submit-queue Do not go into standalone mode when `--require-kubeconfig` is passed **What this PR does / why we need it**: We have change how missing `--api-servers` is treated with introduction of `--require-kubeconfig` (#30798), however we haven't introduced explicit `--standalone` flag for backwards-compatibility reasons. Right now, setting `--kubeconfig` and`--require-kubeconfig` still gets kubelet into standalone mode. In practice this means that it doesn't get to update `nodeInfo` and thereby may refuse to admit pods which had been assigned to it by the scheduler. For example, if you update labels for that given node, and try to use affinity or `NodeLabels` on a pod, it won't get to run. **Which issue this PR fixes**: fixes #32085 **Special notes for your reviewer**: This fix is only until we introduce `--standalone` flag. **Release note**: <!-- Steps to write your release note: 1. Use the release-note-* labels to set the release note state (if you have access) 2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. --> ```release-note NONE ```pull/6/head
commit
e7e9587799
|
@ -298,7 +298,7 @@ func initConfigz(kc *componentconfig.KubeletConfiguration) (*configz.Config, err
|
|||
|
||||
func run(s *options.KubeletServer, kubeDeps *kubelet.KubeletDeps) (err error) {
|
||||
// TODO: this should be replaced by a --standalone flag
|
||||
standaloneMode := (len(s.APIServerList) == 0)
|
||||
standaloneMode := (len(s.APIServerList) == 0 && !s.RequireKubeConfig)
|
||||
|
||||
if s.ExitOnLockContention && s.LockFilePath == "" {
|
||||
return errors.New("cannot exit on lock file contention: no lock file specified")
|
||||
|
|
Loading…
Reference in New Issue