proxy

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TemplateFS embed.FS

Functions

This section is empty.

Types

type K8sClient

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

K8sClient wraps Kubernetes API interactions

func NewK8sClient

func NewK8sClient() (*K8sClient, error)

NewK8sClient creates a new Kubernetes client using in-cluster config

func (*K8sClient) GetCNPGCluster

func (k *K8sClient) GetCNPGCluster(ctx context.Context, namespace, name string) (*unstructured.Unstructured, error)

GetCNPGCluster retrieves a CNPG cluster

func (*K8sClient) GetDeployment

func (k *K8sClient) GetDeployment(ctx context.Context, namespace, name string) (*appsv1.Deployment, error)

GetDeployment retrieves a deployment

func (*K8sClient) GetSleepyService

func (k *K8sClient) GetSleepyService(ctx context.Context, namespace, name string) (*unstructured.Unstructured, error)

GetSleepyService retrieves a SleepyService resource

func (*K8sClient) GetSleepyServiceState

func (k *K8sClient) GetSleepyServiceState(ctx context.Context, namespace, name string) (string, error)

GetSleepyServiceState gets the current state from SleepyService status

func (*K8sClient) HibernateCNPGCluster

func (k *K8sClient) HibernateCNPGCluster(ctx context.Context, namespace, name string) error

HibernateCNPGCluster sets the hibernation annotation on a CNPG cluster

func (*K8sClient) IsCNPGHibernated

func (k *K8sClient) IsCNPGHibernated(ctx context.Context, namespace, name string) (bool, error)

IsCNPGHibernated checks if CNPG cluster is hibernated

func (*K8sClient) IsDeploymentReady

func (k *K8sClient) IsDeploymentReady(ctx context.Context, namespace, name string) (bool, error)

IsDeploymentReady checks if deployment has ready replicas

func (*K8sClient) ScaleDeployment

func (k *K8sClient) ScaleDeployment(ctx context.Context, namespace, name string, replicas int32) error

ScaleDeployment scales a deployment to the specified replicas

func (*K8sClient) UpdateSleepyServiceStatus

func (k *K8sClient) UpdateSleepyServiceStatus(ctx context.Context, namespace, name, desiredState string, lastActivity *metav1.Time) error

UpdateSleepyServiceStatus updates the status subresource of a SleepyService

func (*K8sClient) WaitForCNPGReady

func (k *K8sClient) WaitForCNPGReady(ctx context.Context, namespace, name string, onProgress func(string, int)) error

WaitForCNPGReady waits for CNPG cluster to be ready

func (*K8sClient) WaitForDeploymentReady

func (k *K8sClient) WaitForDeploymentReady(ctx context.Context, namespace, name string, onProgress func(string, int)) error

WaitForDeploymentReady waits for a deployment to have ready replicas

func (*K8sClient) WaitForSleepyServiceAwake

func (k *K8sClient) WaitForSleepyServiceAwake(ctx context.Context, namespace, name string, onProgress func(string, int)) error

WaitForSleepyServiceAwake polls the SleepyService until State becomes Awake

func (*K8sClient) WakeCNPGCluster

func (k *K8sClient) WakeCNPGCluster(ctx context.Context, namespace, name string) error

WakeCNPGCluster removes the hibernation annotation from a CNPG cluster

Jump to

Keyboard shortcuts

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