Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CDAP-21096] Add support for startupProbe in CDAP master #127

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
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
29 changes: 29 additions & 0 deletions api/v1alpha1/cdapmaster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ type CDAPMasterSpec struct {
// Mutations can include adding init containers, tolerations and node selectors to pods. To use mutations,
// the admission control webhook should be enabled in the cdap operator.
MutationConfigs []MutationConfig `json:"mutationConfigs,omitempty"`
// StartupProbe is specification for the startup probe for CDAP system services.
// This is an optional field which ensures that the application is fully initialized
// before it starts receiving traffic.
// To disable the startup probe: either omit or set the field to nil.
// To enable the startup probe: set it to a pointer to a SystemMetricsExporterSpec
// struct (can be an empty struct). CDAPServiceSpec.EnableStartupProbe field also needs
// to be set to true for the deployment services which require startup probe to be enabled.
StartupProbe *StartupProbeSpec `json:"startupProbe,omitempty"`
}

// CDAPServiceSpec defines the base set of specifications applicable to all master services.
Expand Down Expand Up @@ -176,6 +184,9 @@ type CDAPServiceSpec struct {
Lifecycle *corev1.Lifecycle `json:"lifecycle,omitempty"`
// Affinity describes node affinity scheduling rules for the service.
Affinity *corev1.Affinity `json:"affinity,omitempty"`
// EnableStartupProbe is an optional field to indicate if StatusProbe should
// be enabled for the container.
EnableStartupProbe *bool `json:"enableStartupProbe,omitempty"`
}

// CDAPScalableServiceSpec defines the base specification for master services that can have more than one instance.
Expand Down Expand Up @@ -295,6 +306,24 @@ type SystemMetricExporterSpec struct {
CDAPServiceSpec `json:",inline"`
}

type StartupProbeSpec struct {
// For Probe config see:
// https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes.

// Number of seconds after the container has started before probes are initiated.
// Defaults to 0 seconds. Minimum value is 0.
InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"`
// How often (in seconds) to perform the probe.
// Default to 10 seconds. The minimum value is 1.
PeriodSeconds *int32 `json:"periodSeconds,omitempty"`
// Number of seconds after which the probe times out.
// Defaults to 1 second. Minimum value is 1.
TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
// Number of consecutive failures before considering the service not ready.
// Defaults to 3. Minimum value is 1.
FailureThreshold *int32 `json:"failureThreshold,omitempty"`
}

// CDAPMasterStatus defines the observed state of CDAPMaster
type CDAPMasterStatus struct {
status.Meta `json:",inline"`
Expand Down
45 changes: 45 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

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

110 changes: 110 additions & 0 deletions config/crd/bases/cdap.cdap.io_cdapmasters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3995,6 +3995,11 @@ spec:
Key is the configmap object name. Value is the mount path.
This adds ConfigMap data to the directory specified by the volume mount path.
type: object
enableStartupProbe:
description: |-
EnableStartupProbe is an optional field to indicate if StatusProbe should
be enabled for the container.
type: boolean
enableSystemMetrics:
description: |-
EnableSystemMetrics is an optional field that is considered along with CDAPMasterSpec.SystemMetricsExporter
Expand Down Expand Up @@ -6785,6 +6790,11 @@ spec:
Key is the configmap object name. Value is the mount path.
This adds ConfigMap data to the directory specified by the volume mount path.
type: object
enableStartupProbe:
description: |-
EnableStartupProbe is an optional field to indicate if StatusProbe should
be enabled for the container.
type: boolean
enableSystemMetrics:
description: |-
EnableSystemMetrics is an optional field that is considered along with CDAPMasterSpec.SystemMetricsExporter
Expand Down Expand Up @@ -9582,6 +9592,11 @@ spec:
Key is the configmap object name. Value is the mount path.
This adds ConfigMap data to the directory specified by the volume mount path.
type: object
enableStartupProbe:
description: |-
EnableStartupProbe is an optional field to indicate if StatusProbe should
be enabled for the container.
type: boolean
enableSystemMetrics:
description: |-
EnableSystemMetrics is an optional field that is considered along with CDAPMasterSpec.SystemMetricsExporter
Expand Down Expand Up @@ -12379,6 +12394,11 @@ spec:
Key is the configmap object name. Value is the mount path.
This adds ConfigMap data to the directory specified by the volume mount path.
type: object
enableStartupProbe:
description: |-
EnableStartupProbe is an optional field to indicate if StatusProbe should
be enabled for the container.
type: boolean
enableSystemMetrics:
description: |-
EnableSystemMetrics is an optional field that is considered along with CDAPMasterSpec.SystemMetricsExporter
Expand Down Expand Up @@ -15308,6 +15328,11 @@ spec:
Key is the configmap object name. Value is the mount path.
This adds ConfigMap data to the directory specified by the volume mount path.
type: object
enableStartupProbe:
description: |-
EnableStartupProbe is an optional field to indicate if StatusProbe should
be enabled for the container.
type: boolean
enableSystemMetrics:
description: |-
EnableSystemMetrics is an optional field that is considered along with CDAPMasterSpec.SystemMetricsExporter
Expand Down Expand Up @@ -18104,6 +18129,11 @@ spec:
Key is the configmap object name. Value is the mount path.
This adds ConfigMap data to the directory specified by the volume mount path.
type: object
enableStartupProbe:
description: |-
EnableStartupProbe is an optional field to indicate if StatusProbe should
be enabled for the container.
type: boolean
enableSystemMetrics:
description: |-
EnableSystemMetrics is an optional field that is considered along with CDAPMasterSpec.SystemMetricsExporter
Expand Down Expand Up @@ -20897,6 +20927,11 @@ spec:
Key is the configmap object name. Value is the mount path.
This adds ConfigMap data to the directory specified by the volume mount path.
type: object
enableStartupProbe:
description: |-
EnableStartupProbe is an optional field to indicate if StatusProbe should
be enabled for the container.
type: boolean
enableSystemMetrics:
description: |-
EnableSystemMetrics is an optional field that is considered along with CDAPMasterSpec.SystemMetricsExporter
Expand Down Expand Up @@ -23686,6 +23721,11 @@ spec:
Key is the configmap object name. Value is the mount path.
This adds ConfigMap data to the directory specified by the volume mount path.
type: object
enableStartupProbe:
description: |-
EnableStartupProbe is an optional field to indicate if StatusProbe should
be enabled for the container.
type: boolean
enableSystemMetrics:
description: |-
EnableSystemMetrics is an optional field that is considered along with CDAPMasterSpec.SystemMetricsExporter
Expand Down Expand Up @@ -27844,6 +27884,11 @@ spec:
Key is the configmap object name. Value is the mount path.
This adds ConfigMap data to the directory specified by the volume mount path.
type: object
enableStartupProbe:
description: |-
EnableStartupProbe is an optional field to indicate if StatusProbe should
be enabled for the container.
type: boolean
enableSystemMetrics:
description: |-
EnableSystemMetrics is an optional field that is considered along with CDAPMasterSpec.SystemMetricsExporter
Expand Down Expand Up @@ -30644,6 +30689,11 @@ spec:
Key is the configmap object name. Value is the mount path.
This adds ConfigMap data to the directory specified by the volume mount path.
type: object
enableStartupProbe:
description: |-
EnableStartupProbe is an optional field to indicate if StatusProbe should
be enabled for the container.
type: boolean
enableSystemMetrics:
description: |-
EnableSystemMetrics is an optional field that is considered along with CDAPMasterSpec.SystemMetricsExporter
Expand Down Expand Up @@ -33449,6 +33499,11 @@ spec:
Key is the configmap object name. Value is the mount path.
This adds ConfigMap data to the directory specified by the volume mount path.
type: object
enableStartupProbe:
description: |-
EnableStartupProbe is an optional field to indicate if StatusProbe should
be enabled for the container.
type: boolean
enableSystemMetrics:
description: |-
EnableSystemMetrics is an optional field that is considered along with CDAPMasterSpec.SystemMetricsExporter
Expand Down Expand Up @@ -33932,6 +33987,41 @@ spec:
description: ServiceAccountName is the service account for all the
service pods.
type: string
startupProbe:
description: |-
StartupProbe is specification for the startup probe for CDAP system services.
This is an optional field which ensures that the application is fully initialized
before it starts receiving traffic.
To disable the startup probe: either omit or set the field to nil.
To enable the startup probe: set it to a pointer to a SystemMetricsExporterSpec
struct (can be an empty struct). CDAPServiceSpec.EnableStartupProbe field also needs
to be set to true for the deployment services which require startup probe to be enabled.
properties:
failureThreshold:
description: |-
Number of consecutive failures before considering the service not ready.
Defaults to 3. Minimum value is 1.
format: int32
type: integer
initialDelaySeconds:
description: |-
Number of seconds after the container has started before probes are initiated.
Defaults to 0 seconds. Minimum value is 0.
format: int32
type: integer
periodSeconds:
description: |-
How often (in seconds) to perform the probe.
Default to 10 seconds. The minimum value is 1.
format: int32
type: integer
timeoutSeconds:
description: |-
Number of seconds after which the probe times out.
Defaults to 1 second. Minimum value is 1.
format: int32
type: integer
type: object
supportBundle:
description: |-
SupportBundle is specification for the CDAP support-bundle service.
Expand Down Expand Up @@ -36308,6 +36398,11 @@ spec:
Key is the configmap object name. Value is the mount path.
This adds ConfigMap data to the directory specified by the volume mount path.
type: object
enableStartupProbe:
description: |-
EnableStartupProbe is an optional field to indicate if StatusProbe should
be enabled for the container.
type: boolean
enableSystemMetrics:
description: |-
EnableSystemMetrics is an optional field that is considered along with CDAPMasterSpec.SystemMetricsExporter
Expand Down Expand Up @@ -39108,6 +39203,11 @@ spec:
Key is the configmap object name. Value is the mount path.
This adds ConfigMap data to the directory specified by the volume mount path.
type: object
enableStartupProbe:
description: |-
EnableStartupProbe is an optional field to indicate if StatusProbe should
be enabled for the container.
type: boolean
enableSystemMetrics:
description: |-
EnableSystemMetrics is an optional field that is considered along with CDAPMasterSpec.SystemMetricsExporter
Expand Down Expand Up @@ -41905,6 +42005,11 @@ spec:
Key is the configmap object name. Value is the mount path.
This adds ConfigMap data to the directory specified by the volume mount path.
type: object
enableStartupProbe:
description: |-
EnableStartupProbe is an optional field to indicate if StatusProbe should
be enabled for the container.
type: boolean
enableSystemMetrics:
description: |-
EnableSystemMetrics is an optional field that is considered along with CDAPMasterSpec.SystemMetricsExporter
Expand Down Expand Up @@ -44705,6 +44810,11 @@ spec:
Key is the configmap object name. Value is the mount path.
This adds ConfigMap data to the directory specified by the volume mount path.
type: object
enableStartupProbe:
description: |-
EnableStartupProbe is an optional field to indicate if StatusProbe should
be enabled for the container.
type: boolean
enableSystemMetrics:
description: |-
EnableSystemMetrics is an optional field that is considered along with CDAPMasterSpec.SystemMetricsExporter
Expand Down
Loading
Loading