Documentation ¶
Index ¶
- Constants
- func IsInternalDB(db string) bool
- func IsInternalUser(user string) bool
- func NewUpdateFunctionSuite(updateFunc func(*v1.StatefulSet) (*v1.StatefulSet, error), ...) *updateFunctionSuite
- func PartitionedRollingUpdateStrategy(perPodVerificationFunc func(*UpdateSts, int, logr.Logger) error) ...
- func RollingRestart(ctx context.Context, update *UpdateRoach, cluster *UpdateCluster, ...) error
- func UpdateClusterCockroachVersion(ctx context.Context, update *UpdateRoach, cluster *UpdateCluster, ...) error
- func UpdateClusterRegionStatefulSet(ctx context.Context, clientset kubernetes.Interface, name string, ...) (bool, error)
- type UpdateCluster
- type UpdateNotAllowed
- type UpdateRoach
- type UpdateSts
- type UpdateTimer
Constants ¶
const ( // Fixed fields in the client certificate. Any other values will be rejected by Vault. // Remember to update <repo root>/conf/policies/intrusion.hcl when updating this list of users. RootSQLUser = "root" NodeUser = "node" AdminRole = "admin" )
Cockroach roles that we can grant/revoke for users.
const (
PreserveDowngradeOptionClusterSetting = "cluster.preserve_downgrade_option"
)
Variables ¶
This section is empty.
Functions ¶
func IsInternalDB ¶
func IsInternalUser ¶
func NewUpdateFunctionSuite ¶
func NewUpdateFunctionSuite( updateFunc func(*v1.StatefulSet) (*v1.StatefulSet, error), updateStrategyFunc func(update *UpdateSts, updateTimer *UpdateTimer, l logr.Logger) (bool, error), ) *updateFunctionSuite
func PartitionedRollingUpdateStrategy ¶
func PartitionedRollingUpdateStrategy(perPodVerificationFunc func(*UpdateSts, int, logr.Logger) error, ) func(updateSts *UpdateSts, updateTimer *UpdateTimer, l logr.Logger) (bool, error)
partitionedRollingUpdateStrategy is an update strategy which updates the pods in a statefulset one at a time, and verifies the health of the cluster throughout the update.
partitionedRollingUpdateStrategy checks that all pods are ready before replacing a pod within a cluster.
After a pod has been updated, the perPodVerificationFunc will run to ensure the pod is in the expected state before continuing the update. This function takes a Kubernetes clientset, the StatefulSet being modified, and the pod number of the Statefulset that has just been updated. If it returns an error, the update is halted.
func RollingRestart ¶
func RollingRestart( ctx context.Context, update *UpdateRoach, cluster *UpdateCluster, l logr.Logger, ) error
RollingRestart performs a rolling restart on a sts.
func UpdateClusterCockroachVersion ¶
func UpdateClusterCockroachVersion( ctx context.Context, update *UpdateRoach, cluster *UpdateCluster, l logr.Logger, ) error
UpdateClusterCockroachVersion, and allows specifying custom pod timeouts, among other things, in order to enable unit testing.
func UpdateClusterRegionStatefulSet ¶
func UpdateClusterRegionStatefulSet( ctx context.Context, clientset kubernetes.Interface, name string, namespace string, updateSuite *updateFunctionSuite, waitUntilAllPodsReadyFunc func(context.Context, logr.Logger) error, podUpdateTimeout time.Duration, podMaxPollingInterval time.Duration, healthChecker healthchecker.HealthChecker, l logr.Logger, ) (bool, error)
UpdateClusterRegionStatefulSet is the regional version of updateClusterStatefulSets. See its documentation for more information on the parameters passed to this function.
Types ¶
type UpdateCluster ¶
type UpdateCluster struct { Clientset kubernetes.Interface PodUpdateTimeout time.Duration PodMaxPollingInterval time.Duration HealthChecker healthchecker.HealthChecker }
type UpdateNotAllowed ¶
type UpdateNotAllowed struct {
// contains filtered or unexported fields
}
func (UpdateNotAllowed) Error ¶
func (e UpdateNotAllowed) Error() string
type UpdateRoach ¶
type UpdateSts ¶
type UpdateSts struct {
// contains filtered or unexported fields
}
UpdateSts struct encapsultates everything Kubernetes related we need in order to update a StatefulSet
type UpdateTimer ¶
type UpdateTimer struct {
// contains filtered or unexported fields
}
UpdateTimer encapsulates everything timer and polling related we need to update a StatefulSet.