targetallocator

package
v0.146.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ClientCertDuration is the validity period for client and server certificates (90 days).
	// cert-manager defaults to renewing at 2/3 of the duration (~60 days), ensuring certificates
	// are refreshed well before expiration (we'll keep it at 90d explicitly).
	ClientCertDuration = time.Hour * 24 * 90

	// CACertRenewBefore defines when the CA certificate should begin renewal (181 days before expiry).
	// Set to 2x ClientCertDuration + 1 day to ensure:
	// 1. CA renewal doesn't coincide with client/server renewal cycles (which occur every 60 days: day 60, 120, 180, 240, 300, 360, 420, 480, 540...).
	// 2. Without the +1 day offset, CA would renew at day 540 (when 180 days remain), colliding with the 9th client cert renewal.
	// 3. With +1 day, CA renews at day 539 (when 181 days remain), avoiding the race condition.
	// 4. The CA always has sufficient remaining validity (≥181 days) to safely issue 90-day client/server certificates.
	CACertRenewBefore = ClientCertDuration*2 + 24*time.Hour

	// CACertDuration is the validity period for the CA certificate (720 days = ~2 years).
	// Set to 8x ClientCertDuration to prevent renewal race conditions where client and server
	// certificates might be signed by different CA versions during simultaneous renewal.
	// This ensures the CA remains stable through multiple client/server certificate renewal cycles.
	CACertDuration = ClientCertDuration * 8
)
View Source
const (
	ComponentOpenTelemetryTargetAllocator = "opentelemetry-targetallocator"
)

Variables

This section is empty.

Functions

func Annotations

func Annotations(instance v1alpha1.TargetAllocator, configMap *v1.ConfigMap, filterAnnotations []string) map[string]string

Annotations returns the annotations for the TargetAllocator Pod.

func Build

func Build(params Params) ([]client.Object, error)

Build creates the manifest for the TargetAllocator resource.

func CACertificate added in v0.111.0

func CACertificate(params Params) *cmv1.Certificate

/ CACertificate returns a CA Certificate for the given instance.

func CAIssuer added in v0.111.0

func CAIssuer(params Params) *cmv1.Issuer

CAIssuer returns a CA issuer for the given instance.

func ClientCertificate added in v0.111.0

func ClientCertificate(params Params) *cmv1.Certificate

ClientCertificate returns a client Certificate for the given instance.

func ConfigMap

func ConfigMap(params Params) (*corev1.ConfigMap, error)

func Container

func Container(cfg config.Config, _ logr.Logger, instance v1alpha1.TargetAllocator) corev1.Container

Container builds a container for the given TargetAllocator.

func Deployment

func Deployment(params Params) (*appsv1.Deployment, error)

Deployment builds the deployment for the given instance.

func NetworkPolicy added in v0.132.0

func NetworkPolicy(params Params) (*networkingv1.NetworkPolicy, error)

func PodDisruptionBudget added in v0.91.0

func PodDisruptionBudget(params Params) (*policyV1.PodDisruptionBudget, error)

func SelfSignedIssuer added in v0.111.0

func SelfSignedIssuer(params Params) *cmv1.Issuer

SelfSignedIssuer returns a self-signed issuer for the given instance.

func Service

func Service(params Params) *corev1.Service

func ServiceAccount

func ServiceAccount(params Params) *corev1.ServiceAccount

ServiceAccount returns the service account for the given instance.

func ServiceAccountName

func ServiceAccountName(instance v1alpha1.TargetAllocator) string

ServiceAccountName returns the name of the existing or self-provisioned service account to use for the given instance.

func ServiceMonitor added in v0.91.0

func ServiceMonitor(params Params) *monitoringv1.ServiceMonitor

ServiceMonitor returns the service monitor for the given instance.

func ServingCertificate added in v0.111.0

func ServingCertificate(params Params) *cmv1.Certificate

ServingCertificate returns a serving Certificate for the given instance.

func Volumes

func Volumes(cfg config.Config, instance v1alpha1.TargetAllocator) []corev1.Volume

Volumes builds the volumes for the given instance, including the config map volume.

Types

type Params added in v0.103.0

type Params struct {
	Client          client.Client
	Recorder        record.EventRecorder
	Scheme          *runtime.Scheme
	Log             logr.Logger
	Collector       *v1beta1.OpenTelemetryCollector
	TargetAllocator v1alpha1.TargetAllocator
	Config          config.Config
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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