gcp

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package gcp provisions GKE clusters and GCS buckets for the gcp target.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBucket

func CreateBucket(ctx context.Context, project, name, location string) error

CreateBucket creates a GCS bucket, treating "already exists" as success.

func CreateGKE

func CreateGKE(ctx context.Context, s ClusterSpec) error

CreateGKE creates a regional autoscaling cluster and waits for it to finish.

func DeleteBucket

func DeleteBucket(ctx context.Context, name string) error

DeleteBucket empties and deletes a bucket, ignoring "not found".

func DeleteGKE

func DeleteGKE(ctx context.Context, s ClusterSpec) error

DeleteGKE deletes the cluster and waits for completion.

func RESTConfig

func RESTConfig(ctx context.Context, s ClusterSpec) (*rest.Config, error)

RESTConfig builds a client-go config for the cluster's API server using application-default credentials for the bearer token.

Types

type ClusterSpec

type ClusterSpec struct {
	Project     string
	Region      string
	Name        string
	Nodes       int32
	MinNodes    int32
	MaxNodes    int32
	MachineType string
}

ClusterSpec describes the GKE cluster to create.

type HMACKey

type HMACKey struct {
	AccessID string
	Secret   string
}

HMACKey is an S3-interop credential pair for GCS.

func CreateHMACKey

func CreateHMACKey(ctx context.Context, project, serviceAccount string) (HMACKey, error)

CreateHMACKey mints an HMAC key for the service account (needs objectAdmin on the buckets). The secret is only returned at creation time.

Jump to

Keyboard shortcuts

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