What is going on here ?
This is to solve a problem where it is required to dynamically vary/repeat the number of generated manifests for each of the otherwise quite similar dev, qa, staging, prod environments.
An environment is usually a set of workloads, e.g microservices, e.g antivirus, ocr and other components that are able to scale horizontally and service the complete environment. But what if we for a given environment want to also run a n-times repeated set of "customer installation" sets as well.
As an example, we might need to run N instances of a legacy application server (HelmRelease), so we want to define this helmrelease manifest just once, and then specify only the small configuration differences for each of needed instances.
This turns out to be an uneasy scenario to solve with Kustomize, because kustomizations is based on overlays that targets base manifests using specific (kind,namespace,name) coordinates, and for defining our N sets of "customer installations" we must vary the name part of the coordinates for each.
Managing a gitrepo for fluxd
The repo structure is for the initial empty state
└── releases
|—— .flux.yaml
└── environments
└── basetemplates
The releases folder is meant to be configured as the fluxcd --git-path=releases argument along with --manifest-generation=true
The environments directory is to be populated with subdirectories defining an instance of our workloads. Each subdirectory is to contain an editable copy of the root templates folder, and by editing these templates it will directly affect everything that is generator based on these templates.
The basetemplates folder is for base templates, editing these templates will only affect new instances, as nothing is directly generated from the base templates
Populating the basetemplates
The basetemplates are directories with sets of template files, e.g kubernetes yaml manifest files meant for jinja2 template processing
e.g.
└── basetemplates
└── SET1
|── template1.yaml
|── template2.yaml
└── SET2
|── template1.yaml
|── template2.yaml
Create a new workload configuration in the environments folder
An environment instance is expressed as subfolder in the environements folder, containing
- A snapshot copy of the basetemplates. E.g
cp -r basetemplates environments/NAME - folder
generatorconfigswith the.yamlfiles withgeneratorconfigmanifests
└── environments
└── NAME
└── templates
└── SET1
|── template1.yaml
|── template2.yaml
└── SET2
|── template1.yaml
|── template2.yaml
└── generatorconfigs
|── SET1-a-generatorconfig.yaml
|── SET2-b-generatorconfig.yaml
|── SET2-c-generatorconfig.yaml
|── SET2-d-generatorconfig.yaml
The generatorconfig format
The format is meant to be basically just properties, meaning pure configuration without much structure structure.
generatorconfigversion: 1
templateset: SET2
id: set2-a
import_substitution_parameters:
- set1
substitution_parameters:
NAME1: VALUE
NAME2: VALUE
overrides:
- manifest:
kind: MFKIND
namespace: MFNAMESPACE
name: MFNAME
values:
PATH: OVERRIDE
There are 2 mandatory parts:
- generatorconfigversion : must be 1
- templateset : pointer to template set directory for the environment, e.g SET2
The rest is optional:
- id: is optional, only useful if other generatorconfig needs to reference this config
- import_substitution_parameters: List of generatorconfig ids to import substitution parameters from. Each of the imported parameters can be overridden
- substitution_parameters: is the parameters for jinja2 templating of the templates
- overrides: Use it to override anything in the generated manifests. The section is a list with:
- manifest: Optional if there is just 1 manifest in the template SET, otherwise the manifest (kind,namespace,name) coordinates
- values: yaml to override anything in the jinja2 generated manifests
Metadata
Release files for nmanifest 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nmanifest-0.0.2.tar.gz | 5.1 kB | Without provenance | Details for nmanifest-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nmanifest-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for nmanifest-0.0.2-py3-none-any.whl |
Total release size: 11.0 kB
Release files / nmanifest-0.0.2.tar.gz
| Download URL | nmanifest-0.0.2.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ea668e27f89722e5e4400323f6dc328889520b2d48b307c8d181499b192fd561
|
|
BLAKE2b-256 checksum How to use checksums |
f0b9c2dc4ad32639942b2d5c792ad518da262e161396f879cb768d55a3c28090
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.5.2
|
Release files / nmanifest-0.0.2-py3-none-any.whl
| Download URL | nmanifest-0.0.2-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a1c95f6ac59540956856aa6730ccfa70b164bd085ceb000508aaad923b6496cf
|
|
BLAKE2b-256 checksum How to use checksums |
62a8ced8f78fbd3e17ec6bdde5c482a31eb2474fdc3e05b6ba7ad74b50641f3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.5.2
|
Security for nmanifest 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.