0

标题。我让 Kong 与 Kubernetes Ingress Controller 一起运行。我已经有一个可用的自定义插件。我尝试将迁移文件夹添加到我的插件文件中,其中包含适当的迁移,但子目录被忽略kubectl create configmap并且 -R 标志不起作用。

4

1 回答 1

0

不幸的是,目前不支持此功能。解决此限制的方法是在 YAML 中创建一个卷,以便为您在子文件夹中的文件定义路径,如下所示:

apiVersion: v1
kind: ConfigMap
metadata:
   name: testconfig
data:
  file1: |
    This is file1
  file2: |
    This is file2 in subdir directory
---

然后在 YAML 的卷部分中,您将使用文件名指定文件的路径

  volumes:
    - name: config-volume
      configMap:
        name: testconfig
        items:
        - key: file2
          path: subdir/file2
        - key: file1
          path: file1

您可以使用 initContainers 和 emptyDir 挂载来执行此操作,方法是将信息从 initContainer 传递到应用程序,如此处所述

于 2021-06-29T14:08:06.463 回答