1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-19 18:30:38 +00:00

Use configured docker daemon root dir on kubelet

This commit is contained in:
Sebastiaan van Steenis
2018-02-16 18:10:14 +01:00
parent 674b46abca
commit 086201a5f5
3 changed files with 5 additions and 1 deletions

View File

@@ -216,7 +216,7 @@ func (c *Cluster) BuildKubeletProcess(host *hosts.Host) v3.Process {
"/var/lib/cni:/var/lib/cni:z",
"/etc/resolv.conf:/etc/resolv.conf",
"/sys:/sys",
"/var/lib/docker:/var/lib/docker:rw,z",
host.DockerInfo.DockerRootDir + ":" + host.DockerInfo.DockerRootDir + ":rw,z",
"/var/lib/kubelet:/var/lib/kubelet:shared,z",
"/var/run:/var/run:rw",
"/run:/run",

View File

@@ -4,7 +4,9 @@ import (
"context"
"fmt"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/client"
"github.com/rancher/rke/docker"
"github.com/rancher/rke/k8s"
@@ -29,6 +31,7 @@ type Host struct {
ToDelLabels map[string]string
ToAddTaints []string
ToDelTaints []string
DockerInfo types.Info
}
const (

View File

@@ -60,6 +60,7 @@ func checkDockerVersion(ctx context.Context, h *Host) error {
return fmt.Errorf("Can't retrieve Docker Info: %v", err)
}
logrus.Debugf("Docker Info found: %#v", info)
h.DockerInfo = info
isvalid, err := docker.IsSupportedDockerVersion(info, K8sVersion)
if err != nil {
return fmt.Errorf("Error while determining supported Docker version [%s]: %v", info.ServerVersion, err)