From fa04e1af19904a75fdc79d4d73cc25895b52803d Mon Sep 17 00:00:00 2001 From: skostov Date: Fri, 22 Dec 2023 10:49:51 +0200 Subject: [PATCH] Fix cndr liveness. --- api/v1/cndr_types.go | 2 +- .../example-values.yaml | 1 + .../templates/operator.yaml | 30 +++++++++++++++++++ ...ers.carbonblack.io_cbcontainersagents.yaml | 30 +++++++++++++++++++ ...ers.carbonblack.io_cbcontainersagents.yaml | 30 +++++++++++++++++++ 5 files changed, 92 insertions(+), 1 deletion(-) diff --git a/api/v1/cndr_types.go b/api/v1/cndr_types.go index d036ea22..cc600c56 100644 --- a/api/v1/cndr_types.go +++ b/api/v1/cndr_types.go @@ -17,7 +17,7 @@ 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" } + // +kubebuilder:default:={initialDelaySeconds: 240, timeoutSeconds: 1, periodSeconds: 30, successThreshold: 1, failureThreshold: 5, readinessPath: "/tmp/ready", livenessPath: "/tmp/alive" } Probes CBContainersFileProbesSpec `json:"probes,omitempty"` // +kubebuilder:default:={port: 7071} Prometheus CBContainersPrometheusSpec `json:"prometheus,omitempty"` diff --git a/charts/cbcontainers-agent/cbcontainers-agent-chart/example-values.yaml b/charts/cbcontainers-agent/cbcontainers-agent-chart/example-values.yaml index cfdef89a..10705908 100644 --- a/charts/cbcontainers-agent/cbcontainers-agent-chart/example-values.yaml +++ b/charts/cbcontainers-agent/cbcontainers-agent-chart/example-values.yaml @@ -205,5 +205,6 @@ components: enabled: false cndr: enabled: true + probes: {} # accessTokenSecretName is the name of the Kubernetes object of type Secret that holds the values of the Company Code companyCodeSecretName: "my-company-code-secret-name" \ No newline at end of file diff --git a/charts/cbcontainers-operator/cbcontainers-operator-chart/templates/operator.yaml b/charts/cbcontainers-operator/cbcontainers-operator-chart/templates/operator.yaml index 4ae158c4..f85a4d15 100644 --- a/charts/cbcontainers-operator/cbcontainers-operator-chart/templates/operator.yaml +++ b/charts/cbcontainers-operator/cbcontainers-operator-chart/templates/operator.yaml @@ -4837,6 +4837,36 @@ spec: type: string default: {} type: object + probes: + default: {} + properties: + failureThreshold: + default: 5 + format: int32 + type: integer + initialDelaySeconds: + default: 240 + format: int32 + type: integer + livenessPath: + default: /tmp/alive + type: string + periodSeconds: + default: 30 + format: int32 + type: integer + readinessPath: + default: /tmp/ready + type: string + successThreshold: + default: 1 + format: int32 + type: integer + timeoutSeconds: + default: 1 + format: int32 + type: integer + type: object prometheus: default: port: 7071 diff --git a/config/crd/bases/operator.containers.carbonblack.io_cbcontainersagents.yaml b/config/crd/bases/operator.containers.carbonblack.io_cbcontainersagents.yaml index 8536a840..3d1a550c 100644 --- a/config/crd/bases/operator.containers.carbonblack.io_cbcontainersagents.yaml +++ b/config/crd/bases/operator.containers.carbonblack.io_cbcontainersagents.yaml @@ -4827,6 +4827,36 @@ spec: type: string default: {} type: object + probes: + default: {} + properties: + failureThreshold: + default: 5 + format: int32 + type: integer + initialDelaySeconds: + default: 240 + format: int32 + type: integer + livenessPath: + default: /tmp/alive + type: string + periodSeconds: + default: 30 + format: int32 + type: integer + readinessPath: + default: /tmp/ready + type: string + successThreshold: + default: 1 + format: int32 + type: integer + timeoutSeconds: + default: 1 + format: int32 + type: integer + type: object prometheus: default: port: 7071 diff --git a/config/crd_v1beta1/bases/operator.containers.carbonblack.io_cbcontainersagents.yaml b/config/crd_v1beta1/bases/operator.containers.carbonblack.io_cbcontainersagents.yaml index 27d1607b..f62d638f 100644 --- a/config/crd_v1beta1/bases/operator.containers.carbonblack.io_cbcontainersagents.yaml +++ b/config/crd_v1beta1/bases/operator.containers.carbonblack.io_cbcontainersagents.yaml @@ -4472,6 +4472,36 @@ spec: additionalProperties: type: string type: object + probes: + default: {} + properties: + failureThreshold: + default: 5 + format: int32 + type: integer + initialDelaySeconds: + default: 240 + format: int32 + type: integer + livenessPath: + default: /tmp/alive + type: string + periodSeconds: + default: 30 + format: int32 + type: integer + readinessPath: + default: /tmp/ready + type: string + successThreshold: + default: 1 + format: int32 + type: integer + timeoutSeconds: + default: 1 + format: int32 + type: integer + type: object prometheus: properties: enabled: