Documentation
¶
Index ¶
- Variables
- type K8sClient
- func (k *K8sClient) GetCNPGCluster(ctx context.Context, namespace, name string) (*unstructured.Unstructured, error)
- func (k *K8sClient) GetDeployment(ctx context.Context, namespace, name string) (*appsv1.Deployment, error)
- func (k *K8sClient) GetSleepyService(ctx context.Context, namespace, name string) (*unstructured.Unstructured, error)
- func (k *K8sClient) GetSleepyServiceState(ctx context.Context, namespace, name string) (string, error)
- func (k *K8sClient) HibernateCNPGCluster(ctx context.Context, namespace, name string) error
- func (k *K8sClient) IsCNPGHibernated(ctx context.Context, namespace, name string) (bool, error)
- func (k *K8sClient) IsDeploymentReady(ctx context.Context, namespace, name string) (bool, error)
- func (k *K8sClient) ScaleDeployment(ctx context.Context, namespace, name string, replicas int32) error
- func (k *K8sClient) UpdateSleepyServiceStatus(ctx context.Context, namespace, name, desiredState string, ...) error
- func (k *K8sClient) WaitForCNPGReady(ctx context.Context, namespace, name string, onProgress func(string, int)) error
- func (k *K8sClient) WaitForDeploymentReady(ctx context.Context, namespace, name string, onProgress func(string, int)) error
- func (k *K8sClient) WaitForSleepyServiceAwake(ctx context.Context, namespace, name string, onProgress func(string, int)) error
- func (k *K8sClient) WakeCNPGCluster(ctx context.Context, namespace, name string) error
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 ¶
HibernateCNPGCluster sets the hibernation annotation on a CNPG cluster
func (*K8sClient) IsCNPGHibernated ¶
IsCNPGHibernated checks if CNPG cluster is hibernated
func (*K8sClient) IsDeploymentReady ¶
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