kubernetes

package
v0.0.0-...-f0edac9 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 30 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package kubernetes implements the database store using Kubernetes resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(kubeconfig string) (kubernetes.Interface, error)

NewClient builds a kubernetes.Interface from the given kubeconfig path. If kubeconfig is empty, it falls back to in-cluster configuration.

Types

type CnpgDatabaseStore

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

CnpgDatabaseStore implements store.DatabaseRepository backed by CNPG Clusters, and Kubernetes Pods and Services.

func NewCnpgDatabaseStore

func NewCnpgDatabaseStore(client kubernetes.Interface, dynamicClient dynamic.Interface, cfg CnpgK8sConfig, logger *slog.Logger) *CnpgDatabaseStore

NewCnpgDatabaseStore creates a new CnpgDatabaseStore with the given client, config, and logger.

func (*CnpgDatabaseStore) CheckHealth

func (s *CnpgDatabaseStore) CheckHealth(ctx context.Context) error

CheckHealth verifies the backing Kubernetes cluster is reachable by calling the API server's version discovery endpoint.

func (*CnpgDatabaseStore) Create

Create creates a new container backed by a Kubernetes Deployment (and optionally a Service when ports have non-none visibility).

func (*CnpgDatabaseStore) Delete

func (s *CnpgDatabaseStore) Delete(ctx context.Context, databaseId string) error

Delete removes a database and its associated Kubernetes resources.

func (*CnpgDatabaseStore) Get

func (s *CnpgDatabaseStore) Get(ctx context.Context, containerID string) (*v1alpha1.Database, error)

Get retrieves a cluster by its instance ID, enriching it with runtime data from Pods, Services, and secrets.

func (*CnpgDatabaseStore) List

func (s *CnpgDatabaseStore) List(ctx context.Context, maxPageSize int32, pageToken string) (*v1alpha1.DatabaseList, error)

List returns a paginated list of databases using Kubernetes Limit/Continue tokens as the AEP opaque page_token / next_page_token.

type CnpgK8sConfig

type CnpgK8sConfig struct {
	Namespace           string
	ExternalServiceType string
	ImageCatalogName    string
	DefaultStorageClass string
	DefaultVersion      string
}

CnpgK8sConfig holds configuration for the Kubernetes database store.

Jump to

Keyboard shortcuts

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