Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes

.PHONY: build
build: manifests generate fmt vet ## Build manager binary.
go build -o bin/manager cmd/main.go
go build -o bin/manager cmd/manager/main.go

.PHONY: run
run: manifests generate fmt vet ## Run a controller from your host.
Expand Down
40 changes: 40 additions & 0 deletions api/v1/objectstore_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,35 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// ProbeConfig holds configuration for probe timing and thresholds
// This is a subset of the corev1.Probe type, with only the fields that we want to expose as configuration.
type ProbeConfig struct {
// InitialDelaySeconds is the number of seconds after the container has started before startup probes are initiated.
// +kubebuilder:default:=0
// +optional
InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty"`

// TimeoutSeconds is the number of seconds after which the probe times out.
// +kubebuilder:default:=10
// +optional
TimeoutSeconds int32 `json:"timeoutSeconds,omitempty"`

// PeriodSeconds is how often (in seconds) to perform the probe.
// +kubebuilder:default:=10
// +optional
PeriodSeconds int32 `json:"periodSeconds,omitempty"`

// SuccessThreshold is the minimum consecutive successes for the probe to be considered successful.
// +kubebuilder:default:=1
// +optional
SuccessThreshold int32 `json:"successThreshold,omitempty"`

// FailureThreshold is the minimum consecutive failures for the probe to be considered failed.
// +kubebuilder:default:=10
// +optional
FailureThreshold int32 `json:"failureThreshold,omitempty"`
}

// InstanceSidecarConfiguration defines the configuration for the sidecar that runs in the instance pods.
type InstanceSidecarConfiguration struct {
// The environment to be explicitly passed to the sidecar
Expand All @@ -38,6 +67,17 @@ type InstanceSidecarConfiguration struct {
// +optional
Resources corev1.ResourceRequirements `json:"resources,omitempty"`

// StartupProbe defines the configuration for the startup probe of the sidecar container.
// +optional
StartupProbe *ProbeConfig `json:"startupProbe,omitempty"`

// LivenessProbe defines the configuration for the liveness probe of the sidecar container.
// +optional
LivenessProbe *ProbeConfig `json:"livenessProbe,omitempty"`

// ReadinessProbe defines the configuration for the readiness probe of the sidecar container.
// +optional
ReadinessProbe *ProbeConfig `json:"readinessProbe,omitempty"`
// AdditionalContainerArgs is an optional list of command-line arguments
// to be passed to the sidecar container when it starts.
// The provided arguments are appended to the container’s default arguments.
Expand Down
30 changes: 30 additions & 0 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

110 changes: 109 additions & 1 deletion config/crd/bases/barmancloud.cnpg.io_objectstores.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.18.0
controller-gen.kubebuilder.io/version: v0.16.1
name: objectstores.barmancloud.cnpg.io
spec:
group: barmancloud.cnpg.io
Expand Down Expand Up @@ -562,6 +562,78 @@ spec:
- name
type: object
type: array
livenessProbe:
description: LivenessProbe defines the configuration for the liveness
probe of the sidecar container.
properties:
failureThreshold:
default: 10
description: FailureThreshold is the minimum consecutive failures
for the probe to be considered failed.
format: int32
type: integer
initialDelaySeconds:
default: 0
description: InitialDelaySeconds is the number of seconds
after the container has started before startup probes are
initiated.
format: int32
type: integer
periodSeconds:
default: 10
description: PeriodSeconds is how often (in seconds) to perform
the probe.
format: int32
type: integer
successThreshold:
default: 1
description: SuccessThreshold is the minimum consecutive successes
for the probe to be considered successful.
format: int32
type: integer
timeoutSeconds:
default: 10
description: TimeoutSeconds is the number of seconds after
which the probe times out.
format: int32
type: integer
type: object
readinessProbe:
description: ReadinessProbe defines the configuration for the
readiness probe of the sidecar container.
properties:
failureThreshold:
default: 10
description: FailureThreshold is the minimum consecutive failures
for the probe to be considered failed.
format: int32
type: integer
initialDelaySeconds:
default: 0
description: InitialDelaySeconds is the number of seconds
after the container has started before startup probes are
initiated.
format: int32
type: integer
periodSeconds:
default: 10
description: PeriodSeconds is how often (in seconds) to perform
the probe.
format: int32
type: integer
successThreshold:
default: 1
description: SuccessThreshold is the minimum consecutive successes
for the probe to be considered successful.
format: int32
type: integer
timeoutSeconds:
default: 10
description: TimeoutSeconds is the number of seconds after
which the probe times out.
format: int32
type: integer
type: object
logLevel:
default: info
description: 'The log level for PostgreSQL instances. Valid values
Expand Down Expand Up @@ -639,6 +711,42 @@ spec:
The retentionCheckInterval defines the frequency at which the
system checks and enforces retention policies.
type: integer
startupProbe:
description: StartupProbe defines the configuration for the startup
probe of the sidecar container.
properties:
failureThreshold:
default: 10
description: FailureThreshold is the minimum consecutive failures
for the probe to be considered failed.
format: int32
type: integer
initialDelaySeconds:
default: 0
description: InitialDelaySeconds is the number of seconds
after the container has started before startup probes are
initiated.
format: int32
type: integer
periodSeconds:
default: 10
description: PeriodSeconds is how often (in seconds) to perform
the probe.
format: int32
type: integer
successThreshold:
default: 1
description: SuccessThreshold is the minimum consecutive successes
for the probe to be considered successful.
format: int32
type: integer
timeoutSeconds:
default: 10
description: TimeoutSeconds is the number of seconds after
which the probe times out.
format: int32
type: integer
type: object
type: object
retentionPolicy:
description: |-
Expand Down
20 changes: 20 additions & 0 deletions hack/examples/minio-store.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,26 @@ spec:
limits:
memory: "512Mi"
cpu: "500m"
additionalContainerArgs:
- --log-level=debug
startupProbe:
initialDelaySeconds: 1
timeoutSeconds: 10
periodSeconds: 1
failureThreshold: 10
successThreshold: 1
livenessProbe:
initialDelaySeconds: 30
timeoutSeconds: 5
periodSeconds: 10
failureThreshold: 3
successThreshold: 1
readinessProbe:
initialDelaySeconds: 5
timeoutSeconds: 5
periodSeconds: 5
failureThreshold: 3
successThreshold: 1
configuration:
endpointCA:
name: minio-server-tls
Expand Down
Loading