k8s中pod挂载本地文件失败
解决办法namespace: vcsreplicaCount: 1resources:limits:cpu: 4memory: 4Girequests:cpu: 2memory: 4Giimage:repository: "镜像地址"tag: "版本号"pullPolicy: Alwaysservice:name: api-serverport: 8088targetPort: 8088nodeP
·
解决办法
# pod启动失败,查看详细描述信息
kubectl describe pod -n <namespeace> appName
namespace: vcs
replicaCount: 1
resources:
limits:
cpu: 4
memory: 4Gi
requests:
cpu: 2
memory: 4Gi
image:
repository: "镜像地址"
tag: "版本号"
pullPolicy: Always
service:
name: api-server
port: 8088
targetPort: 8088
nodePort: 32090
protocol: TCP
type: NodePort
# 容器内挂载目录
volumeMounts:
name_springboot_conf: springboot-conf
mountPath: /config
# 要挂载的本地目录
volumes:
name_springboot_conf: springboot-conf
hostPath:
# 写成这样挂载失败
# path: /home/api-server/conf
# 解决办法
path: /var/lib/docker/logs/api-server/conf
更多推荐
已为社区贡献3条内容
所有评论(0)