Skip to content

Commit

Permalink
chore: sync API
Browse files Browse the repository at this point in the history
  • Loading branch information
CloudNativePG Automated Updates committed Dec 4, 2024
1 parent 9201354 commit aed86c3
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 0 deletions.
56 changes: 56 additions & 0 deletions pkg/api/v1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,62 @@ type ClusterSpec struct {
// any plugin to be loaded with the corresponding configuration
// +optional
Plugins PluginConfigurationList `json:"plugins,omitempty"`

// The configuration of the probes to be injected
// in the PostgreSQL Pods.
// +optional
Probes *ProbesConfiguration `json:"probes,omitempty"`
}

// ProbesConfiguration represent the configuration for the probes
// to be injected in the PostgreSQL Pods
type ProbesConfiguration struct {
// The startup probe configuration
Startup *Probe `json:"startup,omitempty"`

// The liveness probe configuration
Liveness *Probe `json:"liveness,omitempty"`

// The readiness probe configuration
Readiness *Probe `json:"readiness,omitempty"`
}

// Probe describes a health check to be performed against a container to determine whether it is
// alive or ready to receive traffic.
type Probe struct {
// Number of seconds after the container has started before liveness probes are initiated.
// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
// +optional
InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty"`
// Number of seconds after which the probe times out.
// Defaults to 1 second. Minimum value is 1.
// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
// +optional
TimeoutSeconds int32 `json:"timeoutSeconds,omitempty"`
// How often (in seconds) to perform the probe.
// Default to 10 seconds. Minimum value is 1.
// +optional
PeriodSeconds int32 `json:"periodSeconds,omitempty"`
// Minimum consecutive successes for the probe to be considered successful after having failed.
// Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
// +optional
SuccessThreshold int32 `json:"successThreshold,omitempty"`
// Minimum consecutive failures for the probe to be considered failed after having succeeded.
// Defaults to 3. Minimum value is 1.
// +optional
FailureThreshold int32 `json:"failureThreshold,omitempty"`
// Optional duration in seconds the pod needs to terminate gracefully upon probe failure.
// The grace period is the duration in seconds after the processes running in the pod are sent
// a termination signal and the time when the processes are forcibly halted with a kill signal.
// Set this value longer than the expected cleanup time for your process.
// If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this
// value overrides the value provided by the pod spec.
// Value must be non-negative integer. The value zero indicates stop immediately via
// the kill signal (no opportunity to shut down).
// This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.
// Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.
// +optional
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
}

// PluginConfigurationList represent a set of plugin with their
Expand Down
55 changes: 55 additions & 0 deletions pkg/api/v1/zz_generated.deepcopy.go

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

0 comments on commit aed86c3

Please sign in to comment.