From a30bc3311a2ab89064cd02677d99df6b64c6ffc5 Mon Sep 17 00:00:00 2001 From: skostov Date: Tue, 19 Dec 2023 12:14:38 +0200 Subject: [PATCH] Added cndr sensor probes. --- api/v1/cndr_types.go | 2 ++ cbcontainers/state/components/sensor_daemon_set.go | 1 + 2 files changed, 3 insertions(+) diff --git a/api/v1/cndr_types.go b/api/v1/cndr_types.go index 599a6ba8..d036ea22 100644 --- a/api/v1/cndr_types.go +++ b/api/v1/cndr_types.go @@ -17,6 +17,8 @@ type CBContainersCndrSensorSpec struct { Image CBContainersImageSpec `json:"image,omitempty"` // +kubebuilder:default:={requests: {memory: "64Mi", cpu: "30m"}, limits: {memory: "1024Mi", cpu: "500m"}} Resources coreV1.ResourceRequirements `json:"resources,omitempty"` + // +kubebuilder:default:={initialDelaySeconds: 45, timeoutSeconds: 5, periodSeconds: 30, successThreshold: 1, failureThreshold: 3, readinessPath: "/tmp/ready", livenessPath: "/tmp/alive" } + Probes CBContainersFileProbesSpec `json:"probes,omitempty"` // +kubebuilder:default:={port: 7071} Prometheus CBContainersPrometheusSpec `json:"prometheus,omitempty"` // +kubebuilder:default:=2 diff --git a/cbcontainers/state/components/sensor_daemon_set.go b/cbcontainers/state/components/sensor_daemon_set.go index f67a3f89..a651d1bd 100644 --- a/cbcontainers/state/components/sensor_daemon_set.go +++ b/cbcontainers/state/components/sensor_daemon_set.go @@ -457,6 +457,7 @@ func (obj *SensorDaemonSetK8sObject) mutateCndrContainer(container *coreV1.Conta container.Name = CndrContainerName container.Resources = cndrSpec.Resources commonState.MutateImage(container, cndrSpec.Image, agentSpec.Version, agentSpec.Components.Settings.DefaultImagesRegistry) + commonState.MutateContainerFileProbes(container, cndrSpec.Probes) if commonState.IsEnabled(cndrSpec.Prometheus.Enabled) { container.Ports = []coreV1.ContainerPort{{Name: "metrics", ContainerPort: int32(cndrSpec.Prometheus.Port)}} }