/k8s-config-connector

GCP Config Connector, a Kubernetes add-on for managing GCP resources

Primary LanguageGoApache License 2.0Apache-2.0

GCP Config Connector

Config Connector is a Kubernetes add-on that allows customers to manage GCP resources, such as Cloud Spanner or Cloud Storage, through your cluster's API.

With Config Connector, now you can describe GCP resources declaratively using Kubernetes-style configuration. Config Connector will create any new GCP resources and update any existing ones to the state specified by your configuration, and continuously makes sure GCP is kept in sync. The same resource model is the basis of Istio, Knative, Kubernetes, and the Google Cloud Services Platform.

As a result, developers can manage their whole application, including both its Kubernetes components as well as any GCP dependencies, using the same configuration, and -- more importantly -- tooling. For example, the same customization or templating tool can be used to manage test vs. production versions of an application across both Kubernetes and GCP.

This repository contains full Config Connector source code. This inlcudes controllers, CRDs, install bundles, and sample resource configurations.

Usage

See https://cloud.google.com/config-connector/docs/overview.

For simple starter examples, see the Resource reference and Cloud Foundation Toolkit Config Connector Solutions.

Building Config Connector

Recommended Operating System

  • Ubuntu (18.04/20.04)
  • Debian (9/10/11)

Software requirements

Set up your environment

Option 1: Set up an environment in a fresh VM (recommended)

  1. Create an Ubuntu 20.04 VM on Google Cloud.

  2. Open an SSH connection to the VM.

  3. Create a new directory for GoogleCloudPlatform open source projects if it does not exist.

    mkdir -p ~/go/src/github.com/GoogleCloudPlatform
  4. Update apt and install build-essential.

    sudo apt-get update
    sudo apt install build-essential
  5. Clone the source code.

    cd ~/go/src/github.com/GoogleCloudPlatform
    git clone https://github.com/GoogleCloudPlatform/k8s-config-connector
  6. Change to environment-setup directory.

    cd ~/go/src/github.com/GoogleCloudPlatform/k8s-config-connector/scripts/environment-setup
  7. Install Golang.

    ./golang-setup.sh
    source ~/.profile
  8. Install other build dependencies.

    ./repo-setup.sh
    source ~/.profile

Option 2: Set up an environment manually yourself

  1. Install all required dependencies

  2. Add all required dependencies to your $PATH.

  3. Set up a GOPATH.

  4. Add $GOPATH/bin to your $PATH.

  5. Clone the repository:

    cd $GOPATH/src/github.com/GoogleCloudPlatform
    git clone https://github.com/GoogleCloudPlatform/k8s-config-connector

Build the source code

  1. Enter the source code directory:

    cd $GOPATH/src/github.com/GoogleCloudPlatform/k8s-config-connector
  2. Build the controller:

    make manager
  3. Build the CRDs:

    make manifests
  4. Build the config-connector CLI tool:

    make config-connector

Contributing to Config Connector

Please refer to our contribution guide for more details.