common

package
v0.12.9 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KaiServicesForServiceMonitor = []struct {
	Name     string
	Port     string
	JobLabel string

	LabelSelector map[string]string // optional, if not provided, "app": NAME will be used
	Namespaces    []string          // optional, if not provided, the service will be monitored in the namespace of the KAI config
}{
	{"queue-controller", "metrics", "queue-controller", nil, nil},
	{"kube-state-metrics", "http", "kube-state-metrics",
		map[string]string{"app.kubernetes.io/name": "kube-state-metrics"}, []string{"monitoring", "default"}},
}

KAI services that should be monitored via ServiceMonitor For now, we only monitor the queue controller. Add more services here if needed.

Functions

func AddK8sClientConfigToArgs

func AddK8sClientConfigToArgs(k8sClientConfig *kaiv1common.K8sClientConfig, args []string)

func AllControllersAvailable

func AllControllersAvailable(
	ctx context.Context, readerClient client.Reader, objects []client.Object,
) (bool, error)

func AllObjectsExists

func AllObjectsExists(
	ctx context.Context, runtimeClient client.Reader, objects []client.Object,
) (bool, error)

func CheckCRDsAvailable added in v0.12.0

func CheckCRDsAvailable(ctx context.Context, client client.Reader, crdNames ...string) (bool, error)

func CheckPrometheusCRDsAvailable added in v0.10.0

func CheckPrometheusCRDsAvailable(ctx context.Context, client client.Reader, targetCRDs ...string) (bool, error)

func DeploymentForKAIConfig

func DeploymentForKAIConfig(
	ctx context.Context, runtimeClient client.Reader, kaiConfig *kaiv1.Config, service *kaiv1common.Service, deploymentName string,
) (*appsv1.Deployment, error)

func MergeAffinities added in v0.10.0

func MergeAffinities(localAffinity *v1.Affinity,
	globalAffinity *v1.Affinity,
	podAntiAffinityLabel map[string]string,
	requireDefaultPodAntiAffinityTerm bool) *v1.Affinity

func ObjectForKAIConfig

func ObjectForKAIConfig(
	ctx context.Context, runtimeClient client.Reader, object client.Object,
	resourceName string, resourceNamespace string,
) (client.Object, error)

func PtrFrom

func PtrFrom[T any](v T) *T

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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