gpt4 book ai didi

azure - Kubernetes - 尝试部署时出现 "Mount Volume Failed"

转载 作者:行者123 更新时间:2023-12-02 23:59:50 24 4
gpt4 key购买 nike

我部署了第一个容器,我得到了信息:

deployment.apps/frontarena-ads-deployment created

但后来我看到我的容器创建陷入等待状态。然后我使用 kubectl描述pod frontarena-ads-deployment-5b475667dd-gzmlp 看到日志并看到 MountVolume 错误,我无法弄清楚为什么会抛出它:

Warning FailedMount 9m24s kubelet MountVolume.SetUpfailed for volume "ads-filesharevolume" : mount failed: exit status 32 Mounting command:systemd-run Mounting arguments: --description=Kubernetes transientmount 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-filesharevolumeOutput: Running scope as unitrun-rf54d5b5f84854777956ae0e25810bb94.scope. mount error(115):Operation now in progress Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

在运行部署之前,我使用已创建的 Azure 文件共享在 Azure 中创建了一个 secret ,我在 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

在该文件共享中,我需要挂载文件夹和文件,并在 YAML 中引用 azurecontainershare: enter image description here

我的 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

最佳答案

该问题是由于部署 AKS 群集和 Azure 文件共享的 Azure 区域不同所致。如果它们位于同一区域,则不会出现此问题。

关于azure - Kubernetes - 尝试部署时出现 "Mount Volume Failed",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66037883/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com