注册
登录
部署模型
部署文件错误但找不到从哪里发出
返回
部署文件错误但找不到从哪里发出
作者:
糖果
发布时间:
2025-01-27 07:32:59 (1天前)
我希望人们可以帮助指出我的部署文件中的问题出在哪里,当我部署时出现以下错误感谢您的帮助 "Deployment.apps "my-app" is invalid: [spec.template.spec.containers[0].volumeMounts[0].name: Not found: "audioSources", spec.template.spec.containers[0].volumeMounts[1].name: Not found: "authors", spec.template.spec.containers[0].volumeMounts[2].name: Not found: "covers"]" 这是我的部署文件 apiVersion: apps/v1 kind: Deployment metadata: labels: app: my-app name: my-app spec: replicas: 1 selector: matchLabels: app: my-app template: metadata: labels: app: my-app spec: containers: - image: myname/myimage name: my-app ports: - containerPort: 3000 volumeMounts: - name: audioSources mountPath: /usr/share/nginx/html/audioSources - name: authors mountPath: /usr/share/nginx/html/authors - name: covers mountPath: /usr/share/nginx/html/covers volumes: - name: audioSources hostPath: path: /home/websites/audioSources - name: authors hostPath: path: /home/websites/authors - name: covers hostPath: path: /home/websites/covers
收藏
举报
2 条回复
1#
回复此人
糖果
|
2021-07-28 13-41
这是一个固定部署: apiVersion: apps/v1 kind: Deployment metadata: labels: app: my-app name: my-app spec: replicas: 1 selector: matchLabels: app: my-app template: metadata: labels: app: my-app spec: containers: - image: myname/myimage name: my-app ports: - containerPort: 3000 volumeMounts: - name: audio-sources mountPath: /usr/share/nginx/html/audioSources - name: authors mountPath: /usr/share/nginx/html/authors - name: covers mountPath: /usr/share/nginx/html/covers volumes: - name: audio-sources hostPath: path: /home/websites/audioSources - name: authors hostPath: path: /home/websites/authors - name: covers hostPath: path: /home/websites/covers 音量应低于spec,与containers. 此外,名称audioSource更改为audio-source.
编辑
登录
后才能参与评论