How to manage union manifest using GitOps approach?¶
The manifest custom resources resides in solution flux repository under /products/apps/nonprod/manifest for non-prod environments.
In order to make a change, clone this repo, create a feature branch and submit a pull request with your changes.
Follow the steps below to manage the union manifest using GitOps approach:
Add a new product¶
- For a given union environment, add a new directory inside the
manifests/<env>/directory. The name of this new directory should be the product name. For example, in order to addedmcinside the unionDEVenvironment, the directory should look likemanifests/dev/edmc/.
- Once a directory is created, add
product.yamlfile for the product data inline with product CRD.
- Next create a new directory inside the product directory called
/envsto store yaml files for all environments for the product.
- Add one yaml file per env under
/envs/directory. For example, foredmcit could be:manifests/dev/edmc/envs/dev.yaml,manifests/dev/edmc/envs/uat.yaml, so on..
- Add the environment data inline with product environment CRD.
- Add
kustomization.yamlfile under the product directory and add all other files to it. For example:
1 2 3 4 5 6 | |
- Go to the root
kustomization.yamlfile and add the new product to it. For example this file for union DEV env:
1 2 3 4 5 6 | |
Change existing product¶
- Update the product or product env files, add/remove/change env yaml files.
- Change
kustomization.yamlat the product root if required. - Submit a pull request
Delete a product¶
- Remove the product directory
- Remove product from
kustomization.yamlat the manifest env root. - Submit a pull request
Add/remove env from a product¶
- Add/remove/change env yaml files.
- Change
kustomization.yamlat the product root if required. - Submit a pull request
Add a new union env¶
In order to add new union env, for example union UAT env, simply copy-paste the /products/apps/nonprod/manifest/dev directory, make changes to the products, update kustomization.yaml at the manifest env root and submit a pull request.
1 2 3 4 5 6 7 8 9 10 | |
What happens after the pull request for all above cases is merged?¶
When a pull request is merged for any of the case above, given the yaml files are valid and custom resources are inline with the custom resource definitions, the flux will take care of deployment into the cluster. Once manifests are deployed inside the cluster, the manifest custom operator will update it’s in-memory storage.
Union UI will start receiving newer version of the manifest on refresh.
*Might require CTRL+F5 to get newer version of the manifests. This needs to be tested.