Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create same subfolder structure from inventory folder in compiled folder #932

Closed
gburiola opened this issue Jan 27, 2023 · 0 comments · Fixed by #933
Closed

Create same subfolder structure from inventory folder in compiled folder #932

gburiola opened this issue Jan 27, 2023 · 0 comments · Fixed by #933

Comments

@gburiola
Copy link
Contributor

gburiola commented Jan 27, 2023

More details in this slack conversation

We manage multiple k8s clusters (prod, test, etc) and each team can have one or more namespaces.
Namespaces will usually be the same on all clusters. For example, team1 has a namespace called team1-backend and team1-frontend on both the test and the prod cluster.

In our kapitan configuration, each k8s namespace in a cluster would be a target.

Ideally we would like to have an inventory structure like this:

inventory/
├── prod
│   ├── team1
│   │   ├── team1-backend.yaml
│   │   └── team1-frontend.yaml
│   └── team2
│       ├── team2-backend.yaml
│       └── team2-frontend.yaml
└── test
    ├── team1
    │   ├── team1-backend.yaml
    │   └── team1-frontend.yaml
    └── team2
        ├── team2-backend.yaml
        └── team2-frontend.yaml

and a compiled folder like this:

compiled/
├── prod
│   ├── team1
│   │   ├── team1-backend
│   │   │   ├── k8s-configmap.yaml
│   │   │   └── k8s-deployment.yaml
│   │   └── team1-frontend
│   │       ├── k8s-configmap.yaml
│   │       └── k8s-deployment.yaml
│   └── team2
│       ├── team2-backend
│       │   ├── k8s-configmap.yaml
│       │   └── k8s-deployment.yaml
│       └── team2-frontend
│           ├── k8s-configmap.yaml
│           └── k8s-deployment.yaml
└── test
    ├── team1
    │   ├── team1-backend
    │   │   ├── k8s-configmap.yaml
    │   │   └── k8s-deployment.yaml
    │   └── team1-frontend
    │       ├── k8s-configmap.yaml
    │       └── k8s-deployment.yaml
    └── team2
        ├── team2-backend
        │   ├── k8s-configmap.yaml
        │   └── k8s-deployment.yaml
        └── team2-frontend
            ├── k8s-configmap.yaml
            └── k8s-deployment.yaml

this way each team has their own configs in a subfolder they care about

It's also clear if something is for prod or test cluster.

And then when it comes to deploy everything to a cluster, I can just kubectl apply everything inside compiled/test or compiled/prod

I'm aware of the kapitan output_path config. However, that applies to paths AFTER the target folder.
What I want to do is to have a structure BEFORE the target folder. Between compiled folder and target folder.

This should also be combined with inventory/reclass-config.yaml option:

compose_node_name: true

More info about this flag here.

gburiola added a commit that referenced this issue Jan 29, 2023
gburiola added a commit that referenced this issue Feb 2, 2023
gburiola added a commit that referenced this issue Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant