如何修改kube-apiserver.yaml

环境信息:
RKE2 版本:
rke2 version v1.26.12+rke2r1 (10683d5a09610873f643ada416b97eb01859108d)
go version go1.20.12 X:boringcrypto

节点 CPU 架构,操作系统和版本:
Linux k8s-01 5.4.0-125-generic #141-Ubuntu SMP Wed Aug 10 13:42:03 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

集群配置:

问题描述:
创建storageclss失败,报错“ExternalProvisioning 2s (x5 over 52s) persistentvolume-controller waiting for a volume to be created, either by external provisioner “nasp
lugin.csi.alibabacloud.com” or manually created by system administrator”,百度得知需要修改kube-apiserver.yaml,问:直接修改/var/lib/rancher/rke2/agent/pod-manifests/kube-apiserver.yaml,然后apply一下吗?

重现步骤:

预期结果:
成功

实际结果:
失败

日志

ExternalProvisioning 2s (x5 over 52s) persistentvolume-controller waiting for a volume to be created, either by external provisioner “nasp
lugin.csi.alibabacloud.com” or manually created by system administrator

- --feature-gates=RemoveSelfLink=false

试试这个:

# cat /etc/rancher/rke2/config.yaml
kube-apiserver-arg:
  - "feature-gates=RemoveSelfLink=false"

参考:

大佬,
编辑这个文件后,重启rke服务吗

重启

image
image


大佬修改后重启咋一直起不来

看日志,是 api-server 没启动,你可以参考 RKE2 commands 使用 crictl 来查看 api-server 的日志。