Repository Setup¶
The section below describes how the repositories have been set to handle multiple environments and teams with Flux V2.
There are different ways of structuring repositories as described in the Flux documentation.
Key considerations¶
- Teams will deliver new features and bug fixes using trunk-based development
- A new application repository will be created for each service/application
- The repository structure should support multi-tenancy
Repositories¶
Two repositories were created to ensure the separation of core infrastructure and application deployments and manifests.
Repository | Purpose |
---|---|
adp-flux-core | This will be the main repository used for configuring GitOps.`` It will contain the manifests to deploy the core services to the AKS Cluster e.g. for secrets management |
adp-flux-services | This is a secondary repository that will be referenced by GitRepositories from the main repository adp-flux-core |
adp-flux-core structure¶
The adp-flux-core contains the following top directories
- clusters directory contains the Flux configuration per cluster.
- infra directory contains the environment subfolders each containing base and overlays folders. Overlays are used to minimise duplication.
Kustomizations
are used to deploy the core services, such as Nginx Plus. The base folder for each environment will contain a list of the core services defined in thecore
folder that should be deployed for a specific environment. Folders 01/02 represent cluster instances within an environment. These overlay folders 01/02 contain environment specific Kustomize patches that contain the environment specific settings. - Core folder contains the Flux configurations (
HelmRepository
andHelmRelease
) CRD manifests used for installing the core services - Services folder contains a
GitRepository
and Kustomization per environment that points to a path in the adp-flux-services repository. For example, theKustomization
forsnd/01
will to point to the pathservices/environments/snd/01
in the adp-flux-services repository.
You can use the markdown generator tool to update the above folder structure
adp-flux-services structure¶
The adp-flux-core contains the following top directories
- services directory contains the Flux configurations used for deploying the business applications.
Tenants¶
- Tenants refers to the application teams that are responsible for the development of one or more business applications.
- A unique namespace will be created for each tenant
- All applications owned by a specific tenant on the ADP platform will be deployed to the same tenant namespace
Below is a description of the subfolders inside the services folder.
Subfolder | Purpose |
---|---|
base | the base folder contains manifests that are common to each tenant e.g. namespace, ResourceQuota and ServiceAccount. These manifests are generic, in that they have variables that can be specified at the time of onboarding. |
environments | This contains the environment subfolders each containing base and overlays folders. Overlays are used to minimise duplication.Kustomizations are used to deploy the business services |
tenants | These are the application teams |
You can use the markdown generator tool to update the above folder structure