Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Commit

Permalink
add kubelet-reloader support: a daemon to restart kubelet
Browse files Browse the repository at this point in the history
  • Loading branch information
pacoxu committed Jun 10, 2022
1 parent 5d25344 commit 1d0b363
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 14 deletions.
12 changes: 3 additions & 9 deletions commands/upgrade_kubectlkubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,13 @@ func runUpgradeKubectlAndKubelet(spec *operatorv1.UpgradeKubeletAndKubeactlComma
return err
}

// TODO stop kubelet and replace it
cmd = newCmd("/usr/bin/cp", "-f", "/usr/bin/kubelet-"+spec.KubernetesVersion, "/usr/bin/kubelet")
// see https://github.com/pacoxu/kubelet-reloader/ to add a daemon or service on nodes to replace kubelet and restart kubelet.
cmd = newCmd("/usr/bin/cp", "-f", "/usr/bin/kubelet-"+spec.KubernetesVersion, "/usr/bin/kubelet-new")
start, err = cmd.RunAndCapture()
if err != nil {
// skip kubelet replacement
cmd = newCmd("/usr/bin/cp", "-f", "/usr/bin/kubelet-"+spec.KubernetesVersion, "/usr/bin/kubelet-new")
start, err = cmd.RunAndCapture()
if err != nil {
}
// return errors.WithStack(errors.WithMessage(err, strings.Join(start, "\n")))
return errors.WithStack(errors.WithMessage(err, strings.Join(start, "\n")))
} else {
log.Info(fmt.Sprintf("%s", strings.Join(start, "\n")))
}

return nil
}
3 changes: 1 addition & 2 deletions config/crd/bases/operator.kubeadm.x-k8s.io_operations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,7 @@ spec:
- kubernetesVersion
type: object
kubeadmUpgradeKubeProxy:
description: KubeadmUpgradeApplyCommandSpec
provides...
description: not implemented yet
properties:
kubernetesVersion:
description: KubernetesVersion specifies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ spec:
- kubernetesVersion
type: object
kubeadmUpgradeKubeProxy:
description: KubeadmUpgradeApplyCommandSpec provides...
description: not implemented yet
properties:
kubernetesVersion:
description: KubernetesVersion specifies the target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ spec:
- kubernetesVersion
type: object
kubeadmUpgradeKubeProxy:
description: KubeadmUpgradeApplyCommandSpec provides...
description: not implemented yet
properties:
kubernetesVersion:
description: KubernetesVersion specifies the target kubernetes
Expand Down
2 changes: 1 addition & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ spec:
name: manager
resources:
limits:
cpu: 100m
cpu: 200m
memory: 30Mi
requests:
cpu: 100m
Expand Down

0 comments on commit 1d0b363

Please sign in to comment.