【问题标题】:Is there a way to add new Resources with Kustomize (as opposed to overlaying them)?有没有办法使用 Kustomize 添加新资源(而不是覆盖它们)?
【发布时间】:2019-04-28 12:36:38
【问题描述】:

使用kubectl apply -k,您可以覆盖Resource 配置(您已经定义)。你也可以创建资源吗?

在我的具体情况下,我想为开发环境创建一个local Volume。我在基本文件夹中没有这个资源。

我的文件夹结构是这样的:

~/someApp
├── base
│   ├── deployment.yaml
│   ├── kustomization.yaml
│   └── service.yaml
└── overlays
    ├── development
    │   ├── cpu_count.yaml
    │   ├── kustomization.yaml
    │   ├── replica_count.yaml
    │   └── volume.yaml <--- *Is this possible*?
    └── production
        ├── cpu_count.yaml
        ├── kustomization.yaml
        └── replica_count.yaml

【问题讨论】:

    标签: kubernetes templating kustomize


    【解决方案1】:

    您可以在overlays/development/kustomization.yaml 中添加:

    resources:
      - volume.yaml
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-04-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多