cloud-sql-proxy-operator

command module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

README

Cloud SQL Proxy Operator

Cloud SQL Proxy Operator is an open-source Kubernetes operator that automates most of the intricate steps needed to connect a workload in a kubernetes cluster to Cloud SQL databases.

The operator introduces a custom resource AuthProxyWorkload, which specifies the Cloud SQL Auth Proxy configuration for a workload. The operator reads this resource and adds a properly configured Cloud SQL Auth Proxy container to the matching workload pods.

Setting up the initial project

These commands will be run to initialize the kubebuilder project

# Get the kubebuilder binary
mkdir -p .bin
curl -L -o .bin/kubebuilder "https://github.com/kubernetes-sigs/kubebuilder/releases/download/v3.6.0/kubebuilder_$(go env GOOS)_$(go env GOARCH)"
chmod a+x .bin/kubebuilder

# Clean up the root dir for kubebuilder
rm -rf Makefile main.go go.mod go.sum cover.out 

mkdir -p .bin/tmp/
mv docs .bin/tmp/
mv version.txt .bin/tmp/

rm -rf bin
.bin/kubebuilder init --owner "Google LLC" --project-name "cloud-sql-proxy-operator" --domain cloud.google.com --repo github.com/GoogleCloudPlatform/cloud-sql-proxy-operator

mv .bin/tmp/* .

Then, to create the CRD for Workload

.bin/kubebuilder create api --group cloudsql --version v1alpha1 --kind AuthProxyWorkload --controller --resource --force
.bin/kubebuilder create webhook --group cloudsql --version v1alpha1 --kind AuthProxyWorkload --defaulting --programmatic-validation

Documentation

Overview

Copyright 2022 Google LLC.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
internal
api/v1alpha1
Package v1alpha1 contains API Schema definitions for the cloudsql v1alpha1 API group: the custom resource AuthProxyWorkload version v1alpha1 This follows the kubebuilder pattern for defining custom resources.
Package v1alpha1 contains API Schema definitions for the cloudsql v1alpha1 API group: the custom resource AuthProxyWorkload version v1alpha1 This follows the kubebuilder pattern for defining custom resources.
controller
Package controller holds logic that interacts with the kubernetes API to reconcile the AuthProxyWorkload custom resources.
Package controller holds logic that interacts with the kubernetes API to reconcile the AuthProxyWorkload custom resources.
testhelpers
Package testhelpers holds reusable functions that make it easier to write testintegration and end-to-end tests.
Package testhelpers holds reusable functions that make it easier to write testintegration and end-to-end tests.
testintegration
Package testintegration test setup for running testintegration tests using the envtest kubebuilder package.
Package testintegration test setup for running testintegration tests using the envtest kubebuilder package.
workload
Package workload holds logic for manipulating kubernetes workload data structs.
Package workload holds logic for manipulating kubernetes workload data structs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL