简体   繁体   English

Kubernetes - 尝试部署时“安装卷失败”

[英]Kubernetes - “Mount Volume Failed” when trying to deploy

I deployed my first container, I got info:我部署了我的第一个容器,我得到了信息:

deployment.apps/frontarena-ads-deployment created

but then I saw my container creation is stuck in Waiting status.但后来我看到我的容器创建卡在等待状态。 Then I saw the logs using kubectl describe pod frontarena-ads-deployment-5b475667dd-gzmlp and saw MountVolume error which I cannot figure out why it is thrown:然后我看到了使用kubectl describe pod frontarena-ads-deployment-5b475667dd-gzmlp ,并看到了 MountVolume 错误,我无法弄清楚为什么会抛出它:

Warning FailedMount 9m24s kubelet MountVolume.SetUp failed for volume "ads-filesharevolume": mount failed: exit status 32 Mounting command: systemd-run Mounting arguments: --description=Kubernetes transient mount for /var/lib/kubelet/pods/85aa3bfa-341a-4da1-b3de-fb1979420028/volumes/kubernetes.io~azure-file/ads-filesharevolume --scope -- mount -t cifs -o username=frontarenastorage,password=mypassword,file_mode=0777,dir_mode=0777,vers=3.0 //frontarenastorage.file.core.windows.net/azurecontainershare /var/lib/kubelet/pods/85aa3bfa-341a-4da1-b3de-fb1979420028/volumes/kubernetes.io~azure-file/ads-filesharevolume Output: Running scope as unit run-rf54d5b5f84854777956ae0e25810bb94.scope.警告 FailedMount 9m24s kubelet MountVolume.SetUp failed for volume "ads-filesharevolume": mount failed: exit status 32 Mounting command: systemd-run Mounting arguments: --description=Kubernetes 临时装载 /var/lib/kubelet/pods/85aa3bfa- 341a-4da1-b3de-fb1979420028/volumes/kubernetes.io~azure-file/ads-filesharevolume --scope -- mount -t cifs -o username=frontarenastorage,password=mypassword,file_mode=0777,dir_mode=0777,vers= 3.0 //frontarenastorage.file.core.windows.net/azurecontainershare /var/lib/kubelet/pods/85aa3bfa-341a-4da1-b3de-fb1979420028/volumes/kubernetes.io~azure-file/ads-filesharevolume Output: Running scope作为单元运行-rf54d5b5f84854777956ae0e25810bb94.scope。 mount error(115): Operation now in progress Refer to the mount.cifs(8) manual page (eg man mount.cifs) mount error(115): Operation now in progress 请参考 mount.cifs(8) 手册页(例如 man mount.cifs)

Before I run the deployment I created a secret in Azure, using the already created azure file share, which I referenced within the YAML.在运行部署之前,我使用已创建的 azure 文件共享在 Azure 中创建了一个秘密,我在 YAML 中引用了该文件共享。

$AKS_PERS_STORAGE_ACCOUNT_NAME="frontarenastorage"
$STORAGE_KEY="mypassword"
kubectl create secret generic fa-fileshare-secret --from-literal=azurestorageaccountname=$AKS_PERS_STORAGE_ACCOUNT_NAME --from-literal=azurestorageaccountkey=$STORAGE_KEY

In that file share I have folders and files which I need to mount and I reference azurecontainershare in YAML:在该文件共享中,我有需要挂载的文件夹和文件,我在YAML中引用了 azurecontainershare: 在此处输入图像描述

My YAML looks like this:我的 YAML 看起来像这样:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: frontarena-ads-deployment
  labels:
    app: frontarena-ads-deployment
spec:
  replicas: 1
  template:
    metadata:
      name: frontarena-ads-aks-test
      labels:
        app: frontarena-ads-aks-test
    spec:
      containers:
      - name: frontarena-ads-aks-test
        image: faselect-docker.dev/frontarena/ads:test1
        imagePullPolicy: Always
        ports:
          - containerPort: 9000
        volumeMounts:
          - name: ads-filesharevolume
            mountPath: /opt/front/arena/host
      volumes:
      - name: ads-filesharevolume
        azureFile:
          secretName: fa-fileshare-secret
          shareName: azurecontainershare
          readOnly: false
      imagePullSecrets:
        - name: fa-repo-secret
  selector:
    matchLabels:
      app: frontarena-ads-aks-test

The Issue was because of the different Azure Regions in which AKS cluster and Azure File Share are deployed.问题是因为部署了 AKS 群集和 Azure 文件共享的不同 Azure 区域。 If they are in the same Region you would not have this issue.如果他们在同一个地区,你就不会遇到这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 kubernetes 中使用 Windows 容器挂载卷? - How to mount a volume with a windows container in kubernetes? 无法使用 Azure 文件配置器将卷安装到 Kubernetes 中的 pod - Cannot mount volume to pod in Kubernetes using Azure file provisioner 在 Azure kubernetes 上安装 PVC 卷需要一个多小时 - PVC volume mount on Azure kubernetes takes over an hour Azure kube.netes - 将 Azure blob 安装为一个卷并使用 python 写入? - Azure kubernetes - mount Azure blob as a volume and write using python? Kubernetes 挂载卷存储账户失败:挂载错误(13):权限被拒绝 - Kubernetes mount volume storage account fails: mount error(13): Permission denied 您能否在来自不同区域的 AKS Kubernetes 集群上装载 NetApp 卷? - Can you mount a NetApp volume on a AKS Kubernetes Cluster from a different region? 尝试连接到 kubernetes 时出错 - Errors when trying to connect to kubernetes 通过Kubernetes安装卷时Neo4j关闭 - Neo4j shutdown when mounting volume via Kubernetes 尝试挂载Azure文件存储时“找不到合适的地址” - “Unable to find suitable address” when trying to mount Azure File storage 将Azure Files的文件夹挂载到Kubernetes吗? - Mount Azure Files' folder into Kubernetes?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM