mirror of
https://github.com/rancher/rke.git
synced 2025-07-04 02:57:52 +00:00
Add bind mount for /var/lib/cri-dockerd
(#3001)
* Add dockershim bind to 1.24 and newer of K8s
This commit is contained in:
parent
b2cb35d58d
commit
22b0894c83
@ -499,6 +499,9 @@ func (c *Cluster) BuildKubeletProcess(host *hosts.Host, serviceOptions v3.Kubern
|
||||
CommandArgs["tls-cert-file"] = pki.GetCertPath(pki.GetCrtNameForHost(host, pki.KubeletCertName))
|
||||
CommandArgs["tls-private-key-file"] = pki.GetCertPath(fmt.Sprintf("%s-key", pki.GetCrtNameForHost(host, pki.KubeletCertName)))
|
||||
}
|
||||
|
||||
var Binds []string
|
||||
|
||||
if c.IsCRIDockerdEnabled() {
|
||||
CommandArgs["container-runtime"] = "remote"
|
||||
CommandArgs["container-runtime-endpoint"] = "/var/run/dockershim.sock"
|
||||
@ -509,6 +512,7 @@ func (c *Cluster) BuildKubeletProcess(host *hosts.Host, serviceOptions v3.Kubern
|
||||
// cri-dockerd must be enabled if the cluster version is 1.24 and higher
|
||||
if parsedRangeAtLeast124(parsedVersion) {
|
||||
CommandArgs["container-runtime-endpoint"] = "unix:///var/run/cri-dockerd.sock"
|
||||
Binds = []string{fmt.Sprintf("%s:/var/lib/cri-dockerd:z", path.Join(host.PrefixPath, "/var/lib/cri-dockerd"))}
|
||||
}
|
||||
}
|
||||
|
||||
@ -542,18 +546,17 @@ func (c *Cluster) BuildKubeletProcess(host *hosts.Host, serviceOptions v3.Kubern
|
||||
services.SidekickContainerName,
|
||||
}
|
||||
|
||||
var Binds []string
|
||||
if host.IsWindows() { // compatible with Windows
|
||||
Binds = []string{
|
||||
Binds = append(Binds, []string{
|
||||
// put the execution binaries and cloud provider configuration to the host
|
||||
fmt.Sprintf("%s:c:/host/etc/kubernetes", path.Join(host.PrefixPath, "/etc/kubernetes")),
|
||||
// put the flexvolume plugins or private registry docker configuration to the host
|
||||
fmt.Sprintf("%s:c:/host/var/lib/kubelet", path.Join(host.PrefixPath, "/var/lib/kubelet")),
|
||||
// exchange resources with other components
|
||||
fmt.Sprintf("%s:c:/host/run", path.Join(host.PrefixPath, "/run")),
|
||||
}
|
||||
}...)
|
||||
} else {
|
||||
Binds = []string{
|
||||
Binds = append(Binds, []string{
|
||||
fmt.Sprintf("%s:/etc/kubernetes:z", path.Join(host.PrefixPath, "/etc/kubernetes")),
|
||||
"/etc/cni:/etc/cni:rw,z",
|
||||
"/opt/cni:/opt/cni:rw,z",
|
||||
@ -572,7 +575,7 @@ func (c *Cluster) BuildKubeletProcess(host *hosts.Host, serviceOptions v3.Kubern
|
||||
"/var/log/pods:/var/log/pods:z",
|
||||
"/usr:/host/usr:ro",
|
||||
"/etc:/host/etc:ro",
|
||||
}
|
||||
}...)
|
||||
|
||||
// Special case to simplify using flex volumes
|
||||
if path.Join(host.PrefixPath, "/var/lib/kubelet") != "/var/lib/kubelet" {
|
||||
|
File diff suppressed because one or more lines are too long
@ -9224,10 +9224,10 @@
|
||||
},
|
||||
"v1.20.15-rancher2-1": {
|
||||
"etcd": "rancher/mirrored-coreos-etcd:v3.4.15-rancher1",
|
||||
"alpine": "rancher/rke-tools:v0.1.83",
|
||||
"nginxProxy": "rancher/rke-tools:v0.1.83",
|
||||
"certDownloader": "rancher/rke-tools:v0.1.83",
|
||||
"kubernetesServicesSidecar": "rancher/rke-tools:v0.1.83",
|
||||
"alpine": "rancher/rke-tools:v0.1.85",
|
||||
"nginxProxy": "rancher/rke-tools:v0.1.85",
|
||||
"certDownloader": "rancher/rke-tools:v0.1.85",
|
||||
"kubernetesServicesSidecar": "rancher/rke-tools:v0.1.85",
|
||||
"kubedns": "rancher/mirrored-k8s-dns-kube-dns:1.15.10",
|
||||
"dnsmasq": "rancher/mirrored-k8s-dns-dnsmasq-nanny:1.15.10",
|
||||
"kubednsSidecar": "rancher/mirrored-k8s-dns-sidecar:1.15.10",
|
||||
@ -9606,10 +9606,10 @@
|
||||
},
|
||||
"v1.21.14-rancher1-1": {
|
||||
"etcd": "rancher/mirrored-coreos-etcd:v3.4.16-rancher1",
|
||||
"alpine": "rancher/rke-tools:v0.1.83",
|
||||
"nginxProxy": "rancher/rke-tools:v0.1.83",
|
||||
"certDownloader": "rancher/rke-tools:v0.1.83",
|
||||
"kubernetesServicesSidecar": "rancher/rke-tools:v0.1.83",
|
||||
"alpine": "rancher/rke-tools:v0.1.85",
|
||||
"nginxProxy": "rancher/rke-tools:v0.1.85",
|
||||
"certDownloader": "rancher/rke-tools:v0.1.85",
|
||||
"kubernetesServicesSidecar": "rancher/rke-tools:v0.1.85",
|
||||
"kubedns": "rancher/mirrored-k8s-dns-kube-dns:1.17.4",
|
||||
"dnsmasq": "rancher/mirrored-k8s-dns-dnsmasq-nanny:1.17.4",
|
||||
"kubednsSidecar": "rancher/mirrored-k8s-dns-sidecar:1.17.4",
|
||||
@ -10079,10 +10079,10 @@
|
||||
},
|
||||
"v1.22.11-rancher1-1": {
|
||||
"etcd": "rancher/mirrored-coreos-etcd:v3.5.3",
|
||||
"alpine": "rancher/rke-tools:v0.1.83",
|
||||
"nginxProxy": "rancher/rke-tools:v0.1.83",
|
||||
"certDownloader": "rancher/rke-tools:v0.1.83",
|
||||
"kubernetesServicesSidecar": "rancher/rke-tools:v0.1.83",
|
||||
"alpine": "rancher/rke-tools:v0.1.85",
|
||||
"nginxProxy": "rancher/rke-tools:v0.1.85",
|
||||
"certDownloader": "rancher/rke-tools:v0.1.85",
|
||||
"kubernetesServicesSidecar": "rancher/rke-tools:v0.1.85",
|
||||
"kubedns": "rancher/mirrored-k8s-dns-kube-dns:1.17.4",
|
||||
"dnsmasq": "rancher/mirrored-k8s-dns-dnsmasq-nanny:1.17.4",
|
||||
"kubednsSidecar": "rancher/mirrored-k8s-dns-sidecar:1.17.4",
|
||||
@ -10094,12 +10094,12 @@
|
||||
"flannel": "rancher/mirrored-coreos-flannel:v0.15.1",
|
||||
"flannelCni": "rancher/flannel-cni:v0.3.0-rancher6",
|
||||
"calicoNode": "rancher/mirrored-calico-node:v3.21.1",
|
||||
"calicoCni": "rancher/mirrored-calico-cni:v3.21.1",
|
||||
"calicoCni": "rancher/calico-cni:v3.21.1-rancher1",
|
||||
"calicoControllers": "rancher/mirrored-calico-kube-controllers:v3.21.1",
|
||||
"calicoCtl": "rancher/mirrored-calico-ctl:v3.21.1",
|
||||
"calicoFlexVol": "rancher/mirrored-calico-pod2daemon-flexvol:v3.21.1",
|
||||
"canalNode": "rancher/mirrored-calico-node:v3.21.1",
|
||||
"canalCni": "rancher/mirrored-calico-cni:v3.21.1",
|
||||
"canalCni": "rancher/calico-cni:v3.21.1-rancher1",
|
||||
"canalControllers": "rancher/mirrored-calico-kube-controllers:v3.21.1",
|
||||
"canalFlannel": "rancher/mirrored-flannelcni-flannel:v0.17.0",
|
||||
"canalFlexVol": "rancher/mirrored-calico-pod2daemon-flexvol:v3.21.1",
|
||||
@ -10595,10 +10595,10 @@
|
||||
},
|
||||
"v1.23.8-rancher1-1": {
|
||||
"etcd": "rancher/mirrored-coreos-etcd:v3.5.3",
|
||||
"alpine": "rancher/rke-tools:v0.1.83",
|
||||
"nginxProxy": "rancher/rke-tools:v0.1.83",
|
||||
"certDownloader": "rancher/rke-tools:v0.1.83",
|
||||
"kubernetesServicesSidecar": "rancher/rke-tools:v0.1.83",
|
||||
"alpine": "rancher/rke-tools:v0.1.85",
|
||||
"nginxProxy": "rancher/rke-tools:v0.1.85",
|
||||
"certDownloader": "rancher/rke-tools:v0.1.85",
|
||||
"kubernetesServicesSidecar": "rancher/rke-tools:v0.1.85",
|
||||
"kubedns": "rancher/mirrored-k8s-dns-kube-dns:1.21.1",
|
||||
"dnsmasq": "rancher/mirrored-k8s-dns-dnsmasq-nanny:1.21.1",
|
||||
"kubednsSidecar": "rancher/mirrored-k8s-dns-sidecar:1.21.1",
|
||||
@ -10610,12 +10610,12 @@
|
||||
"flannel": "rancher/mirrored-coreos-flannel:v0.15.1",
|
||||
"flannelCni": "rancher/flannel-cni:v0.3.0-rancher6",
|
||||
"calicoNode": "rancher/mirrored-calico-node:v3.22.0",
|
||||
"calicoCni": "rancher/mirrored-calico-cni:v3.22.0",
|
||||
"calicoCni": "rancher/calico-cni:v3.22.0-rancher1",
|
||||
"calicoControllers": "rancher/mirrored-calico-kube-controllers:v3.22.0",
|
||||
"calicoCtl": "rancher/mirrored-calico-ctl:v3.22.0",
|
||||
"calicoFlexVol": "rancher/mirrored-calico-pod2daemon-flexvol:v3.22.0",
|
||||
"canalNode": "rancher/mirrored-calico-node:v3.22.0",
|
||||
"canalCni": "rancher/mirrored-calico-cni:v3.22.0",
|
||||
"canalCni": "rancher/calico-cni:v3.22.0-rancher1",
|
||||
"canalControllers": "rancher/mirrored-calico-kube-controllers:v3.22.0",
|
||||
"canalFlannel": "rancher/mirrored-flannelcni-flannel:v0.17.0",
|
||||
"canalFlexVol": "rancher/mirrored-calico-pod2daemon-flexvol:v3.22.0",
|
||||
@ -10638,10 +10638,10 @@
|
||||
},
|
||||
"v1.24.2-rancher1-1": {
|
||||
"etcd": "rancher/mirrored-coreos-etcd:v3.5.4",
|
||||
"alpine": "rancher/rke-tools:v0.1.83",
|
||||
"nginxProxy": "rancher/rke-tools:v0.1.83",
|
||||
"certDownloader": "rancher/rke-tools:v0.1.83",
|
||||
"kubernetesServicesSidecar": "rancher/rke-tools:v0.1.83",
|
||||
"alpine": "rancher/rke-tools:v0.1.85",
|
||||
"nginxProxy": "rancher/rke-tools:v0.1.85",
|
||||
"certDownloader": "rancher/rke-tools:v0.1.85",
|
||||
"kubernetesServicesSidecar": "rancher/rke-tools:v0.1.85",
|
||||
"coredns": "rancher/mirrored-coredns-coredns:1.9.3",
|
||||
"corednsAutoscaler": "rancher/mirrored-cluster-proportional-autoscaler:1.8.5",
|
||||
"nodelocal": "rancher/mirrored-k8s-dns-node-cache:1.21.1",
|
||||
@ -10649,12 +10649,12 @@
|
||||
"flannel": "rancher/mirrored-coreos-flannel:v0.15.1",
|
||||
"flannelCni": "rancher/flannel-cni:v0.3.0-rancher6",
|
||||
"calicoNode": "rancher/mirrored-calico-node:v3.22.0",
|
||||
"calicoCni": "rancher/mirrored-calico-cni:v3.22.0",
|
||||
"calicoCni": "rancher/calico-cni:v3.22.0-rancher1",
|
||||
"calicoControllers": "rancher/mirrored-calico-kube-controllers:v3.22.0",
|
||||
"calicoCtl": "rancher/mirrored-calico-ctl:v3.22.0",
|
||||
"calicoFlexVol": "rancher/mirrored-calico-pod2daemon-flexvol:v3.22.0",
|
||||
"canalNode": "rancher/mirrored-calico-node:v3.22.0",
|
||||
"canalCni": "rancher/mirrored-calico-cni:v3.22.0",
|
||||
"canalCni": "rancher/calico-cni:v3.22.0-rancher1",
|
||||
"canalControllers": "rancher/mirrored-calico-kube-controllers:v3.22.0",
|
||||
"canalFlannel": "rancher/mirrored-flannelcni-flannel:v0.17.0",
|
||||
"canalFlexVol": "rancher/mirrored-calico-pod2daemon-flexvol:v3.22.0",
|
||||
|
Loading…
Reference in New Issue
Block a user