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 ¶
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 ¶
NewScaler creates a Scaler backed by the supplied Kubernetes clientset and namespace.
func NewScalerForContext ¶
NewScalerForContext builds a Scaler from a kubeconfig context name, targeting the given namespace.
func (*Scaler) ScaleDown ¶
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).