mirror of
https://github.com/rancher/rke.git
synced 2025-09-13 13:40:22 +00:00
Revert kubelet fix as Docker 19.03.9 has fix
This commit is contained in:
@@ -525,6 +525,7 @@ func (c *Cluster) BuildKubeletProcess(host *hosts.Host, prefixPath string, servi
|
|||||||
"/var/lib/calico:/var/lib/calico:z",
|
"/var/lib/calico:/var/lib/calico:z",
|
||||||
"/etc/resolv.conf:/etc/resolv.conf",
|
"/etc/resolv.conf:/etc/resolv.conf",
|
||||||
"/sys:/sys:rprivate",
|
"/sys:/sys:rprivate",
|
||||||
|
host.DockerInfo.DockerRootDir + ":" + host.DockerInfo.DockerRootDir + ":rw,rslave,z",
|
||||||
fmt.Sprintf("%s:%s:shared,z", path.Join(prefixPath, "/var/lib/kubelet"), path.Join(prefixPath, "/var/lib/kubelet")),
|
fmt.Sprintf("%s:%s:shared,z", path.Join(prefixPath, "/var/lib/kubelet"), path.Join(prefixPath, "/var/lib/kubelet")),
|
||||||
"/var/lib/rancher:/var/lib/rancher:shared,z",
|
"/var/lib/rancher:/var/lib/rancher:shared,z",
|
||||||
"/var/run:/var/run:rw,rprivate",
|
"/var/run:/var/run:rw,rprivate",
|
||||||
@@ -536,12 +537,6 @@ func (c *Cluster) BuildKubeletProcess(host *hosts.Host, prefixPath string, servi
|
|||||||
"/usr:/host/usr:ro",
|
"/usr:/host/usr:ro",
|
||||||
"/etc:/host/etc:ro",
|
"/etc:/host/etc:ro",
|
||||||
}
|
}
|
||||||
BindDockerRootDir := fmt.Sprintf("%s:%s:rw,rslave,z", host.DockerInfo.DockerRootDir, host.DockerInfo.DockerRootDir)
|
|
||||||
if hosts.IsEnterpriseLinuxHost(host) && hosts.IsDockerSELinuxEnabled(host) && !hosts.IsEnterpriseLinuxDocker(host) {
|
|
||||||
// Avoid relabing on Enterprise Linux with Docker SELinux and upstream Docker
|
|
||||||
BindDockerRootDir = strings.TrimSuffix(BindDockerRootDir, ",z")
|
|
||||||
}
|
|
||||||
Binds = append(Binds, BindDockerRootDir)
|
|
||||||
// Special case to simplify using flex volumes
|
// Special case to simplify using flex volumes
|
||||||
if path.Join(prefixPath, "/var/lib/kubelet") != "/var/lib/kubelet" {
|
if path.Join(prefixPath, "/var/lib/kubelet") != "/var/lib/kubelet" {
|
||||||
Binds = append(Binds, "/var/lib/kubelet/volumeplugins:/var/lib/kubelet/volumeplugins:shared,z")
|
Binds = append(Binds, "/var/lib/kubelet/volumeplugins:/var/lib/kubelet/volumeplugins:shared,z")
|
||||||
|
@@ -408,7 +408,7 @@ func IsDockerSELinuxEnabled(host *Host) bool {
|
|||||||
|
|
||||||
func IsEnterpriseLinuxHost(host *Host) bool {
|
func IsEnterpriseLinuxHost(host *Host) bool {
|
||||||
operatingSystem := strings.ToLower(host.DockerInfo.OperatingSystem)
|
operatingSystem := strings.ToLower(host.DockerInfo.OperatingSystem)
|
||||||
if strings.Contains(operatingSystem, "centos") || strings.Contains(operatingSystem, "red hat") {
|
if strings.Contains(operatingSystem, "centos") || strings.Contains(operatingSystem, "enterprise linux") || strings.Contains(operatingSystem, "oracle linux") {
|
||||||
logrus.Debugf("Host [%s] with OperatingSystem [%s] is Enterprise Linux", host.Address, operatingSystem)
|
logrus.Debugf("Host [%s] with OperatingSystem [%s] is Enterprise Linux", host.Address, operatingSystem)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user