Documentation
¶
Index ¶
- Constants
- Variables
- func GetControllerMaxDeploymentVersionsIneligibleForDeletion() int32
- func NewCacheOptions(watchNamespaces []string) (cache.Options, error)
- func ParseWatchNamespaces(raw string) []string
- type DeprecatedCRDWatches
- type DeprecatedTCReconciler
- type DeprecatedTWDReconciler
- type WorkerDeploymentReconciler
Constants ¶
const ( ReasonPlanGenerationFailed = "PlanGenerationFailed" ReasonPlanExecutionFailed = "PlanExecutionFailed" ReasonDeploymentCreateFailed = "DeploymentCreateFailed" ReasonDeploymentDeleteFailed = "DeploymentDeleteFailed" ReasonDeploymentScaleFailed = "DeploymentScaleFailed" ReasonDeploymentUpdateFailed = "DeploymentUpdateFailed" ReasonTestWorkflowStartFailed = "TestWorkflowStartFailed" ReasonVersionPromotionFailed = "VersionPromotionFailed" ReasonMetadataUpdateFailed = "MetadataUpdateFailed" ReasonManagerIdentityClaimFailed = "ManagerIdentityClaimFailed" ReasonGateWorkflowFailed = "GateWorkflowFailed" )
Event reason constants for WorkerDeployment.
These strings appear in Kubernetes Event objects (kubectl get events) and are internal to the controller's implementation. They are not part of the CRD status API and may change between releases. Do not write alerting or automation that depends on these strings.
const ( IdentityMetadataKey = "temporal.io/controller" VersionMetadataKey = "temporal.io/controller-version" VersionEnvKey = "CONTROLLER_VERSION" IdentityEnvKey = "CONTROLLER_IDENTITY" IdentitySuffixEnvKey = "CONTROLLER_IDENTITY_SUFFIX" MaxDeploymentVersionsIneligibleForDeletionEnvKey = "CONTROLLER_MAX_DEPLOYMENT_VERSIONS_INELIGIBLE_FOR_DELETION" )
Variables ¶
var Version = "unknown"
Version is set by goreleaser via ldflags at build time
Functions ¶
func GetControllerMaxDeploymentVersionsIneligibleForDeletion ¶ added in v1.0.0
func GetControllerMaxDeploymentVersionsIneligibleForDeletion() int32
func NewCacheOptions ¶ added in v1.8.0
NewCacheOptions scopes the manager's Deployment cache to worker Deployments.
Owns(&appsv1.Deployment{}) filters which Deployment events enqueue reconciles, but controller-runtime still lists, watches, and retains cached Deployment objects before those events reach the controller. Restricting the manager cache prevents unrelated cluster Deployments from growing the controller's memory use.
When watchNamespaces is non-empty the cache (and therefore the controller's watches) is restricted to those namespaces; empty means all namespaces.
func ParseWatchNamespaces ¶ added in v1.8.1
ParseWatchNamespaces splits a comma-separated namespace list (from the --watch-namespaces flag or WATCH_NAMESPACES env var) into a slice, trimming whitespace and dropping empty entries. An empty input returns nil, which NewCacheOptions treats as "watch all namespaces".
Types ¶
type DeprecatedCRDWatches ¶ added in v1.9.0
func DetectDeprecatedCRDWatches ¶ added in v1.9.0
func DetectDeprecatedCRDWatches( ctx context.Context, client dynamic.Interface, namespaces []string, ) (DeprecatedCRDWatches, error)
DetectDeprecatedCRDWatches returns which deprecated CRDs can be listed and watched in every configured namespace.
type DeprecatedTCReconciler ¶ added in v1.7.0
DeprecatedTCReconciler reconciles TemporalConnection stubs.
IMPORTANT: this reconciler must NEVER call Temporal APIs or manage k8s resources. Its only job is to surface a status condition guiding users to migrate to the Connection CRD.
func (*DeprecatedTCReconciler) SetupWithManager ¶ added in v1.7.0
func (r *DeprecatedTCReconciler) SetupWithManager(mgr ctrl.Manager) error
type DeprecatedTWDReconciler ¶ added in v1.7.0
DeprecatedTWDReconciler reconciles TemporalWorkerDeployment stubs.
IMPORTANT: this reconciler must NEVER call Temporal APIs or manage k8s Deployments. Doing so would race with the WorkerDeploymentReconciler for resources that share the same Temporal deployment name.
func (*DeprecatedTWDReconciler) SetupWithManager ¶ added in v1.7.0
func (r *DeprecatedTWDReconciler) SetupWithManager(mgr ctrl.Manager) error
type WorkerDeploymentReconciler ¶ added in v1.7.0
type WorkerDeploymentReconciler struct {
client.Client
Scheme *runtime.Scheme
TemporalClientPool *clientpool.ClientPool
Recorder record.EventRecorder
// Disables panic recovery if true
DisableRecoverPanic bool
DisableDeprecatedTWD bool
// When a Worker Deployment has the maximum number of versions (100 per Worker Deployment by default),
// it will delete the oldest eligible version when a worker with the 101st version arrives.
// If no versions are eligible for deletion, that worker's poll will fail, which is dangerous.
// To protect against this, when a Worker Deployment has too many versions ineligible for deletion,
// the controller will stop deploying new workers in order to give the user the opportunity to adjust
// their sunset policy to avoid this situation before it actually blocks deployment of a new worker
// version on the server side.
//
// MaxDeploymentVersionsIneligibleForDeletion is currently defaulted to 75, which is safe for the default
// server value of `matching.maxVersionsInDeployment=100`.
// Users who reduce `matching.maxVersionsInDeployment` in their dynamicconfig should also reduce this value.
MaxDeploymentVersionsIneligibleForDeletion int32
}
WorkerDeploymentReconciler reconciles a WorkerDeployment object
func (*WorkerDeploymentReconciler) Reconcile ¶ added in v1.7.0
func (r *WorkerDeploymentReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. The loop runs on a regular interval, or every time one of the watched resources listed above changes.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/pkg/reconcile
func (*WorkerDeploymentReconciler) SetupWithManager ¶ added in v1.7.0
func (r *WorkerDeploymentReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.