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

Better documentation of podDisruptionBudget for Elasticsearch.spec #7155

Merged
merged 6 commits into from
Oct 5, 2023
Merged
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
15 changes: 9 additions & 6 deletions config/crds/v1/all-crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4511,10 +4511,13 @@ spec:
minItems: 1
type: array
podDisruptionBudget:
description: PodDisruptionBudget provides access to the default pod
description: PodDisruptionBudget provides access to the default Pod
disruption budget for the Elasticsearch cluster. The default budget
selects all cluster pods and sets `maxUnavailable` to 1. To disable,
set `PodDisruptionBudget` to the empty value (`{}` in YAML).
doesn't allow any Pod to be removed in case the cluster is not green
or if there is only one node of type `data` or `master`. In all
other cases the default PodDisruptionBudget sets `minUnavailable`
equal to the total number of nodes minus 1. To disable, set `PodDisruptionBudget`
to the empty value (`{}` in YAML).
properties:
metadata:
description: ObjectMeta is the metadata of the PDB. The name and
Expand Down Expand Up @@ -5170,15 +5173,15 @@ spec:
when applying changes to the Elasticsearch cluster.
properties:
maxSurge:
description: MaxSurge is the maximum number of new pods that
can be created exceeding the original number of pods defined
description: MaxSurge is the maximum number of new Pods that
can be created exceeding the original number of Pods defined
in the specification. MaxSurge is only taken into consideration
when scaling up. Setting a negative value will disable the
restriction. Defaults to unbounded if not specified.
format: int32
type: integer
maxUnavailable:
description: MaxUnavailable is the maximum number of pods
description: MaxUnavailable is the maximum number of Pods
that can be unavailable (not ready) during the update due
to circumstances under the control of the operator. Setting
a negative value will disable this restriction. Defaults
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9210,10 +9210,13 @@ spec:
minItems: 1
type: array
podDisruptionBudget:
description: PodDisruptionBudget provides access to the default pod
description: PodDisruptionBudget provides access to the default Pod
disruption budget for the Elasticsearch cluster. The default budget
selects all cluster pods and sets `maxUnavailable` to 1. To disable,
set `PodDisruptionBudget` to the empty value (`{}` in YAML).
doesn't allow any Pod to be removed in case the cluster is not green
or if there is only one node of type `data` or `master`. In all
other cases the default PodDisruptionBudget sets `minUnavailable`
equal to the total number of nodes minus 1. To disable, set `PodDisruptionBudget`
to the empty value (`{}` in YAML).
properties:
metadata:
description: ObjectMeta is the metadata of the PDB. The name and
Expand Down Expand Up @@ -9869,15 +9872,15 @@ spec:
when applying changes to the Elasticsearch cluster.
properties:
maxSurge:
description: MaxSurge is the maximum number of new pods that
can be created exceeding the original number of pods defined
description: MaxSurge is the maximum number of new Pods that
can be created exceeding the original number of Pods defined
in the specification. MaxSurge is only taken into consideration
when scaling up. Setting a negative value will disable the
restriction. Defaults to unbounded if not specified.
format: int32
type: integer
maxUnavailable:
description: MaxUnavailable is the maximum number of pods
description: MaxUnavailable is the maximum number of Pods
that can be unavailable (not ready) during the update due
to circumstances under the control of the operator. Setting
a negative value will disable this restriction. Defaults
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4547,10 +4547,13 @@ spec:
minItems: 1
type: array
podDisruptionBudget:
description: PodDisruptionBudget provides access to the default pod
description: PodDisruptionBudget provides access to the default Pod
disruption budget for the Elasticsearch cluster. The default budget
selects all cluster pods and sets `maxUnavailable` to 1. To disable,
set `PodDisruptionBudget` to the empty value (`{}` in YAML).
doesn't allow any Pod to be removed in case the cluster is not green
or if there is only one node of type `data` or `master`. In all
other cases the default PodDisruptionBudget sets `minUnavailable`
equal to the total number of nodes minus 1. To disable, set `PodDisruptionBudget`
to the empty value (`{}` in YAML).
properties:
metadata:
description: ObjectMeta is the metadata of the PDB. The name and
Expand Down Expand Up @@ -5206,15 +5209,15 @@ spec:
when applying changes to the Elasticsearch cluster.
properties:
maxSurge:
description: MaxSurge is the maximum number of new pods that
can be created exceeding the original number of pods defined
description: MaxSurge is the maximum number of new Pods that
can be created exceeding the original number of Pods defined
in the specification. MaxSurge is only taken into consideration
when scaling up. Setting a negative value will disable the
restriction. Defaults to unbounded if not specified.
format: int32
type: integer
maxUnavailable:
description: MaxUnavailable is the maximum number of pods
description: MaxUnavailable is the maximum number of Pods
that can be unavailable (not ready) during the update due
to circumstances under the control of the operator. Setting
a negative value will disable this restriction. Defaults
Expand Down
3 changes: 2 additions & 1 deletion deploy/eck-stack/charts/eck-elasticsearch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ remoteClusters: {}
volumeClaimDeletePolicy: ""

