Skip to content

Commit

Permalink
feat: new repo structure to support kubernetes resources (#2)
Browse files Browse the repository at this point in the history
* feat: new repo structure to support kubernetes resources

* adding bookmarks

* adressing comments
  • Loading branch information
davelanglois-ssc committed Sep 6, 2023
1 parent ffd3bb3 commit df6a705
Show file tree
Hide file tree
Showing 32 changed files with 29 additions and 46 deletions.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,33 @@

A repository that includes YAML manifests. Manifests can define GCP resources in `config connector` format or the Kubernetes components and resources. Refer to this repo for additionnal information. TODO: add link

- The `/*/configcontroller` folder is where GCP resources are defined using their `config connector` schema.
- The `/*/kubernetes/<x-fleet-id>/**/<namespace>` folder is where resources that have to be provisionned in a kubernetes `namespace` are defined. The `x-fleet-id` is the GCP project-id where the kubernetes clusters are deployed with character "x" as the environment code because this folder will contain the configuration for all environments.

The GKE clusters are joined to an [Anthos Fleet](https://cloud.google.com/anthos/fleet-management/docs). This enables Anthos policy controller, Anthos config management and Anthos service mesh(future).

## csync

The `/csync` contains the configuration for what the ConfigSync operator should be observing. For example, It is within this configuration that you specify the `repo url`, the `folder`, the `branch` and the `tag`.

Contributing:
### Contributing

- Any modification should be implemented within the `source-customization` folder.

## tier2

The `/tier2` folder is where the client resources that enables the underneath structure to work. This functionality is also known as the `client` landing zone.

Contributing:
### Contributing

- Any modification should be implemented within the `source-customization` folder.

## Permissions
### Permissions

A pull request affecting `/*` will include the Platform admin as required reviewers.

## Tags

Tags are generated only when changes are affecting the `/tier2` folder. This functionality is possible because of the `version-tagging` pipeline.

The tags will be created by that pipeline job after commits are merge to the `main` branch.
## Branch Protection

### **IMPORTANT**
The main branch of this repository is protected meaning that pushing a new commit to it will be denied. To implement changes, A Pull Request has to be completed.

We recommend using those tags in the `setters-version.yaml` under the `/csync/source-customization` folder to define what has to be observed by the configsync operator.
Every other branches configured to be observed by ConfigSync will also have a branch protection rule defined.
3 changes: 3 additions & 0 deletions csync/tier2/configcontroller/csync-tier2-ctlr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Bookmark

A simple bookmark to help you identify the parent folders
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
info:
description: |
Landing Zone v2 package
A package to setup a git repository root sync
A package to setup a t2 git repository root sync
pipeline:
mutators:
- image: gcr.io/kpt-fn/apply-setters:v0.2
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
apiVersion: configsync.gke.io/v1beta1
kind: RootSync
metadata:
name: id-folder # kpt-set: ${id}-${folder}
name: id-t2 # kpt-set: ${id}-t2
namespace: config-management-system
spec:
sourceFormat: unstructured
git:
repo: https://AZDO-ORG@dev.azure.com/AZDO-ORG/AZDO-PROJECT/_git/REPO-NAME # kpt-set: ${repo-url}
branch: main # kpt-set: ${repo-branch}
dir: deploy/env # kpt-set: ${repo-dir}
dir: tier2/configcontroller/deploy/<env> # kpt-set: ${repo-dir}
revision: HEAD # kpt-set: ${version}
auth: token
secretRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,11 @@ metadata:
config.kubernetes.io/local-config: 'true'
data:
# Used for naming of the root-sync
## id :
### tier1: 'experimentation' or 'env'
### tier2: [client-name]
### tier34: [project-id] (we replace environment code with “x”)
id: client-name
## Folder: 'csync' or 'tier1' or 'tier2'
## 'tier3' or 'tier4' are used only with RepoSync
folder: tier2
## id is the client-name
id: <client-name>

# Git repo values
repo-url: https://AZDO-ORG@dev.azure.com/AZDO-ORG/AZDO-PROJECT/_git/REPO-NAME
# repo-url: https://github.com/GITHUB-ORG/REPO-NAME # Alternate, GitHub
repo-branch: main
repo-dir: tier2/deploy/preprod
repo-dir: tier2/configcontroller/deploy/<env>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,11 @@ metadata:
config.kubernetes.io/local-config: 'true'
data:
# Used for naming of the root-sync
## id :
### tier1: 'experimentation' or 'env'
### tier2: [client-name]
### tier34: [project-id] (we replace environment code with “x”)
## id is the client-name
id: client-name
## Folder: 'csync' or 'tier1' or 'tier2'
## 'tier3' or 'tier4' are used only with RepoSync
folder: tier2

# Git repo values
repo-url: https://AZDO-ORG@dev.azure.com/AZDO-ORG/AZDO-PROJECT/_git/REPO-NAME
# repo-url: https://github.com/GITHUB-ORG/REPO-NAME # Alternate, GitHub
repo-branch: main
repo-dir: tier2/deploy/env
repo-dir: tier2/configcontroller/deploy/dev
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,11 @@ metadata:
config.kubernetes.io/local-config: 'true'
data:
# Used for naming of the root-sync
## id :
### tier1: 'experimentation' or 'env'
### tier2: [client-name]
### tier34: [project-id] (we replace environment code with “x”)
## id is the client-name
id: client-name
## Folder: 'csync' or 'tier1' or 'tier2'
## 'tier3' or 'tier4' are used only with RepoSync
folder: tier2

# Git repo values
repo-url: https://AZDO-ORG@dev.azure.com/AZDO-ORG/AZDO-PROJECT/_git/REPO-NAME
# repo-url: https://github.com/GITHUB-ORG/REPO-NAME # Alternate, GitHub
repo-branch: main
repo-dir: tier2/deploy/dev
repo-dir: tier2/configcontroller/deploy/preprod
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,11 @@ metadata:
config.kubernetes.io/local-config: 'true'
data:
# Used for naming of the root-sync
## id :
### tier1: 'experimentation' or 'env'
### tier2: [client-name]
### tier34: [project-id] (we replace environment code with “x”)
## id is the client-name
id: client-name
## Folder: 'csync' or 'tier1' or 'tier2'
## 'tier3' or 'tier4' are used only with RepoSync
folder: tier2

# Git repo values
repo-url: https://AZDO-ORG@dev.azure.com/AZDO-ORG/AZDO-PROJECT/_git/REPO-NAME
# repo-url: https://github.com/GITHUB-ORG/REPO-NAME # Alternate, GitHub
repo-branch: main
repo-dir: tier2/deploy/prod
repo-dir: tier2/configcontroller/deploy/prod
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
3 changes: 3 additions & 0 deletions tier2/configcontroller/tier2-ctlr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Bookmark

A simple bookmark to help you identify the parent folders
Empty file added tier2/kubernetes/.gitkeep
Empty file.

0 comments on commit df6a705

Please sign in to comment.