Skip to content

Commit 205060b

Browse files
committed
oke-gitops-1.1.3
1 parent 188e3b4 commit 205060b

11 files changed

Lines changed: 96 additions & 6 deletions

File tree

app-dev/devops-and-containers/oke/oke-gitops/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ This stack will:
139139
* Create 2 OCI Code Repositories: one with pipelines definitions, and another one called "oke-cluster-config" with the git template for the OKE cluster administrators
140140
* Create an OCI Build Pipeline that will mirror the ArgoCD Helm Chart inside the Oracle Cloud Registry, and deploy it in the chosen cluster
141141

142-
[![Deploy to Oracle Cloud](https://oci-resourcemanager-plugin.plugins.oci.oraclecloud.com/latest/deploy-to-oracle-cloud.svg)](https://cloud.oracle.com/resourcemanager/stacks/create?zipUrl=https://github.com/oracle-devrel/technology-engineering/releases/download/oke-gitops-1.1.2/stack.zip)
142+
[![Deploy to Oracle Cloud](https://oci-resourcemanager-plugin.plugins.oci.oraclecloud.com/latest/deploy-to-oracle-cloud.svg)](https://cloud.oracle.com/resourcemanager/stacks/create?zipUrl=https://github.com/oracle-devrel/technology-engineering/releases/download/oke-gitops-1.1.3/stack.zip)
143143

144144
Once the stack has been provisioned, you can modify the ArgoCD version to deploy by editing the `mirror_argo.yaml` file in the `pipelines` repository.
145145
By default, ArgoCD will be deployed in an "insecure" mode to disable the default SSL certificate, but feel free to modify the chart values in the `argo-cd-chart-values` artifact.

app-dev/devops-and-containers/oke/oke-gitops/repos/system-cluster-config/README.md

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,55 @@ system-cluster-config/
8686
│ └── infra.yml # ApplicationSet for infrastructure apps
8787
└── infra/ # Cluster-level infrastructure resources
8888
├── base/ # Base kustomize resources (quotas, namespaces, etc.)
89-
└── overlays/ # Profile-specific overlays (e.g., hub/)
89+
└── overlays/ # Profile-specific overlays
90+
└── hub/ # Hub cluster infrastructure
91+
├── common/ # Resources common to all namespaces (RBAC, configmaps)
92+
├── namespaces/ # Namespace-specific resources
93+
│ └── dev-team/ # Example namespace (dev-team)
94+
└── kustomization.yaml # Main overlay combining all resources
9095
```
9196

9297
### Infrastructure Folder
9398

94-
The `infra/` folder contains cluster-level resources deployed via Kustomize, similar to application structures. It includes base resources and profile-specific overlays.
99+
The `infra/` folder manages cluster-level infrastructure resources using a **3-tier hierarchical structure** deployed via Kustomize. This approach provides clear separation of concerns and promotes reusability across namespaces.
95100

96-
- **Base Resources**: Common cluster resources like ResourceQuotas, Namespaces, PersistentVolumeClaims, ValidatingAdmissionPolicies, etc.
97-
- **Overlays**: Customizations per profile (e.g., `overlays/hub/` for hub-specific infra).
101+
#### 3-Tier Structure Explained
98102

99-
This ensures foundational cluster configurations are managed consistently across profiles.
103+
**1. Base Layer (`infra/base/`)**
104+
- Contains **global cluster resources** that apply to the entire cluster
105+
- Examples: ResourceQuotas, PersistentVolumeClaims, ValidatingAdmissionPolicies, cluster-wide ConfigMaps
106+
- These resources are shared across all namespaces and profiles
107+
108+
**2. Common Layer (`infra/overlays/hub/common/`)**
109+
- Contains **cross-namespace resources** shared by multiple namespaces
110+
- Examples: RBAC roles/cluster roles, shared ConfigMaps, NetworkPolicies that apply to multiple namespaces
111+
- These resources are applied to all namespaces within a profile (e.g., hub)
112+
113+
**3. Namespace Layer (`infra/overlays/hub/namespaces/dev-team/`)**
114+
- Contains **namespace-specific resources**
115+
- Examples: Namespace definitions, namespace-scoped RBAC, namespace-specific quotas
116+
- Each namespace gets its own folder following the pattern `namespaces/<namespace-name>/`
117+
118+
#### How It Works
119+
120+
The main overlay (`infra/overlays/hub/kustomization.yaml`) combines all layers:
121+
1. **First**: Imports base resources (global scope)
122+
2. **Then**: Includes namespace-specific configurations, which automatically include common resources
123+
124+
This hierarchical approach ensures:
125+
- **DRY Principle**: Common resources aren't duplicated
126+
- **Scalability**: Easy to add new namespaces following the same pattern
127+
- **Maintainability**: Clear organization makes it easy to find and modify resources
128+
- **Consistency**: Base and common resources are applied uniformly across the cluster
129+
130+
#### Example Workflow
131+
132+
When deploying infrastructure to a hub cluster:
133+
1. Base resources (quotas, PVCs) are applied cluster-wide
134+
2. Common resources (shared RBAC, configmaps) are applied to all namespaces
135+
3. Namespace-specific resources (namespace definition, local RBAC) are applied to each namespace
136+
137+
This structure provides a solid foundation for managing complex multi-tenant Kubernetes clusters.
100138

101139
### Workflow
102140

app-dev/devops-and-containers/oke/oke-gitops/repos/system-cluster-config/apps/network/traefik/helm/values/hub/values-additional-service-public-flannel.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ service:
4040
# Set listener to HTTP if you want to use WAF, otherwise TCP
4141
service.beta.kubernetes.io/oci-load-balancer-backend-protocol: "HTTP"
4242

43+
# A HTTP listener will automatically put the x-forwarded-for header with the real IP address, but not the TCP listener.
44+
#service.beta.kubernetes.io/oci-load-balancer-connection-proxy-protocol-version: "2"
45+
4346
# MUST specify a public subnet where to create the LB
4447
service.beta.kubernetes.io/oci-load-balancer-subnet1: "<subnet-OCID>"
4548

app-dev/devops-and-containers/oke/oke-gitops/repos/system-cluster-config/apps/network/traefik/helm/values/hub/values-additional-service-public-vcn-native.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ service:
4444
# Set listener to HTTP if you want to use WAF, otherwise TCP
4545
service.beta.kubernetes.io/oci-load-balancer-backend-protocol: "HTTP"
4646

47+
# A HTTP listener will automatically put the x-forwarded-for header with the real IP address, but not the TCP listener. So we need to enable proxy protocol. By default it's disabled here, because we are forced to relay on externalTrafficPolicy: "Cluster"
48+
#service.beta.kubernetes.io/oci-load-balancer-connection-proxy-protocol-version: "2"
49+
4750
# TLS termination. The secret must be present in the traefik namespace. Only 1 certificate is supported, and to rotate you need to create a new secret and modify this annotation
4851
service.beta.kubernetes.io/oci-load-balancer-ssl-ports: "443"
4952
service.beta.kubernetes.io/oci-load-balancer-tls-secret: "ssl-certificate-secret"

app-dev/devops-and-containers/oke/oke-gitops/repos/system-cluster-config/apps/network/traefik/helm/values/hub/values-default-public-flannel.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ service:
4040
# Set listener to HTTP if you want to use WAF, otherwise TCP
4141
service.beta.kubernetes.io/oci-load-balancer-backend-protocol: "HTTP"
4242

43+
# A HTTP listener will automatically put the x-forwarded-for header with the real IP address, but not the TCP listener.
44+
#service.beta.kubernetes.io/oci-load-balancer-connection-proxy-protocol-version: "2"
45+
4346
# If needed, you can specify a public subnet OCID where to create the LB. If not specified, will default to OKE service subnet
4447
#service.beta.kubernetes.io/oci-load-balancer-subnet1: "<subnet-OCID>"
4548

app-dev/devops-and-containers/oke/oke-gitops/repos/system-cluster-config/apps/network/traefik/helm/values/hub/values-default-public-vcn-native.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ service:
5151
# Set listener to HTTP if you want to use WAF, otherwise TCP
5252
service.beta.kubernetes.io/oci-load-balancer-backend-protocol: "HTTP"
5353

54+
# A HTTP listener will automatically put the x-forwarded-for header with the real IP address, but not the TCP listener. So we need to enable proxy protocol. By default it's disabled here, because we are forced to relay on externalTrafficPolicy: "Cluster"
55+
#service.beta.kubernetes.io/oci-load-balancer-connection-proxy-protocol-version: "2"
56+
5457
# TLS termination. The secret must be present in the traefik namespace. Only 1 certificate is supported, and to rotate you need to create a new secret and modify this annotation
5558
service.beta.kubernetes.io/oci-load-balancer-ssl-ports: "443"
5659
service.beta.kubernetes.io/oci-load-balancer-tls-secret: "ssl-certificate-secret"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
# Global resources to be deployed cluster wide
5+
#resources:
6+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
5+
# Include resources that should be common for all namespaces
6+
#resources:
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
# Kustomization to configure all namespaces from a system administrator perspective
5+
6+
resources:
7+
# Import global resources and patch them if required
8+
- ../../base
9+
- ./namespaces/dev-team
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
# Namespace specific resources
5+
resources:
6+
# Import common resources for all namespaces and patch them, if needed
7+
- ../../common
8+
- namespace.yml
9+
10+
# Ensure that all resources are deployed in the right namespcae
11+
namespace: dev-team

0 commit comments

Comments
 (0)