Skip to content

Commit

Permalink
Merge pull request #422 from galal-hussein/use_cni_with_docker
Browse files Browse the repository at this point in the history
Add cni plugin to kubelet if docker is used
  • Loading branch information
ibuildthecloud authored May 2, 2019
2 parents 9005fd5 + 191ac93 commit 4ec051d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/agent/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions pkg/daemons/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
1 change: 1 addition & 0 deletions pkg/daemons/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ type Agent struct {
CNIConfDir string
ExtraKubeletArgs []string
ExtraKubeProxyArgs []string
CNIPlugin bool
}

type Control struct {
Expand Down

0 comments on commit 4ec051d

Please sign in to comment.