config

package
v0.42.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NoDownscaleLabelKey is the label to prevent downscaling of a statefulset
	NoDownscaleLabelKey   = "grafana.com/no-downscale"
	NoDownscaleLabelValue = "true"

	// LastDownscaleAnnotationKey is the last time the statefulset was scaled down in UTC in time.RFC3339 format.
	LastDownscaleAnnotationKey = "grafana.com/last-downscale"
	// MinTimeBetweenZonesDownscaleAnnotationKey is the minimum duration allowed between downscales of zones that are
	// part of the same rollout group in Go time.Duration format. Prefer this over the label with the same key.
	MinTimeBetweenZonesDownscaleAnnotationKey = "grafana.com/min-time-between-zones-downscale"
	// MinTimeBetweenZonesDownscaleLabelKey is the deprecated label form of MinTimeBetweenZonesDownscaleAnnotationKey.
	// Still accepted for migration; prefer the annotation.
	MinTimeBetweenZonesDownscaleLabelKey = MinTimeBetweenZonesDownscaleAnnotationKey
	// PrepareDownscalePathAnnotationKey is the path to the endpoint on each pod that should be called when the
	// statefulset is being prepared to be scaled down.
	PrepareDownscalePathAnnotationKey = "grafana.com/prepare-downscale-http-path"
	// PrepareDownscalePortAnnotationKey is the port on each pod that should be used when the statefulset is being
	// prepared to be scaled down.
	PrepareDownscalePortAnnotationKey = "grafana.com/prepare-downscale-http-port"
	// PrepareDownscaleLabelKey is the label to prepare each pod in a statefulset when down scaling.
	PrepareDownscaleLabelKey   = "grafana.com/prepare-downscale"
	PrepareDownscaleLabelValue = "true"

	// RolloutGroupLabelKey is the group to which multiple statefulsets belong and must be operated on together.
	RolloutGroupLabelKey = "rollout-group"
	// RolloutMaxUnavailableAnnotationKey is the max number of pods in each statefulset that may be stopped at
	// one time.
	RolloutMaxUnavailableAnnotationKey = "rollout-max-unavailable"
	// RolloutDownscaleLeaderAnnotationKey is the name of the leader statefulset that should be used to determine
	// the number of replicas in a follower statefulset.
	RolloutDownscaleLeaderAnnotationKey = "grafana.com/rollout-downscale-leader"
	// RolloutLeaderReadyKey is whether to only scale up once `ready` replicas match the desired replicas.
	RolloutLeaderReadyAnnotationKey   = "grafana.com/rollout-upscale-only-when-leader-ready"
	RolloutLeaderReadyAnnotationValue = "true"

	// RolloutMirrorReplicasFromResourceNameAnnotationKey -- when set (together with "kind" and optionally "api-version" annotations), rollout-operator sets number of
	// replicas based on replicas in this resource (its scale subresource).
	RolloutMirrorReplicasFromResourceNameAnnotationKey       = rolloutMirrorReplicasFromResourceAnnotationKeyPrefix + "-name"
	RolloutMirrorReplicasFromResourceKindAnnotationKey       = rolloutMirrorReplicasFromResourceAnnotationKeyPrefix + "-kind"
	RolloutMirrorReplicasFromResourceAPIVersionAnnotationKey = rolloutMirrorReplicasFromResourceAnnotationKeyPrefix + "-api-version" // optional
	RolloutMirrorReplicasFromResourceWriteBackStatusReplicas = rolloutMirrorReplicasFromResourceAnnotationKeyPrefix + "-write-back"  // optional

	// RolloutDelayedDownscaleAnnotationKey configures delay for downscaling. Prepare-url must be configured as well, and must support GET, POST and DELETE methods.
	RolloutDelayedDownscaleAnnotationKey = "grafana.com/rollout-delayed-downscale"

	// RolloutDelayedDownscalePrepareUrlAnnotationKey is a full URL to prepare-downscale endpoint. Hostname will be replaced with pod's fully qualified domain name.
	RolloutDelayedDownscalePrepareUrlAnnotationKey = "grafana.com/rollout-prepare-delayed-downscale-url"

	// RolloutDelayedDownscaleExcludeFromStatusReplicasAnnotationKey -- when set to "true", the status.replicas that rollout-operator writes to the reference resource
	// does not include the replicas pending delayed downscale. The annotation is off by default.
	RolloutDelayedDownscaleExcludeFromStatusReplicasAnnotationKey = "grafana.com/rollout-delayed-downscale-exclude-from-status-replicas"

	// RolloutForceReplicasAnnotationKey overrides the operator's replica decisions.
	// When set to a non-negative integer, the operator will scale the StatefulSet to that
	// number of replicas, bypassing leader/follower and mirror-resource logic.
	// In leader/follower mode, scaling is immediate. In mirror-replicas mode, delayed
	// downscale is still respected if configured.
	RolloutForceReplicasAnnotationKey = "grafana.com/rollout-force-replicas"

	// RolloutPausedAnnotationKey pauses pod rollouts for a StatefulSet when set to RolloutPausedAnnotationValue.
	// The operator will skip deleting pods for that StatefulSet while allowing other
	// StatefulSets in the same rollout group to continue rolling out.
	RolloutPausedAnnotationKey   = "grafana.com/rollout-paused"
	RolloutPausedAnnotationValue = "true"
)

Variables

This section is empty.

Functions

func GetMinTimeBetweenZonesDownscale added in v0.39.0

func GetMinTimeBetweenZonesDownscale(obj metav1.Object, logger log.Logger) (string, bool)

GetMinTimeBetweenZonesDownscale returns the configured minimum time between zone downscales from the object's metadata. The annotation is preferred. The label is still accepted for migration and emits a warning when used.

Types

This section is empty.

Jump to

Keyboard shortcuts

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