controlplane

package
v0.60.0-rc1 Latest Latest
Warning

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

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

Documentation

Overview

Package controlplane scales the Radius control-plane deployments up and down.

It exists to support restoring state into a running control plane. The PostgreSQL-backed resource providers open pgx connection pools at startup and cache prepared statements per connection. Restoring a pg_dump (which uses DROP TABLE / CREATE TABLE) underneath those live connections invalidates the cached statements and races the providers' own writes. Scaling the providers to zero before restore — and back up afterward — makes the restore atomic with respect to its consumers and avoids stale prepared-statement errors, without requiring a separate "restart" step.

Index

Constants

This section is empty.

Variables

View Source
var Deployments = []string{"ucp", "applications-rp", "dynamic-rp"}

Deployments lists the control-plane deployments that hold PostgreSQL connection pools and must therefore be quiesced while state is restored. Other components (the deployment engine, the dashboard) do not connect to the database directly and are left running.

Functions

This section is empty.

Types

type Scaler

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

Scaler scales the control-plane deployments in a namespace.

func NewScaler

func NewScaler(clientset k8s.Interface, namespace string) *Scaler

NewScaler creates a Scaler backed by the supplied Kubernetes clientset and namespace.

func NewScalerForContext

func NewScalerForContext(kubeContext, namespace string) (*Scaler, error)

NewScalerForContext builds a Scaler from a kubeconfig context name, targeting the given namespace.

func (*Scaler) ScaleDown

func (s *Scaler) ScaleDown(ctx context.Context) (map[string]int32, error)

ScaleDown scales every control-plane deployment to zero replicas and waits until their pods are gone. It returns the previous replica counts keyed by deployment name so they can be restored by ScaleUp. Deployments that are not present are skipped (a partial install is not an error).

func (*Scaler) ScaleUp

func (s *Scaler) ScaleUp(ctx context.Context, saved map[string]int32) error

ScaleUp restores each deployment to the replica count captured by ScaleDown and waits until the deployments report that many available replicas, so the control plane is serving again before the command returns.

Jump to

Keyboard shortcuts

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