mirror of https://github.com/k3s-io/k3s
Merge pull request #422 from galal-hussein/use_cni_with_docker
Add cni plugin to kubelet if docker is usedpull/429/head v0.5.0-rc2
commit
4ec051d032
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue