k8s 的 pv 会爆掉吗 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
henrywangx
V2EX    问与答

k8s 的 pv 会爆掉吗

  •  
  •   henrywangx 这是一个创建于 2424 天前的主题,其中的信息可能已经有所发展或是发生改变。
    地铁上突然想起,如果累积大小超过 k8s 的 persistent volume 大小,pod 会怎么样?
    10 条回复    2019-11-15 11:19:07 +08:00
    ifaii
        1
    ifaii  
       2019-05-01 10:13:51 +08:00   1
    大小是由底层存储类型控制的,并不是 k8s 里面声明的,超过后只要底层卷没满就可以继续写
    henrywangx
        2
    henrywangx  
    OP
       2019-05-01 10:52:14 +08:00 via iPhone
    @ifaii 那 k8s 声明的大小意义何在呢?
    ifaii
        3
    ifaii  
       2019-05-01 11:08:38 +08:00
    @henrywangx #2 以我的理解经验是在使用 storageclass 动态创建 pvc 时声明需要创建的大小,这时候底层存储就分配给你这么大的一个卷
    iwishing
        4
    iwishing  
       2019-05-01 12:20:34 +08:00
    https://github.com/kubernetes/kubernetes/issues/48701

    this is working as intended, kube can't/won't enforce the capacity of PVs, the capacity field on PVs is just a label. It's up to the "administrator" i.e. the creator of the PV to label it accurately so that when users create PVCs that needs >= X Gi, they get what they want.

    For a hostPath PV, assigning a capacity may be difficult when the user can use as much free space as there is at that host path, but for e.g. EBS you can of course make capacity match the actual disk size.

    声明的意义在于 pvc 去匹配 pv (手动狗头)
    artandlol
        5
    artandlol  
       2019-05-01 13:17:47 +08:00 via iPhone
    这问题有点傻傻的,满了,pod 自然就挂了
    henrywangx
        6
    henrywangx  
    OP
       2019-05-01 14:30:03 +08:00 via iPhone
    @artandlol sorry,事实上并没有挂掉...我没找到官方详细的描述,所以求问...
    henrywangx
        7
    henrywangx  
    OP
       2019-05-01 14:31:02 +08:00 via iPhone
    @iwishing 谢谢指教,我会再去看看文档和代码
    kaneg
        8
    kaneg  
       2019-05-01 18:15:20 +08:00 via iPhone
    对一般存储来说 kubernetes 根本不知道你的 PV 实际占用多大空间,只要你底层存储不会因为空间爆掉而出问题就行
    lingduhuanbing
        9
    lingduhuanbing  
       2019-11-15 09:40:38 +08:00
    确实不会爆掉,这个设定确实很奇怪。K8S 还提供了 PVC 扩容,如果还是根据底层存储的实际容量来,那直接扩底层存储就好了,为啥还要扩 PVC ?
    henrywangx
        10
    henrywangx  
    OP
       2019-11-15 11:19:07 +08:00 via iPhone
    @lingduhuanbing 这个就是个标签啦,可能最开始就是为公有云服务的,而且最近理解,k8s 就是 platform for platform,这些标签的背后行为还是由 devops 自己去管理
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     5086 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 27ms UTC 07:51 PVG 15:51 LAX 23:51 JFK 02:51
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86