Skip to content

Commit

Permalink
Add Maxunavaiable for Elasticsearch PDB support (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamrz1 authored and tamalsaha committed May 31, 2019
1 parent 7517175 commit c9bc03f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
4 changes: 4 additions & 0 deletions api/crds/elasticsearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8149,6 +8149,10 @@ spec:
type: string
type: object
type: object
maxUnavailable:
oneOf:
- type: string
- type: integer
monitor:
properties:
agent:
Expand Down
4 changes: 4 additions & 0 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -19786,6 +19786,10 @@
"description": "Init is used to initialize database",
"$ref": "#/definitions/com.github.kubedb.apimachinery.apis.kubedb.v1alpha1.InitSpec"
},
"maxUnavailable": {
"description": "An eviction is allowed if at most \"maxUnavailable\" pods selected by \"selector\" are unavailable after the eviction, i.e. even in absence of the evicted pod. For example, one can prevent all voluntary evictions by specifying 0. This is a mutually exclusive setting with \"minAvailable\".",
"$ref": "#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString"
},
"monitor": {
"description": "Monitor is used monitor database instance",
"$ref": "#/definitions/xyz.kmodules.monitoring-agent-api.api.v1.AgentSpec"
Expand Down
8 changes: 8 additions & 0 deletions apis/kubedb/v1alpha1/elasticsearch_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
apps "k8s.io/api/apps/v1"
core "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
mona "kmodules.xyz/monitoring-agent-api/api/v1"
ofst "kmodules.xyz/offshoot-api/api/v1"
)
Expand Down Expand Up @@ -80,6 +81,13 @@ type ElasticsearchSpec struct {
// +optional
ServiceTemplate ofst.ServiceTemplateSpec `json:"serviceTemplate,omitempty"`

// An eviction is allowed if at most "maxUnavailable" pods selected by
// "selector" are unavailable after the eviction, i.e. even in absence of
// the evicted pod. For example, one can prevent all voluntary evictions
// by specifying 0. This is a mutually exclusive setting with "minAvailable".
// +optional
MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`

// updateStrategy indicates the StatefulSetUpdateStrategy that will be
// employed to update Pods in the StatefulSet when a revision is made to
// Template.
Expand Down
8 changes: 7 additions & 1 deletion apis/kubedb/v1alpha1/openapi_generated.go

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

6 changes: 6 additions & 0 deletions apis/kubedb/v1alpha1/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 c9bc03f

Please sign in to comment.