mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Update cAdvisor with moved docker root on AWS
We set up a symlink now, and we also pass docker_root into the kubelet. The symlink is probably sufficient, but doing both feels safer.
This commit is contained in:
parent
1ccfa589e7
commit
2426366ec8
@ -60,7 +60,12 @@ else
|
|||||||
mount -t btrfs ${block_devices[0]} /mnt
|
mount -t btrfs ${block_devices[0]} /mnt
|
||||||
|
|
||||||
# Move docker to /mnt if we have it
|
# Move docker to /mnt if we have it
|
||||||
|
if [[ -d /var/lib/docker ]]; then
|
||||||
|
mv /var/lib/docker /mnt/
|
||||||
|
fi
|
||||||
mkdir -p /mnt/docker
|
mkdir -p /mnt/docker
|
||||||
|
ln -s /mnt/docker /var/lib/docker
|
||||||
|
DOCKER_ROOT="/mnt/docker"
|
||||||
DOCKER_OPTS="${DOCKER_OPTS} -g /mnt/docker"
|
DOCKER_OPTS="${DOCKER_OPTS} -g /mnt/docker"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -26,6 +26,18 @@ grains:
|
|||||||
cbr-cidr: "${MASTER_IP_RANGE}"
|
cbr-cidr: "${MASTER_IP_RANGE}"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
if [[ -n "${DOCKER_OPTS}" ]]; then
|
||||||
|
cat <<EOF >>/etc/salt/minion.d/grains.conf
|
||||||
|
docker_opts: '$(echo "$DOCKER_OPTS" | sed -e "s/'/''/g")'
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n "${DOCKER_ROOT}" ]]; then
|
||||||
|
cat <<EOF >>/etc/salt/minion.d/grains.conf
|
||||||
|
docker_root: '$(echo "$DOCKER_ROOT" | sed -e "s/'/''/g")'
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
cat <<EOF > /etc/aws.conf
|
cat <<EOF > /etc/aws.conf
|
||||||
[Global]
|
[Global]
|
||||||
Zone = ${ZONE}
|
Zone = ${ZONE}
|
||||||
|
@ -31,12 +31,19 @@ grains:
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
||||||
if [[ -n "{DOCKER_OPTS}" ]]; then
|
if [[ -n "${DOCKER_OPTS}" ]]; then
|
||||||
cat <<EOF >>/etc/salt/minion.d/grains.conf
|
cat <<EOF >>/etc/salt/minion.d/grains.conf
|
||||||
docker_opts: '$(echo "$DOCKER_OPTS" | sed -e "s/'/''/g")'
|
docker_opts: '$(echo "$DOCKER_OPTS" | sed -e "s/'/''/g")'
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -n "${DOCKER_ROOT}" ]]; then
|
||||||
|
cat <<EOF >>/etc/salt/minion.d/grains.conf
|
||||||
|
docker_root: '$(echo "$DOCKER_ROOT" | sed -e "s/'/''/g")'
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Install Salt
|
# Install Salt
|
||||||
#
|
#
|
||||||
# We specify -X to avoid a race condition that can cause minion failure to
|
# We specify -X to avoid a race condition that can cause minion failure to
|
||||||
|
@ -28,4 +28,9 @@
|
|||||||
{% set cluster_domain = "--cluster_domain=" + pillar['dns_domain'] %}
|
{% set cluster_domain = "--cluster_domain=" + pillar['dns_domain'] %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
DAEMON_ARGS="{{daemon_args}} {{api_servers}} {{hostname_override}} {{config}} --allow_privileged={{pillar['allow_privileged']}} {{pillar['log_level']}} {{cluster_dns}} {{cluster_domain}}"
|
{% set docker_root = "" -%}
|
||||||
|
{% if grains.docker_root is defined -%}
|
||||||
|
{% set docker_root = " --docker_root=" + grains.docker_root -%}
|
||||||
|
{% endif -%}
|
||||||
|
|
||||||
|
DAEMON_ARGS="{{daemon_args}} {{api_servers}} {{hostname_override}} {{config}} --allow_privileged={{pillar['allow_privileged']}} {{pillar['log_level']}} {{cluster_dns}} {{cluster_domain}} {{docker_root}}"
|
||||||
|
Loading…
Reference in New Issue
Block a user