Skip to content

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 add edmc inside the union DEV environment, the directory should look like manifests/dev/edmc/.
  • Once a directory is created, add product.yaml file for the product data inline with product CRD.
  • Next create a new directory inside the product directory called /envs to store yaml files for all environments for the product.
  • Add one yaml file per env under /envs/ directory. For example, for edmc it could be: manifests/dev/edmc/envs/dev.yaml, manifests/dev/edmc/envs/uat.yaml, so on..
  • Add kustomization.yaml file under the product directory and add all other files to it. For example:
1
2
3
4
5
6
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- product.yaml
- envs/dev.yaml
- envs/uat.yaml
1
2
3
4
5
6
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- compliance
- ilevel
- edmc

Change existing product

  • Update the product or product env files, add/remove/change env yaml files.
  • Change kustomization.yaml at the product root if required.
  • Submit a pull request

Delete a product

  • Remove the product directory
  • Remove product from kustomization.yaml at the manifest env root.
  • Submit a pull request

Add/remove env from a product

  • Add/remove/change env yaml files.
  • Change kustomization.yaml at 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
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- featurehub.yaml
- union-api-dev.yaml
- union-ui-dev.yaml
...
- manifests/dev
- manifests/uat
- manifests/new-env

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.