1- From d0ae18d074db5ff361f363073f32b2f30c7a3686 Mon Sep 17 00:00:00 2001
1+ From 3162aa9df25819b60a3c0a3b044394639d55280c Mon Sep 17 00:00:00 2001
22From: Konstantinos Tsakalozos <
[email protected] >
33Date: Wed, 3 Mar 2021 18:19:37 +0200
44Subject: [PATCH] Kubelite integration
@@ -19,19 +19,19 @@ Subject: [PATCH] Kubelite integration
1919 create mode 100644 cmd/kubelite/kubelite.go
2020
2121diff --git a/cmd/kube-apiserver/app/server.go b/cmd/kube-apiserver/app/server.go
22- index fc36d044dbe..cffb7c35a3c 100644
22+ index b021bac2574..8d5a1bad8ed 100644
2323--- a/cmd/kube-apiserver/app/server.go
2424+++ b/cmd/kube-apiserver/app/server.go
25- @@ -89 ,7 +89 ,7 @@ func init() {
25+ @@ -76 ,7 +76 ,7 @@ func init() {
2626 }
27-
27+
2828 // NewAPIServerCommand creates a *cobra.Command object with default parameters
2929- func NewAPIServerCommand() *cobra.Command {
3030+ func NewAPIServerCommand(stopCh... <- chan struct{}) *cobra.Command {
3131 s := options.NewServerRunOptions()
3232 cmd := &cobra.Command{
3333 Use: "kube-apiserver",
34- @@ -129 ,7 +129 ,12 @@ cluster's shared state through which all other components interact.`,
34+ @@ -116 ,7 +116 ,12 @@ cluster's shared state through which all other components interact.`,
3535 }
3636 // add feature enablement metrics
3737 utilfeature.DefaultMutableFeatureGate.AddMetrics()
@@ -46,7 +46,7 @@ index fc36d044dbe..cffb7c35a3c 100644
4646 Args: func(cmd *cobra.Command, args []string) error {
4747 for _, arg := range args {
4848diff --git a/cmd/kube-scheduler/app/server.go b/cmd/kube-scheduler/app/server.go
49- index 8d01f3b7670..44ac7f69328 100644
49+ index c48b09a420d..b7f273b02ac 100644
5050--- a/cmd/kube-scheduler/app/server.go
5151+++ b/cmd/kube-scheduler/app/server.go
5252@@ -132,7 +132,11 @@ func runCommand(cmd *cobra.Command, opts *options.Options, registryOptions ...Op
@@ -63,19 +63,19 @@ index 8d01f3b7670..44ac7f69328 100644
6363 cancel()
6464 }()
6565diff --git a/cmd/kubelet/app/server.go b/cmd/kubelet/app/server.go
66- index 9444f136866..8ca88f64d04 100644
66+ index 742524e325f..561cbf68868 100644
6767--- a/cmd/kubelet/app/server.go
6868+++ b/cmd/kubelet/app/server.go
69- @@ -120 ,7 +120 ,7 @@ const (
69+ @@ -122 ,7 +122 ,7 @@ const (
7070 )
71-
71+
7272 // NewKubeletCommand creates a *cobra.Command object with default parameters
7373- func NewKubeletCommand() *cobra.Command {
7474+ func NewKubeletCommand(ctx ...context.Context) *cobra.Command {
7575 cleanFlagSet := pflag.NewFlagSet(componentKubelet, pflag.ContinueOnError)
7676 cleanFlagSet.SetNormalizeFunc(cliflag.WordSepNormalizeFunc)
7777 kubeletFlags := options.NewKubeletFlags()
78- @@ -250 ,6 +250 ,12 @@ HTTP server: The kubelet can also listen for HTTP and respond to a simple API
78+ @@ -249 ,6 +249 ,12 @@ is checked every 20 seconds ( also configurable with a flag).`,
7979 if err := checkPermissions(); err != nil {
8080 klog.ErrorS(err, "kubelet running with insufficient permissions")
8181 }
@@ -85,13 +85,13 @@ index 9444f136866..8ca88f64d04 100644
8585+ } else {
8686+ runctx = ctx[0]
8787+ }
88-
88+
8989 // make the kubelet's config safe for logging
9090 config := kubeletServer.KubeletConfiguration.DeepCopy()
91- @@ -259 ,12 +265 ,9 @@ HTTP server: The kubelet can also listen for HTTP and respond to a simple API
91+ @@ -258 ,12 +264 ,9 @@ is checked every 20 seconds ( also configurable with a flag).`,
9292 // log the kubelet's config for inspection
93- klog.V(5).InfoS("KubeletConfiguration", "configuration", config)
94-
93+ klog.V(5).InfoS("KubeletConfiguration", "configuration", klog.Format( config) )
94+
9595- // set up signal context for kubelet shutdown
9696- ctx := genericapiserver.SetupSignalContext()
9797-
@@ -101,7 +101,7 @@ index 9444f136866..8ca88f64d04 100644
101101+ return Run(runctx, kubeletServer, kubeletDeps, utilfeature.DefaultFeatureGate)
102102 },
103103 }
104-
104+
105105diff --git a/cmd/kubelite/app/daemons/daemon.go b/cmd/kubelite/app/daemons/daemon.go
106106new file mode 100644
107107index 00000000000..dbef03cf07e
@@ -398,35 +398,34 @@ index 00000000000..667b24f68e6
398398+ println("Stopping kubelite")
399399+ }
400400diff --git a/pkg/volume/csi/csi_plugin.go b/pkg/volume/csi/csi_plugin.go
401- index ce7a543c94f..a8094f878d6 100644
401+ index 2556517276e..0b5ef45d083 100644
402402--- a/pkg/volume/csi/csi_plugin.go
403403+++ b/pkg/volume/csi/csi_plugin.go
404- @@ -240 ,18 +240 ,22 @@ func (p *csiPlugin) Init(host volume.VolumeHost) error {
404+ @@ -243 ,18 +243 ,22 @@ func (p *csiPlugin) Init(host volume.VolumeHost) error {
405405 }
406-
406+
407407 // Initializing the label management channels
408408- nim = nodeinfomanager.NewNodeInfoManager(host.GetNodeName(), host, migratedPlugins)
409409+ localNim := nodeinfomanager.NewNodeInfoManager(host.GetNodeName(), host, migratedPlugins)
410-
410+
411411 // This function prevents Kubelet from posting Ready status until CSINode
412412 // is both installed and initialized
413413- if err := initializeCSINode(host); err != nil {
414414+ if err := initializeCSINode(host, localNim); err != nil {
415415 return errors.New(log("failed to initialize CSINode: %v", err))
416416 }
417-
417+
418418+ if _, ok := host.(volume.KubeletVolumeHost); ok {
419419+ nim = localNim
420420+ }
421421+
422422 return nil
423423 }
424-
424+
425425- func initializeCSINode(host volume.VolumeHost) error {
426426+ func initializeCSINode(host volume.VolumeHost, nim nodeinfomanager.Interface) error {
427427 kvh, ok := host.(volume.KubeletVolumeHost)
428428 if !ok {
429429 klog.V(4).Info("Cast from VolumeHost to KubeletVolumeHost failed. Skipping CSINode initialization, not running on kubelet")
430- - -
430+ - -
4314312.34.1
432-
0 commit comments