Merge pull request #422 from galal-hussein/use_cni_with_docker

Add cni plugin to kubelet if docker is used
This commit is contained in:
Darren Shepherd 2019-05-02 10:45:34 -07:00 committed by GitHub
commit 4ec051d032
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 0 deletions

View File

@ -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

View File

@ -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()
}

View File

@ -53,6 +53,7 @@ type Agent struct {
CNIConfDir string
ExtraKubeletArgs []string
ExtraKubeProxyArgs []string
CNIPlugin bool
}
type Control struct {