GCP Config Connector

Declarative GCP resource management via Kubernetes

Config Connector enables managing GCP resources declaratively through Kubernetes custom resources. The Infra Management Cluster runs the Config Connector operator and manages resources for multiple GCP projects.

ArgoCD Resources

ApplicationNamespacePurpose
config-connector-operatorargocdThe Config Connector operator
tb-platform-infraargocdCross-environment GCP resources
infra-mgmt-projectargocdInfra management GCP project
infra-mgmt-vpc-projectargocdVPC project resources
infra-security-projectargocdSecurity project resources

File Paths

ApplicationFile
config-connector-operator, tb-platform-infraapps/config-connector.yaml
infra-mgmt-projectapps/infra-mgmt-project.yaml
infra-mgmt-vpc-projectapps/infra-mgmt-vpc-project.yaml
infra-security-projectapps/infra-security-project.yaml

Config Connector Operator

The operator watches for ConfigConnectorContext resources and creates controllers to manage GCP resources.

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: config-connector-operator
spec:
  syncPolicy:
    automated:
      prune: false
  destination:
    namespace: argocd
    server: https://kubernetes.default.svc
  project: infra-services
  source:
    path: k8s/infra-services/gcp-config-connector
    repoURL: https://github.com/Titanbay/infra-services
    targetRevision: 'main'

Source: k8s/infra-services/gcp-config-connector/

TB Platform Infrastructure

Cross-environment GCP resources for the tb-platform projects.

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: tb-platform-infra
spec:
  syncPolicy:
    automated:
      prune: true
    syncOptions:
      - ServerSideApply=true
  destination:
    namespace: argocd
    server: https://kubernetes.default.svc
  project: infra-services
  source:
    repoURL: https://github.com/Titanbay/infra-services
    path: k8s/tb-platform-infra
    targetRevision: 'main'

Source Structure:

k8s/tb-platform-infra/
├── base/                    # Shared resources
├── env/                     # Per-environment resources
│   ├── base/
│   ├── dev/
│   ├── qa/
│   └── prod/
└── vpc/                     # VPC-related resources
    ├── base/
    ├── dev/
    ├── qa/
    └── prod/

Infra Management Project

GCP resources for the main infrastructure management project.

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: infra-mgmt-project
spec:
  syncPolicy:
    syncOptions:
      - ServerSideApply=true
  destination:
    namespace: argocd
    server: https://kubernetes.default.svc
  project: infra-mgmt
  source:
    repoURL: https://github.com/Titanbay/infra-services
    path: k8s/infra-services/tb-infra-mgmt-project
    targetRevision: 'main'

Source: k8s/infra-services/tb-infra-mgmt-project/

Infra Management VPC Project

VPC-related GCP resources.

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: infra-mgmt-vpc-project
spec:
  syncPolicy:
    automated:
      prune: true
    syncOptions:
      - ServerSideApply=true
  destination:
    namespace: argocd
    server: https://kubernetes.default.svc
  project: infra-mgmt
  source:
    repoURL: https://github.com/Titanbay/infra-services
    path: k8s/infra-services/tb-infra-mgmt-vpc-project
    targetRevision: 'main'

Source: k8s/infra-services/tb-infra-mgmt-vpc-project/

Infra Security Project

Security-related GCP resources.

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: infra-security-project
spec:
  syncPolicy:
    syncOptions:
      - ServerSideApply=true
  destination:
    namespace: argocd
    server: https://kubernetes.default.svc
  project: infra-mgmt
  source:
    repoURL: https://github.com/Titanbay/infra-services
    path: k8s/infra-services/tb-infra-security-project
    targetRevision: 'main'

Source: k8s/infra-services/tb-infra-security-project/

Source Structure

k8s/infra-services/
├── gcp-config-connector/           # Config Connector operator
├── tb-infra-mgmt-project/          # Infra mgmt project resources
├── tb-infra-mgmt-vpc-project/      # VPC project resources
└── tb-infra-security-project/      # Security project resources

k8s/tb-platform-infra/              # Platform infrastructure
├── base/
├── env/
│   ├── dev/
│   ├── qa/
│   └── prod/
└── vpc/
    ├── dev/
    ├── qa/
    └── prod/

AppProjects

Config Connector applications use specific AppProjects:

ApplicationProject
config-connector-operatorinfra-services
tb-platform-infrainfra-services
infra-mgmt-projectinfra-mgmt
infra-mgmt-vpc-projectinfra-mgmt
infra-security-projectinfra-mgmt

How to Update

Adding GCP Resources

  1. Create the Config Connector resource YAML in the appropriate directory
  2. Add to the directory’s kustomization.yaml
  3. Commit and push to main
  4. ArgoCD syncs and Config Connector creates the GCP resource

Modifying Resources

  1. Edit the resource YAML
  2. Commit and push to main
  3. Config Connector reconciles the change in GCP

Sync Options

All Config Connector applications use ServerSideApply=true because:

  • Config Connector resources often have large specs
  • Server-side apply handles field ownership correctly
  • Prevents conflicts with Config Connector’s own updates

For tb-platform clusters, Config Connector is also deployed via ApplicationSet:

ApplicationSetPurpose
tb-platform-config-connector-operatorDeploys operator to tb-platform clusters
tb-platform-environmentsGenerates apps for k8s/tb-platform-infra/env/*
tb-platform-vpc-configGenerates apps for k8s/tb-platform-infra/vpc/*

See TB Platform Config Connector for details.