update

package
v1.7.14 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
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.

View Source
const (
	PreserveDowngradeOptionClusterSetting = "cluster.preserve_downgrade_option"
)

Variables

This section is empty.

Functions

func IsInternalDB

func IsInternalDB(db string) bool

func IsInternalUser

func IsInternalUser(user string) bool

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 UpdateRoach struct {
	CurrentVersion *semver.Version
	WantVersion    *semver.Version
	WantImageName  string
	StsName        string
	StsNamespace   string
	Db             *sql.DB
}

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.

Jump to

Keyboard shortcuts

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