Skip to content

Commit

Permalink
Add a Kine fix when rke2 restart apiserver
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Savian <[email protected]>

Remove unnecessary socket code

Signed-off-by: Vitor Savian <[email protected]>
  • Loading branch information
vitorsavian committed May 29, 2024
1 parent 99f9cc6 commit b7e5e8a
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions pkg/podexecutor/staticpod.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,17 +317,16 @@ func (s *StaticPodConfig) APIServer(_ context.Context, etcdReady <-chan struct{}
files = append(files, etcdNameFile(s.DataDir))
}

sockets := []string{}
if s.ExternalDatabase {
sockets = append(sockets, kineSock(s.DataDir))
}

dirs := onlyExisting(ssldirs)
if auditLogFile != "" && auditLogFile != "-" {
dirs = append(dirs, filepath.Dir(auditLogFile))
excludeFiles = append(excludeFiles, auditLogFile)
}

// Need to mount the entire server directory so that any files recreated in this directory
// after the pod has been started are not masked by a stale mount
dirs = append(dirs, filepath.Join(s.DataDir, "server"))

apiServerArgs := staticpod.Args{
Command: "kube-apiserver",
Args: args,
Expand All @@ -341,7 +340,6 @@ func (s *StaticPodConfig) APIServer(_ context.Context, etcdReady <-chan struct{}
ExtraEnv: s.ControlPlaneEnv.KubeAPIServer,
ExtraMounts: s.ControlPlaneMounts.KubeAPIServer,
ProbeConfs: s.ControlPlaneProbeConfs.KubeAPIServer,
Sockets: sockets,
Files: files,
ExcludeFiles: excludeFiles,
HealthExec: []string{
Expand Down Expand Up @@ -385,11 +383,6 @@ func (s *StaticPodConfig) Scheduler(_ context.Context, apiReady <-chan struct{},
files = append(files, etcdNameFile(s.DataDir))
}

sockets := []string{}
if s.ExternalDatabase {
sockets = append(sockets, kineSock(s.DataDir))
}

args = append(permitPortSharingFlag, args...)
return after(apiReady, func() error {
return staticpod.Run(s.ManifestsDir, staticpod.Args{
Expand All @@ -407,7 +400,6 @@ func (s *StaticPodConfig) Scheduler(_ context.Context, apiReady <-chan struct{},
ExtraMounts: s.ControlPlaneMounts.KubeScheduler,
ProbeConfs: s.ControlPlaneProbeConfs.KubeScheduler,
Files: files,
Sockets: sockets,
})
})
}
Expand Down Expand Up @@ -457,11 +449,6 @@ func (s *StaticPodConfig) ControllerManager(_ context.Context, apiReady <-chan s
files = append(files, etcdNameFile(s.DataDir))
}

sockets := []string{}
if s.ExternalDatabase {
sockets = append(sockets, kineSock(s.DataDir))
}

return after(apiReady, func() error {
extraArgs := []string{
"--flex-volume-plugin-dir=/var/lib/kubelet/volumeplugins",
Expand All @@ -484,7 +471,6 @@ func (s *StaticPodConfig) ControllerManager(_ context.Context, apiReady <-chan s
ExtraMounts: s.ControlPlaneMounts.KubeControllerManager,
ProbeConfs: s.ControlPlaneProbeConfs.KubeControllerManager,
Files: files,
Sockets: sockets,
})
})
}
Expand Down

0 comments on commit b7e5e8a

Please sign in to comment.