Commit 3abc49a7 authored by kaiyou's avatar kaiyou
Browse files

Propagate CNI cache dir to flannel

parent 1b719fed
Pipeline #731 passed with stage
in 2 minutes and 43 seconds
......@@ -450,6 +450,7 @@ func get(envInfo *cmds.Agent) (*config.Node, error) {
nodeConfig.FlannelConfOverride = true
}
nodeConfig.AgentConfig.CNIBinDir = filepath.Dir(hostLocal)
nodeConfig.AgentConfig.CNICacheDir = filepath.Join(envInfo.DataDir, "cni")
nodeConfig.AgentConfig.CNIConfDir = filepath.Join(envInfo.DataDir, "etc/cni/net.d")
}
......
......@@ -25,6 +25,7 @@ const (
{
"type":"flannel",
"subnetFile": "{{ .FlannelSubnetFile }}",
"cacheDir": "{{ }}",
"delegate":{
"hairpinMode":true,
"forceAddress":true,
......
......@@ -33,6 +33,7 @@ const ContainerdConfigTemplate = `
{{- if not .NodeConfig.NoFlannel }}
[plugins.cri.cni]
cache_dir = "{{ .NodeConfig.AgentConfig.CNICacheDir }}"
bin_dir = "{{ .NodeConfig.AgentConfig.CNIBinDir }}"
conf_dir = "{{ .NodeConfig.AgentConfig.CNIConfDir }}"
{{end}}
......
......@@ -82,6 +82,9 @@ func startKubelet(cfg *config.Agent) {
if cfg.CNIBinDir != "" {
argsMap["cni-bin-dir"] = cfg.CNIBinDir
}
if cfg.CNIBinDir != "" {
argsMap["cni-cache-dir"] = cfg.CNICacheDir
}
if cfg.CNIPlugin {
argsMap["network-plugin"] = "cni"
}
......
......@@ -67,6 +67,7 @@ type Agent struct {
RuntimeSocket string
ListenAddress string
ClientCA string
CNICacheDir string
CNIBinDir string
CNIConfDir string
KubeletPort string
......
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