Skip to content

Commit

Permalink
Add note on namespace management in GitOps example (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasBabin authored Nov 5, 2024
1 parent 14c6f83 commit e138e11
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions resource-definitions/k8s-cluster-git/runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ This section contains example Resource Definitions for connecting to a Git repos
It also provides a solution to specify the non GitOps-cluster where the GitOps deploys workloads.
To retrieve the status of deployed workloads, the Orchestrator searches for a `k8s-cluster` Resource with the Id `k8s-cluster-runtime`. If it doesn't find this resource, it defaults to the `k8s-cluster` resource with the Id `k8s-cluster`. When the default cluster is a GitOps-managed cluster, an additional non-GitOps cluster is required to gather runtime information for workloads deployed by the GitOps operator. This example demonstrates that process.

The namespace name where the Orchestrator will look for the Kubernetes objects to gather runtime information is retrieved from the Active Resource of type `k8s-namespace`. Note that in GitOps mode, the namespace is an externally managed Resource, i.e. the Platform Orchestrator does not create the namespace. It is recommended to use a namespace Resource Definition based on the [Echo Driver](https://developer.humanitec.com/integration-and-extensions/drivers/generic-drivers/echo/) to reflect this fact. This also means that any customization of the namespace, such as adding specific labels, must be managed externally.

The chart illustrates the setup. Because `k8s-cluster` is an [_implicit_ Resource Type](https://developer.humanitec.com/platform-orchestrator/reference/resource-types/#resource-type-use), one such Resource is always matched for any Deployment. This creates the Resource representing the GitOps cluster, using the `k8s-cluster-git` Driver. That resource co-provisions another Resource of type `k8s-cluster` with the Id `k8s-cluster-runtime` and the `k8s-cluster-gke` Driver, representing the runtime cluster.

```mermaid
Expand Down

0 comments on commit e138e11

Please sign in to comment.