Commit 191ac937 authored by galal-hussein's avatar galal-hussein

Add cni plugin to kubelet if docker is used

parent 0726ce75
...@@ -33,6 +33,7 @@ func run(ctx context.Context, cfg cmds.Agent) error { ...@@ -33,6 +33,7 @@ func run(ctx context.Context, cfg cmds.Agent) error {
if nodeConfig.Docker || nodeConfig.ContainerRuntimeEndpoint != "" { if nodeConfig.Docker || nodeConfig.ContainerRuntimeEndpoint != "" {
nodeConfig.AgentConfig.RuntimeSocket = nodeConfig.ContainerRuntimeEndpoint nodeConfig.AgentConfig.RuntimeSocket = nodeConfig.ContainerRuntimeEndpoint
nodeConfig.AgentConfig.CNIPlugin = true
} else { } else {
if err := containerd.Run(ctx, nodeConfig); err != nil { if err := containerd.Run(ctx, nodeConfig); err != nil {
return err return err
......
...@@ -78,6 +78,9 @@ func kubelet(cfg *config.Agent) { ...@@ -78,6 +78,9 @@ func kubelet(cfg *config.Agent) {
if cfg.CNIBinDir != "" { if cfg.CNIBinDir != "" {
argsMap["cni-bin-dir"] = cfg.CNIBinDir argsMap["cni-bin-dir"] = cfg.CNIBinDir
} }
if cfg.CNIPlugin {
argsMap["network-plugin"] = "cni"
}
if len(cfg.ClusterDNS) > 0 { if len(cfg.ClusterDNS) > 0 {
argsMap["cluster-dns"] = cfg.ClusterDNS.String() argsMap["cluster-dns"] = cfg.ClusterDNS.String()
} }
......
...@@ -53,6 +53,7 @@ type Agent struct { ...@@ -53,6 +53,7 @@ type Agent struct {
CNIConfDir string CNIConfDir string
ExtraKubeletArgs []string ExtraKubeletArgs []string
ExtraKubeProxyArgs []string ExtraKubeProxyArgs []string
CNIPlugin bool
} }
type Control struct { type Control struct {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment