googleprovider

package
v0.2.6-rc Latest Latest
Warning

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

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

Documentation

Overview

pkg/provider/google/provider.go

Google Cloud provider for Orkestra.

Handles the "google" block in Katalog declarations. Uses the official Google Cloud Go SDKs.

Supported resource kinds:

gcs      — Google Cloud Storage bucket (create, set labels, delete)
pubsub   — Pub/Sub topic (create, set labels, delete) and subscription (create, delete)
cloudsql — Cloud SQL instance (create, update tier, delete — PostgreSQL / MySQL)

Installation:

go get cloud.google.com/go/storage
go get cloud.google.com/go/pubsub
go get google.golang.org/api/sqladmin/v1
go get golang.org/x/oauth2/google

Registration:

p, err := googleprovider.NewFromAuth(ctx, auth)
registry.Register(p)

Auth keys (providers[].auth block):

project         — GCP project ID (required)
credentialsFile — path to service account JSON (default: ADC / GOOGLE_APPLICATION_CREDENTIALS)
credentialsJSON — inline service account JSON (alternative to credentialsFile)

Application Default Credentials (ADC) are used when no explicit credentials are provided. This means the provider works out of the box on GKE with Workload Identity.

Katalog:

providers:
  - name: google
    required: true
    auth:
      project: "$GCP_PROJECT"

operatorBox:
  providers:
    google:
      - gcs:
          name: "{{ .metadata.name }}-{{ .metadata.namespace }}"
          location: US
          storageClass: STANDARD
          uniformAccess: "true"

      - pubsub:
          topic: "{{ .metadata.name }}-events"
          subscription: "{{ .metadata.name }}-events-sub"
          ackDeadline: "20"

      - cloudsql:
          name: "{{ .metadata.name }}-db"
          databaseVersion: POSTGRES_15
          tier: db-f1-micro
          region: us-central1
          when:
            - field: spec.needsDatabase
              equals: "true"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider implements orktypes.Provider for the "google" block.

func New

func New(project string) *Provider

New creates a Google Cloud provider for the given project using Application Default Credentials.

func NewFromAuth

func NewFromAuth(_ context.Context, auth map[string]string) (*Provider, error)

NewFromAuth creates a Google Cloud provider from a Katalog auth map. Keys: project, credentialsFile, credentialsJSON.

func (*Provider) Delete

func (p *Provider) Delete(ctx context.Context, req orktypes.DeleteRequest) error

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) Reconcile

func (p *Provider) Reconcile(ctx context.Context, req orktypes.ReconcileRequest) error

Jump to

Keyboard shortcuts

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