render

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package render turns one deployment request into the Kubernetes objects a cluster agent applies: per service a Deployment, a Service, a ConfigMap and a Secret, labelled as KyYard's. It runs in the agent only; the server never imports it and links no Kubernetes library.

Index

Constants

View Source
const (
	LabelName            = "app.kubernetes.io/name"
	LabelInstanceName    = "app.kubernetes.io/instance"
	LabelManagedBy       = "app.kubernetes.io/managed-by"
	LabelApplication     = "kyyard.busnes.app/application"
	LabelInstance        = "kyyard.busnes.app/instance"
	LabelService         = "kyyard.busnes.app/service"
	AnnotationRevision   = "kyyard.busnes.app/revision"
	AnnotationDeployment = "kyyard.busnes.app/deployment"
	AnnotationSpecDigest = "kyyard.busnes.app/spec-digest"
	ManagedBy            = "kyyard"
)

Labels and annotations on every object KyYard applies. LabelInstance is ownership: an object with the planned name that lacks it, or carries another instance's, is not KyYard's to touch.

View Source
const (
	ProgressDeadlineSeconds = 540
	MinReadySeconds         = 10
)

ProgressDeadlineSeconds is below the server's ten-minute apply deadline, so a stuck rollout is reported by the Deployment itself (ProgressDeadlineExceeded) while the agent still waits. MinReadySeconds keeps a process that exits seconds after it starts from counting as available.

Variables

This section is empty.

Functions

func Labels

func Labels(req protocol.DeploymentRequest, s string) map[string]string

Labels are the labels of every object of service s of the instance req targets.

func SecretFor

func SecretFor(configMap string) (string, bool)

SecretFor is the Secret rendered beside ConfigMap configMap; false for a name render never gives.

func Selector

func Selector(instance, s string) map[string]string

Selector is the part of Labels a Deployment and its Service select pods by; it never changes for a service, so a later apply can update the Deployment.

Types

type Set

type Set struct {
	Service    string
	Name       string
	ConfigMap  *corev1.ConfigMap
	Secret     *corev1.Secret
	Deployment *appsv1.Deployment
	Endpoint   *corev1.Service
	Claims     []*corev1.PersistentVolumeClaim
}

Set is one service's objects. Secret is nil when the service has no secret-backed value, and Service is nil when it publishes no port. Claims are the PersistentVolumeClaims it mounts, each mounted by this service alone.

func Request

func Request(req protocol.DeploymentRequest) []Set

Request renders every service of req, in order. req must have passed ValidateFor(protocol.RuntimeKubernetes, ...).

Jump to

Keyboard shortcuts

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