在Google Cloud Kubernetes上调整磁盘大小

时间:2018-07-06 16:07:50

标签: kubernetes gcloud google-kubernetes-engine

您好,我尝试按照docs上的步骤为我的kubernetes集群中的Pod调整磁盘大小,然后按以下步骤进入实例节点,但这给我一个错误

sudo growpart /dev/sdb 1
WARN: unknown label 
failed [sfd_dump:1] sfdisk --unit=S --dump /dev/sdb
/dev/sdb: device contains a valid 'ext4' signature; it is strongly recommended to wipe the device with wipefs(8)
 if this is unexpected, in order to avoid possible collisions
sfdisk: failed to dump partition table: Success
FAILED: failed to dump sfdisk info for /dev/sdb

我尝试从Pod内部运行命令,但甚至没有找到磁盘

root@rc-test-r2cfg:/# df -h
Filesystem      Size  Used Avail Use% Mounted on
overlay          59G  2.5G   56G   5% /
/dev/sdb         49G   22G   25G  47% /var/lib/postgresql/data

root@rc-test-r2cfg:/# lsblk
NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb      8:16   0  96G  0 disk /var/lib/postgresql/data
sda      8:0    0  60G  0 disk
└─sda1   8:1    0  60G  0 part /etc/hosts

root@rc-test-r2cfg:/# growpart /dev/sdb 1
FAILED: /dev/sdb: does not exist

其中/ dev / sdb是磁盘位置

1 个答案:

答案 0 :(得分:1)

现在可以轻松地通过直接更新持久性容量声明的存储规范来完成此操作。请参阅以下帖子以供参考: