【问题标题】:Directory not created after defining the mounting path for the configMap in a Deployment yaml在部署 yaml 中定义 configMap 的挂载路径后未创建目录
【发布时间】:2018-09-19 22:46:05
【问题描述】:

标题

我试图在 Kubernetes 工件的部署 yaml 中添加一个用于挂载 configMap 的目录。虽然我在容器中定义了卷和挂载路径,但在 pod exec 中,我找不到目录?

我的部署文件如下所示:

apiVersion: v1
kind: Deployment
metadata:
  name: test-deployment
  namespace: test
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: reactor
    spec:
      containers:
      - name: reactor
        image: test/chain
        imagePullPolicy: Always
        volumeMounts:
        - mountPath: /test
          name: chaindata
        ports:
        - containerPort: 3003
      volumes:
      - configMap:
          name: chaindata
          defaultMode: 420
        name: chaindata

【问题讨论】:

  • 您好,可以添加部署文件吗?
  • 你好,我的部署文件是上面的样子

标签: node.js kubernetes yaml


【解决方案1】:

我发现我的错误,我实际上指向我的应用程序目录,但该目录已经在根文件夹中创建。 因此,我已将部署文件中的 Mountpath 从 /test 更改为 src/lib/app/functionchain

感谢关心

【讨论】:

    猜你喜欢
    • 2020-07-24
    • 1970-01-01
    • 1970-01-01
    • 2021-09-08
    • 1970-01-01
    • 2020-08-30
    • 1970-01-01
    • 2021-03-16
    • 1970-01-01
    相关资源
    最近更新 更多