Skip to content

Question: How to nest patches in overlays at different levels? #5989

@romancin

Description

@romancin

Hi! We are implementing right now deploying on different environments and regions using kustomize + Argo CD, but we are struggling when trying to nest patches as part of the overlay structure:

❯ tree .
.
├── base-app
│   ├── analysis-template-errors.yml
│   ├── deployment.yml
│   ├── hpa.yml
│   ├── kustomization.yml
│   ├── rollout.yml
│   ├── service.yml
│   └── values-test-chart.yml
└── overlays
    ├── dev
    │   ├── kustomization.yml
    │   └── regions
    │       ├── europe-west1
    │       │   └── kustomization.yml
    │       └── us-central1
    │           └── kustomization.yml
    └── prd
        ├── kustomization.yml
        └── regions
            ├── europe-west1
            │   └── kustomization.yml
            └── us-central1
                └── kustomization.yml

What we want to achieve is change some parameters by environment (like adding some labels and setting the namespace), and then override some of them by region.
When trying to build a region, we have an error:

kustomize build overlays/prd/regions/europe-west1
Error: accumulating resources: accumulation err='accumulating resources from '../../../prd': '/Users/XXX/DeveloperCorner/XX/deploy/overlays/prd' must resolve to a file': cycle detected: candidate root '/Users/XXX/DeveloperCorner/XX/deploy/overlays/prd' contains visited root '/Users/XXX/DeveloperCorner/XX/deploy/overlays/prd/validation/europe-west1'

Is this achivable?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-kindIndicates a PR lacks a `kind/foo` label and requires one.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions