Azure Kubernetes 服务将 docker root 更改为 /mnt(/dev/sdb1 临时存储)

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

如何更改 Docker 根 (/var/lib/docker) 以使用 /mnt 文件夹?我的节点上 运行 磁盘空间不足 .. 图像大小为 10gb (microsoft/vsts-agent)。

我正在使用 D16s_v3:16 核、64GB 内存、32GB 数据磁盘 (/dev/sda1)、128GB 临时存储空间 (/dev/sdb1),具有高级磁盘支持。

/dev/sdb1 挂载到 /mnt

看来我必须更改 /etc/docker/daemon.json 中的 "data-root" 变量。但是如何在 creating/updating AKS 集群时更新它?

此设置无法使用 AKS 配置(可能可以使用 AKS 引擎配置),但您可以通过其他方式解决,增加磁盘磁盘。如果您使用的是 arm 模板,您可以像这样指定磁盘大小:

{
    "name": "nodepool1",
    "count": 3,
    "vmSize": "Standard_DS1_v2",
    "osType": "Linux",
    "osDiskSizeGB": 127 
}

您可以使用 DaemonSet 操作节点上的文件,将 / 安装为 HostPath 卷。这个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