# Settings to limit the disruption when pods need to be rescheduled for some reason such as upgrades or routine maintenance.
# By default, if not set, the operator sets a budget that selects all Elastisearch cluster pods and sets `maxUnavailable` to 1.
# By default, if not set, the operator sets a budget that doesn't allow any pod to be removed in case the cluster is not green or if there is only one node of type `data` or `master`.
# In all other cases the default PodDisruptionBudget sets `minUnavailable` equal to the total number of nodes minus 1.
# To completely disable the pod disruption budget set `disabled` to true.
#
# podDisruptionBudget:
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/api-docs.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1105,8 +1105,8 @@ ChangeBudget defines the constraints to consider when applying changes to the El
[cols="25a,75a", options="header"]
|===
| Field | Description
| *`maxUnavailable`* __integer__ | MaxUnavailable is the maximum number of pods that can be unavailable (not ready) during the update due to circumstances under the control of the operator. Setting a negative value will disable this restriction. Defaults to 1 if not specified.
| *`maxSurge`* __integer__ | MaxSurge is the maximum number of new pods that can be created exceeding the original number of pods defined in the specification. MaxSurge is only taken into consideration when scaling up. Setting a negative value will disable the restriction. Defaults to unbounded if not specified.
| *`maxUnavailable`* __integer__ | MaxUnavailable is the maximum number of Pods that can be unavailable (not ready) during the update due to circumstances under the control of the operator. Setting a negative value will disable this restriction. Defaults to 1 if not specified.
| *`maxSurge`* __integer__ | MaxSurge is the maximum number of new Pods that can be created exceeding the original number of Pods defined in the specification. MaxSurge is only taken into consideration when scaling up. Setting a negative value will disable the restriction. Defaults to unbounded if not specified.
|===


