Skip to content

Commit

Permalink
Added cndr sensor probes. (#214)
Browse files Browse the repository at this point in the history
Co-authored-by: BenRub <[email protected]>
  • Loading branch information
sergeykostov and BenRub authored Dec 19, 2023
1 parent 7e92d30 commit 7416b02
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/v1/cndr_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions cbcontainers/state/components/sensor_daemon_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)}}
}
Expand Down

0 comments on commit 7416b02

Please sign in to comment.