Unverified Commit 4ec051d0 authored by Darren Shepherd's avatar Darren Shepherd Committed by GitHub

Merge pull request #422 from galal-hussein/use_cni_with_docker

Add cni plugin to kubelet if docker is used
parents 9005fd51 191ac937
......@@ -33,6 +33,7 @@ func run(ctx context.Context, cfg cmds.Agent) error {
if nodeConfig.Docker || nodeConfig.ContainerRuntimeEndpoint != "" {
nodeConfig.AgentConfig.RuntimeSocket = nodeConfig.ContainerRuntimeEndpoint
nodeConfig.AgentConfig.CNIPlugin = true
} else {
if err := containerd.Run(ctx, nodeConfig); err != nil {
return err
......
......@@ -78,6 +78,9 @@ func kubelet(cfg *config.Agent) {
if cfg.CNIBinDir != "" {
argsMap["cni-bin-dir"] = cfg.CNIBinDir
}
if cfg.CNIPlugin {
argsMap["network-plugin"] = "cni"
}
if len(cfg.ClusterDNS) > 0 {
argsMap["cluster-dns"] = cfg.ClusterDNS.String()
}
......
......@@ -53,6 +53,7 @@ type Agent struct {
CNIConfDir string
ExtraKubeletArgs []string
ExtraKubeProxyArgs []string
CNIPlugin bool
}
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