diff options
| author | luomengY <2938893385@qq.com> | 2023-08-30 21:50:01 +0800 |
|---|---|---|
| committer | luomengY <2938893385@qq.com> | 2023-09-23 15:41:03 +0800 |
| commit | 146654ade70f96302a45a75988ff8e32cfa51217 (patch) | |
| tree | 6208f3c309883586abe5ae5d1ea48f18fe5bf7c4 /keadm | |
| parent | Merge pull request #5006 from wlq1212/k8scompatibility/schedule (diff) | |
| download | kubeedge-146654ade70f96302a45a75988ff8e32cfa51217.tar.gz | |
add support static in kubeedge
Signed-off-by: luomengY <2938893385@qq.com>
Diffstat (limited to 'keadm')
| -rw-r--r-- | keadm/cmd/keadm/app/cmd/reset.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/keadm/cmd/keadm/app/cmd/reset.go b/keadm/cmd/keadm/app/cmd/reset.go index a180bca7e..10e8fb052 100644 --- a/keadm/cmd/keadm/app/cmd/reset.go +++ b/keadm/cmd/keadm/app/cmd/reset.go @@ -21,6 +21,7 @@ import ( "fmt" "os" "strings" + "time" "github.com/spf13/cobra" phases "k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/reset" @@ -90,6 +91,24 @@ func NewKubeEdgeReset() *cobra.Command { return fmt.Errorf("aborted reset operation") } } + + // first cleanup edge node static pod directory to stop static and mirror pod + if isEdgeNode { + config, err := util.ParseEdgecoreConfig(common.EdgecoreConfigPath) + if err != nil { + return err + } + dir := config.Modules.Edged.TailoredKubeletConfig.StaticPodPath + if dir != "" { + if err := phases.CleanDir(dir); err != nil { + fmt.Printf("Failed to delete static pod directory %s: %v\n", dir, err) + } else { + time.Sleep(1 * time.Second) + fmt.Printf("Static pod directory has been removed!\n") + } + } + } + // 1. kill cloudcore/edgecore process. // For edgecore, don't delete node from K8S if err := TearDownKubeEdge(isEdgeNode, reset.Kubeconfig); err != nil { |
