k8s

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeployOwnerKey = ".metadata.controller"
	// BuildIDLabel is the label that identifies the build ID for a deployment
	BuildIDLabel = "temporal.io/build-id"

	WorkerDeploymentNameSeparator = "/"
	ResourceNameSeparator         = "-"
	MaxBuildIdLen                 = 63
	ConnectionSpecHashAnnotation  = "temporal.io/connection-spec-hash"
)

Variables

This section is empty.

Functions

func CleanStringForDNS added in v1.0.0

func CleanStringForDNS(s string) string

func ComputeConnectionSpecHash added in v0.1.5

func ComputeConnectionSpecHash(connection temporaliov1alpha1.TemporalConnectionSpec) string

TODO (Shivam): Change hash when secret name is updated as well.

func ComputeVersionedDeploymentName

func ComputeVersionedDeploymentName(baseName, buildID string) string

ComputeVersionedDeploymentName generates a name for a versioned deployment

func ComputeWorkerDeploymentName

func ComputeWorkerDeploymentName(w *temporaliov1alpha1.TemporalWorkerDeployment) string

ComputeWorkerDeploymentName generates the base worker deployment name

func IsDeploymentHealthy

func IsDeploymentHealthy(deployment *appsv1.Deployment) (bool, *metav1.Time)

IsDeploymentHealthy checks if a deployment is in the "Available" state

func NewDeploymentWithControllerRef

func NewDeploymentWithControllerRef(
	w *temporaliov1alpha1.TemporalWorkerDeployment,
	buildID string,
	connection temporaliov1alpha1.TemporalConnectionSpec,
	reconcilerScheme *runtime.Scheme,
) (*appsv1.Deployment, error)

func NewDeploymentWithOwnerRef

func NewDeploymentWithOwnerRef(
	typeMeta *metav1.TypeMeta,
	objectMeta *metav1.ObjectMeta,
	spec *temporaliov1alpha1.TemporalWorkerDeploymentSpec,
	workerDeploymentName string,
	buildID string,
	connection temporaliov1alpha1.TemporalConnectionSpec,
) *appsv1.Deployment

NewDeploymentWithOwnerRef creates a new deployment resource, including owner references

func NewObjectRef

func NewObjectRef(obj client.Object) *corev1.ObjectReference

NewObjectRef creates a reference to a Kubernetes object

func TruncateString added in v1.0.0

func TruncateString(s string, n int) string

TruncateString truncates string to the first n characters. Pass n = -1 to skip truncation.

Types

type DeploymentState

type DeploymentState struct {
	// Map of buildID to deployment
	Deployments map[string]*appsv1.Deployment
	// Sorted deployments by creation time
	DeploymentsByTime []*appsv1.Deployment
	// Map of buildID to deployment references
	DeploymentRefs map[string]*corev1.ObjectReference
}

DeploymentState represents the Kubernetes state of all deployments for a temporal worker deployment

func GetDeploymentState

func GetDeploymentState(
	ctx context.Context,
	k8sClient client.Client,
	namespace string,
	ownerName string,
	workerDeploymentName string,
) (*DeploymentState, error)

GetDeploymentState queries Kubernetes to get the state of all deployments associated with a TemporalWorkerDeployment

Jump to

Keyboard shortcuts

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