Browse Source

Merge pull request #422 from galal-hussein/use_cni_with_docker

Add cni plugin to kubelet if docker is used
pull/429/head v0.5.0-rc2
Darren Shepherd 6 years ago committed by GitHub
parent
commit
4ec051d032
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      pkg/agent/run.go
  2. 3
      pkg/daemons/agent/agent.go
  3. 1
      pkg/daemons/config/types.go

1
pkg/agent/run.go

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

3
pkg/daemons/agent/agent.go

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

1
pkg/daemons/config/types.go

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

Loading…
Cancel
Save