deployment

package
v0.0.0-...-8de2fc3 Latest Latest
Warning

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

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

Documentation

Overview

Package deployment manages Kubernetes Deployments and Services for CobaltCore operators. It provides functions for creating and updating Deployments, ensuring Services exist, and checking Deployment readiness.

Feature: CC-0005

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteHPA

func DeleteHPA(ctx context.Context, c client.Client, namespace, name string) error

DeleteHPA deletes the HorizontalPodAutoscaler identified by namespace and name. It is a no-op if the HPA does not exist (CC-0038).

func EnsureDeployment

func EnsureDeployment(ctx context.Context, c client.Client, scheme *runtime.Scheme, owner client.Object, deploy *appsv1.Deployment) (bool, error)

EnsureDeployment creates a Deployment if it does not exist or updates its spec if it already exists. It returns (true, nil) when all replicas are available, (false, nil) when the Deployment exists but is not yet ready, and (false, error) on unexpected failures (CC-0005).

func EnsureHPA

EnsureHPA creates a HorizontalPodAutoscaler if it does not exist or updates its spec and metadata if it already exists. An owner reference is set on the HPA so that it is garbage-collected when the owning resource is deleted. On the update path, owner references, labels, and annotations are reconciled to correct any out-of-band drift (CC-0038).

func EnsurePDB

func EnsurePDB(ctx context.Context, c client.Client, scheme *runtime.Scheme, owner client.Object, pdb *policyv1.PodDisruptionBudget) error

EnsurePDB creates a PodDisruptionBudget if it does not exist or updates its spec and metadata if it already exists. An owner reference is set on the PDB so that it is garbage-collected when the owning resource is deleted. On the update path, owner references, labels, and annotations are reconciled to correct any out-of-band drift (CC-0037).

func EnsureService

func EnsureService(ctx context.Context, c client.Client, scheme *runtime.Scheme, owner client.Object, svc *corev1.Service) error

EnsureService creates a Service if it does not exist or updates its spec if it already exists. Server-assigned fields (ClusterIP, ClusterIPs, IPFamilies) are preserved on updates. If the desired spec explicitly sets any of these fields to a value that differs from the existing service, an error is returned to signal an API usage problem (CC-0005).

func IsDeploymentReady

func IsDeploymentReady(deploy *appsv1.Deployment) bool

IsDeploymentReady returns true if the Deployment has an Available condition set to True and its ready replicas meet the desired replica count (CC-0005).

Types

This section is empty.

Jump to

Keyboard shortcuts

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