本文介绍了如何在Rancher-Kubernetes功能门中启用挂载传播?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Rancher 2.0中为集群启用功能门?我需要启用--feature-gates MountPropagation=true.这将使我能够使用StorageOS,CephFS等存储解决方案

How can I enable feature gates for my cluster in Rancher 2.0? I am in need of enabling the --feature-gates MountPropagation=true. This will enable me to use storage solutions like StorageOS, CephFS, etc

这里有2个用例:

  1. Rancher是否已设置并正在运行?
  2. 如果我要从头开始设置群集?

推荐答案

您好,希望这对某人有所帮助.在Rancher的杰出人士进行了大量的搜索和帮助之后,我找到了解决方案.这是设置Kubernetes引擎RKE的功能门标志的方法.

Hello and hope this helps someone, After much googling and help from awesome people at Rancher I got the solution for this.Here is what you can do to set the feature gates flags for the Kubernetes engine RKE.

第1步:打开Rancher2.0用户界面

step 1: Open Rancher2.0 UI

第2步:使用API​​查看集群

step 2: View cluster in API

第3步:点击修改并修改rancherKubernetesEngineConfig输入框

step 3: Click edit and modify the rancherKubernetesEngineConfig input box

  • 找到服务密钥.
  • 然后以以下格式为kubelet添加额外的args

  • Find the services key.
  • Then add extra args for kubelet in below format

"services": {
"etcd": { "type": "/v3/schemas/etcdService" },
"kubeApi": {
    "podSecurityPolicy": false,
    "type": "/v3/schemas/kubeAPIService",
    "extraArgs": { "feature-gates": "PersistentLocalVolumes=true, VolumeScheduling=true,MountPropagation=true" }
},
"kubeController": { "type": "/v3/schemas/kubeControllerService" },
"kubelet": {
    "failSwapOn": false,
    "type": "/v3/schemas/kubeletService",
    "extraArgs": { "feature-gates": "PersistentLocalVolumes=true, VolumeScheduling=true,MountPropagation=true" }
}

第4步:点击显示请求..您将获得curl命令和json请求.

step 4: Click show request .. you get a curl command and json request.

第5步:验证将显示的请求正文数据.

step 5: Verify the request body data which will be shown.

第6步:确保将不适用的密钥设置为null.例如amazonElasticContainerServiceConfigazureKubernetesServiceConfiggoogleKubernetesEngineConfig都需要对我为空.

step 6: Make sure the key's which are not applicable are set to null. e.g amazonElasticContainerServiceConfig, azureKubernetesServiceConfig, googleKubernetesEngineConfig all need to null for me.

第7步:点击发送请求

您应该收到状态码201的响应.并且您的集群将开始更新.您可以通过再次查看API中的集群来验证集群RKE是否已更新.

You should get a response with status code 201. And your cluster will start updating. You can verify that your cluster RKE has updated by viewing the Cluster in API again.

这篇关于如何在Rancher-Kubernetes功能门中启用挂载传播?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-26 18:05