This repo contains a collection of infrastructure examples using Kubernetes Config Connector. Follow Config Connector Setup steps and then try any of the following examples:
- WordPress on K8s + GCP CloudSQL + Workload Identity Setup
- WordPress on K8s + GCP Cloud SQL + WI + Gatekeeper + ACM
- Multi-cluster ingress
- Gatekeeper integration
- Multiple Team Namespace-Project Configuration
- GCR image pull permissions from exernal K8s cluster with Config Connector
-
Authenticate to GCP
gcloud auth application-default login
-
Create project and cluster with Config Connector enabled:
cd ./tf-provision terraform apply -var="project=PROJECT_ID" \ -var="folder_id=FOLDER_ID" \ -var="billing_account=BILLING_ACCOUNT" cd ..
Note
project_id
output variable and use it in the next steps:PROJECT_ID=[project_id]
-
Set the context
gcloud config set project $PROJECT_ID gcloud container clusters get-credentials cluster-1 --zone=us-central1-b
-
Install Config Connector resource and annotate the namespace that you will use for Config Connector resources:
# we need to ensure that only instance of config-connector resource exists per cluster kubectl delete configconnector.core.cnrm.cloud.google.com --all # customize and install with helm: helm install ./config-connector-resource/. --set projectID=$PROJECT_ID --generate-name kubectl annotate namespace default cnrm.cloud.google.com/project-id=$PROJECT_ID
-
Verify that Config Connector is functional:
kubectl wait -n cnrm-system --for=condition=Ready pod --all