解决办法

# 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
Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