replicasets

package
v0.7.9 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

pkg/resources/replicasets/replicaset.go

pkg/resources/replicasets/types.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

Create creates a ReplicaSet owned by the CR if it does not already exist. Idempotent — if the ReplicaSet exists, does nothing and returns nil.

func Delete

Delete deletes the ReplicaSet if it exists.

func DeleteIfOwned

func DeleteIfOwned(ctx context.Context, kube kubeclient.KubeClient,
	owner domain.Object, name, namespace string) error

DeleteIfOwned deletes the ReplicaSet only if it is owned by the CR.

func Update

Update reconciles an existing ReplicaSet to match the resolved spec. Handles drift — if replicas or image have changed, patches the ReplicaSet.

Types

type ResolvedReplicaSetSpec

type ResolvedReplicaSetSpec struct {
	// Name — resolved ReplicaSet name. Required.
	Name string

	// Image — container image. Required.
	Image string

	// Replicas — number of pod replicas. Default: 1.
	Replicas int32

	// Port — container port. 0 means no port exposed.
	Port     int32
	Protocol corev1.Protocol

	// Namespace — target namespace. Required.
	Namespace string

	// Labels — applied to the ReplicaSet and pod template.
	// Orkestra always adds: managed-by=orkestra, orkestra-owner=<cr-name>
	Labels map[string]string

	// Annotations — applied to the ReplicaSet.
	Annotations map[string]string

	// Env — environment variables.
	Env     []orktypes.EnvVar
	EnvFrom *orktypes.EnvFrom

	// Resources — CPU and memory requests/limits. nil means no limits set.
	Resources *orktypes.ResourceRequirements

	// NodeSelector is a selector which must be true for the pod to fit on a node.
	// Selector which must match a node's labels for the pod to be scheduled on that node.
	// More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
	// +optional
	// +mapType=atomic
	NodeSelector map[string]string

	// ServiceAccountName is the name of the ServiceAccount to use to run this pod.
	// More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
	// +optional
	ServiceAccountName string

	// ImagePullSecrets is an optional list of references to secrets in the same namespace to use
	// for pulling any of the images used by this PodSpec.
	// If specified, these secrets will be passed to individual puller implementations for them to use.
	ImagePullSecrets []string

	// Probes — startup, liveness, and readiness probe configuration.
	Probes *orktypes.ProbesConfig

	// SecurityContext — container-level security settings.
	SecurityContext *orktypes.ContainerSecurityContext

	// PodSecurity — pod-level security settings.
	PodSecurity *orktypes.PodSecurityContext

	// Profiles — user-defined profile registry for runtime profile resolution.
	Profiles orktypes.ProfileRegistry

	// RollingUpdate — resolved rolling update strategy. nil means Orkestra manages lifecycle directly.
	RollingUpdate *orktypes.RollingUpdateBehavior

	// Volumes / VolumeMounts — pod volumes and container mounts.
	Volumes      []orktypes.VolumeSource
	VolumeMounts []orktypes.VolumeMount

	// Sleep injects an artificial delay into the reconcile of this resource.
	// Useful for autoscale testing, latency simulation, and chaos engineering.
	// Accepts extended duration units (s, m, h, d, w, mo, y).
	Sleep string
}

ResolvedReplicaSetSpec is the fully resolved ReplicaSet specification. Produced by resolving template expressions and merging static values. Passed directly to Create, Update, and Delete.

func Resolve

Resolve builds a ResolvedReplicaSetSpec from a ReplicaSetTemplateSource.

Jump to

Keyboard shortcuts

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