Expand Down Expand Up @@ -1212,7 +1212,7 @@ ElasticsearchSpec holds the specification of an Elasticsearch cluster.
| *`transport`* __xref:{anchor_prefix}-github-com-elastic-cloud-on-k8s-v2-pkg-apis-elasticsearch-v1-transportconfig[$$TransportConfig$$]__ | Transport holds transport layer settings for Elasticsearch.
| *`nodeSets`* __xref:{anchor_prefix}-github-com-elastic-cloud-on-k8s-v2-pkg-apis-elasticsearch-v1-nodeset[$$NodeSet$$] array__ | NodeSets allow specifying groups of Elasticsearch nodes sharing the same configuration and Pod templates.
| *`updateStrategy`* __xref:{anchor_prefix}-github-com-elastic-cloud-on-k8s-v2-pkg-apis-elasticsearch-v1-updatestrategy[$$UpdateStrategy$$]__ | UpdateStrategy specifies how updates to the cluster should be performed.
| *`podDisruptionBudget`* __xref:{anchor_prefix}-github-com-elastic-cloud-on-k8s-v2-pkg-apis-common-v1-poddisruptionbudgettemplate[$$PodDisruptionBudgetTemplate$$]__ | PodDisruptionBudget provides access to the default pod disruption budget for the Elasticsearch cluster. The default budget selects all cluster pods and sets `maxUnavailable` to 1. To disable, set `PodDisruptionBudget` to the empty value (`{}` in YAML).
| *`podDisruptionBudget`* __xref:{anchor_prefix}-github-com-elastic-cloud-on-k8s-v2-pkg-apis-common-v1-poddisruptionbudgettemplate[$$PodDisruptionBudgetTemplate$$]__ | PodDisruptionBudget provides access to the default Pod disruption budget for the Elasticsearch cluster. The default budget doesn't allow any Pod to be removed in case the cluster is not green or if there is only one node of type `data` or `master`. In all other cases the default PodDisruptionBudget sets `minUnavailable` equal to the total number of nodes minus 1. To disable, set `PodDisruptionBudget` to the empty value (`{}` in YAML).
| *`auth`* __xref:{anchor_prefix}-github-com-elastic-cloud-on-k8s-v2-pkg-apis-elasticsearch-v1-auth[$$Auth$$]__ | Auth contains user authentication and authorization security settings for Elasticsearch.
| *`secureSettings`* __xref:{anchor_prefix}-github-com-elastic-cloud-on-k8s-v2-pkg-apis-common-v1-secretsource[$$SecretSource$$] array__ | SecureSettings is a list of references to Kubernetes secrets containing sensitive configuration options for Elasticsearch.
| *`serviceAccountName`* __string__ | ServiceAccountName is used to check access from the current resource to a resource (for ex. a remote Elasticsearch cluster) in a different namespace. Can only be used if ECK is enforcing RBAC on references.
Expand Down
11 changes: 6 additions & 5 deletions pkg/apis/elasticsearch/v1/elasticsearch_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ type ElasticsearchSpec struct {
// +kubebuilder:validation:Optional
UpdateStrategy UpdateStrategy `json:"updateStrategy,omitempty"`

// PodDisruptionBudget provides access to the default pod disruption budget for the Elasticsearch cluster.
// The default budget selects all cluster pods and sets `maxUnavailable` to 1. To disable, set `PodDisruptionBudget`
// to the empty value (`{}` in YAML).
// PodDisruptionBudget provides access to the default Pod disruption budget for the Elasticsearch cluster.
// The default budget doesn't allow any Pod to be removed in case the cluster is not green or if there is only one node of type `data` or `master`.
// In all other cases the default PodDisruptionBudget sets `minUnavailable` equal to the total number of nodes minus 1.
// To disable, set `PodDisruptionBudget` to the empty value (`{}` in YAML).
// +kubebuilder:validation:Optional
PodDisruptionBudget *commonv1.PodDisruptionBudgetTemplate `json:"podDisruptionBudget,omitempty"`

Expand Down Expand Up @@ -339,12 +340,12 @@ type UpdateStrategy struct {

// ChangeBudget defines the constraints to consider when applying changes to the Elasticsearch cluster.
type ChangeBudget struct {
// MaxUnavailable is the maximum number of pods that can be unavailable (not ready) during the update due to
// MaxUnavailable is the maximum number of Pods that can be unavailable (not ready) during the update due to
// circumstances under the control of the operator. Setting a negative value will disable this restriction.
// Defaults to 1 if not specified.
MaxUnavailable *int32 `json:"maxUnavailable,omitempty"`

// MaxSurge is the maximum number of new pods that can be created exceeding the original number of pods defined in
// MaxSurge is the maximum number of new Pods that can be created exceeding the original number of Pods defined in
// the specification. MaxSurge is only taken into consideration when scaling up. Setting a negative value will
// disable the restriction. Defaults to unbounded if not specified.
MaxSurge *int32 `json:"maxSurge,omitempty"`
Expand Down