Merge pull request #8912 from justinsb/volumes_kubelet_root_not_symlink

Ensure kubelet root is not a symlink
This commit is contained in:
Eric Tune
2015-06-01 09:24:32 -07:00
6 changed files with 33 additions and 4 deletions

View File

@@ -75,5 +75,6 @@ else
fi
mkdir -p /mnt/kubelet
ln -s /mnt/kubelet /var/lib/kubelet
KUBELET_ROOT="/mnt/kubelet"
fi

View File

@@ -38,6 +38,12 @@ if [[ -n "${DOCKER_ROOT}" ]]; then
EOF
fi
if [[ -n "${KUBELET_ROOT}" ]]; then
cat <<EOF >>/etc/salt/minion.d/grains.conf
kubelet_root: '$(echo "$KUBELET_ROOT" | sed -e "s/'/''/g")'
EOF
fi
# Auto accept all keys from minions that try to join
mkdir -p /etc/salt/master.d
cat <<EOF >/etc/salt/master.d/auto-accept.conf

View File

@@ -55,6 +55,12 @@ if [[ -n "${DOCKER_ROOT}" ]]; then
EOF
fi
if [[ -n "${KUBELET_ROOT}" ]]; then
cat <<EOF >>/etc/salt/minion.d/grains.conf
kubelet_root: '$(echo "$KUBELET_ROOT" | sed -e "s/'/''/g")'
EOF
fi
install-salt
service salt-minion start

View File

@@ -53,6 +53,11 @@
{% set docker_root = " --docker_root=" + grains.docker_root -%}
{% endif -%}
{% set kubelet_root = "" -%}
{% if grains.kubelet_root is defined -%}
{% set kubelet_root = " --root_dir=" + grains.kubelet_root -%}
{% endif -%}
{% set configure_cbr0 = "" -%}
{% if pillar['allocate_node_cidrs'] is defined -%}
{% set configure_cbr0 = "--configure-cbr0=" + pillar['allocate_node_cidrs'] -%}
@@ -66,4 +71,4 @@
{% set cgroup_root = "--cgroup_root=/" -%}
{% endif -%}
DAEMON_ARGS="{{daemon_args}} {{api_servers_with_port}} {{hostname_override}} {{cloud_provider}} {{config}} --allow_privileged={{pillar['allow_privileged']}} {{pillar['log_level']}} {{cluster_dns}} {{cluster_domain}} {{docker_root}} {{configure_cbr0}} {{cgroup_root}} {{system_container}}"
DAEMON_ARGS="{{daemon_args}} {{api_servers_with_port}} {{hostname_override}} {{cloud_provider}} {{config}} --allow_privileged={{pillar['allow_privileged']}} {{pillar['log_level']}} {{cluster_dns}} {{cluster_domain}} {{docker_root}} {{kubelet_root}} {{configure_cbr0}} {{cgroup_root}} {{system_container}}"