k8s pvc 扩容方法
  TEZNKK3IfmPf 2023年11月13日 35 0

本课程将详细介绍k8s所有命令,以及命令的go源码分析,学习知其然,知其所以然

————————————————

1storageclass 设置allowVolumeExpansion: true

如:

apiVersion: ​​storage.k8s.io/v1​​​ kind: StorageClass
metadata:
name: rook-block
provisioner: ​​rook.io/block​​ allowVolumeExpansion: true
parameters:
pool: replicapool
# Specify the namespace of the rook cluster from which to create volumes.
# If not specified, it will use `rook` as the default namespace of the cluster.
# This is also the namespace where the cluster will be
clusterNamespace: rook
# Specify the filesystem type of the volume. If not specified, it will use `ext4`.
# fstype: ext4

 

2编辑pvc增大容量

3扩展rdb

用rdb resize命令

如:

rbd resize --size 9192 pvc-6a06fa0f-c0a5-401b-83bf-d44c1dd20d80

扩展好后查看:

 rbd info --pool replicapool2 pvc-6a06fa0f-c0a5-401b-83bf-d44c1dd20d80   

4进入pod所在的主机

执行:resize2fs

如: resize2fs /dev/rbd1   

5进入pod,查看是否容量扩大

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月13日 0

暂无评论

推荐阅读
  TEZNKK3IfmPf   2023年11月15日   31   0   0 k8s
  TEZNKK3IfmPf   2023年11月15日   21   0   0 k8s
TEZNKK3IfmPf