Azure Kubernetes Service change docker root to /mnt (/dev/sdb1 temporary storage)

2/4/2019

How do I change the Docker Root (/var/lib/docker) to use the /mnt folder ? I am running out of diskspace on my nodes .. the image size is 10gb (microsoft/vsts-agent).

I am using D16s_v3 : 16cores, 64gb memory, 32gb data disk (/dev/sda1), 128GB temporary storage (/dev/sdb1), with premium disk support.

/dev/sdb1 is mounted to /mnt

looks like I have to change the "data-root" variable in /etc/docker/daemon.json. But how to update this when creating/updating a AKS cluster ?

-- dparkar
azure
azure-aks
azure-devops
docker
kubernetes

2 Answers

2/4/2019

You can use a DaemonSet to manipulate files on the nodes, mounting / as HostPath volume. This gist I just made will modify the file as expected; you can then reboot the node to make sure docker will take up the changes. You can use Kured to programmatically reboot nodes as described in this article.

-- Alessandro Vozza
Source: StackOverflow

2/4/2019

this setting is not configurable with AKS (probably configurable with AKS engine), but you can work around the other way, increase disk dise. if you are using arm template you can specify disk size like this:

{
    "name": "nodepool1",
    "count": 3,
    "vmSize": "Standard_DS1_v2",
    "osType": "Linux",
    "osDiskSizeGB": 127 
}
-- 4c74356b41
Source: StackOverflow