summaryrefslogtreecommitdiff
path: root/keadm
diff options
context:
space:
mode:
authorKubeEdge Bot <48982446+kubeedge-bot@users.noreply.github.com>2023-10-09 10:11:54 +0800
committerGitHub <noreply@github.com>2023-10-09 10:11:54 +0800
commit3a8f9a83b628da65feae543a6017a6dc184f4b5d (patch)
tree107e8b7442014c5375a857736bc7e87549905dac /keadm
parentMerge pull request #4904 from ZhengXinwei-F/version (diff)
parentupdate resourcetype pod (diff)
downloadkubeedge-3a8f9a83b628da65feae543a6017a6dc184f4b5d.tar.gz
Merge pull request #4825 from luomengY/modify_mqtt_static
Add the function of supporting static pod on edge nodes.
Diffstat (limited to 'keadm')
-rw-r--r--keadm/cmd/keadm/app/cmd/reset.go19
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 {