Azure ACS AzureFile动态持久卷声明 [英] Azure ACS AzureFile Dynamic Persistent Volume Claim
问题描述
我正在尝试使用我用azure-file类型定义的存储类动态地调配存储.我试过在storageAccount和skuName的storageclass中设置两个参数.这是我设置了storageAccount的示例.
I am trying to Dynamically provision storage using a storageclass I've defined with type azure-file. I've tried setting both the parameters in the storageclass for storageAccount and skuName. Here is my example with storageAccount set.
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: azuretestfilestorage
namespace: kube-system
provisioner: kubernetes.io/azure-file
parameters:
storageAccount: <storage_account_name>
存储类创建成功,但是当我尝试使用该存储类创建持久卷声明时,持久卷创建失败,并显示以下错误:
The storageclass is created successfully however when I try to create a persistent volume claim using this storage class the persistent volume create fails with this error:
Failed to provision volume with StorageClass "azuretestfilestorage": failed to find a matching storage account
这是我的持久卷声明的代码
Here is the code for my persistentvolumeclaim
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: logging-persistent-volume-claim-test
namespace: kube-system
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 5Gi
storageClassName: azuretestfilestorage
我的存储帐户肯定与我的acs群集位于同一资源组和数据中心位置.我的理解是,应该自动生成一个秘密的,持久的卷和文件共享.取而代之的是,我只是卡在上述错误的挂起状态.
My storageaccount is definitely in the same resource group and data center location as my acs cluster. My understanding is that a secret, persistent volume, and file share should be automatically generated. Instead I just get stuck in a pending state w/ the above error.
这是我的kubectl版本命令的输出
Here is the output of my kubectl version command
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.3", GitCommit:"d2835416544f298c919e2ead3be3d0864b52323b", GitTreeState:"clean", BuildDate:"2018-02-07T12:22:21Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.7", GitCommit:"8e1552342355496b62754e61ad5f802a0f3f1fa7", GitTreeState:"clean", BuildDate:"2017-09-28T23:56:03Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
任何输入将不胜感激.谢谢!
Any input would be appreciated. Thanks!
推荐答案
我通过电子邮件向Microsoft azure支持小组发送了电子邮件,并收到了答案.
I emailed microsoft azure support about this and received an answer.
acs kubernetes 1.7.7版中存在一个错误,如果您在"/etc/kubernetes/manifests/kube-controller-manager.yaml"中的--cluster-name值,则不允许动态持久卷声明起作用主节点虚拟机的最大字符数大于16个字符.非常晦涩的错误.解决方法是升级群集或使用其他名称重新部署.
There is a bug in acs kubernetes version 1.7.7 that does not allow for dynamic persistent volume claims to work if your --cluster-name value in "/etc/kubernetes/manifests/kube-controller-manager.yaml" of the master node VM is greater than 16 characters. Very obscure bug. The fix is to upgrade your cluster or re-deploy with a different name.
这篇关于Azure ACS AzureFile动态持久卷声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!