From 6e6ba84ca0a29367503bff69b4a5f36e7e1d2a3b Mon Sep 17 00:00:00 2001 From: Jose Armesto Date: Mon, 8 Jun 2020 18:09:17 +0200 Subject: [PATCH] Add MachinePool support for FailureDomains Changed FailureDomains type to be slice of string Update docs/proposals/20190919-machinepool-api.md Co-authored-by: Jason DeTiberus --- config/crd/bases/exp.cluster.x-k8s.io_machinepools.yaml | 6 ++++++ docs/proposals/20190919-machinepool-api.md | 4 +++- exp/api/v1alpha3/machinepool_types.go | 3 +++ exp/api/v1alpha3/zz_generated.deepcopy.go | 5 +++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/config/crd/bases/exp.cluster.x-k8s.io_machinepools.yaml b/config/crd/bases/exp.cluster.x-k8s.io_machinepools.yaml index 37dbed1d85ad..d114076e9e65 100644 --- a/config/crd/bases/exp.cluster.x-k8s.io_machinepools.yaml +++ b/config/crd/bases/exp.cluster.x-k8s.io_machinepools.yaml @@ -51,6 +51,12 @@ spec: to. minLength: 1 type: string + failureDomains: + description: FailureDomains is the list of failure domains this MachinePool + should be attached to. + items: + type: string + type: array minReadySeconds: description: Minimum number of seconds for which a newly created machine instances should be ready. Defaults to 0 (machine instance will diff --git a/docs/proposals/20190919-machinepool-api.md b/docs/proposals/20190919-machinepool-api.md index 86ef1c7aa26a..6de018dd8af5 100644 --- a/docs/proposals/20190919-machinepool-api.md +++ b/docs/proposals/20190919-machinepool-api.md @@ -166,6 +166,9 @@ type MachinePoolSpec struct - **ClusterName [required]** - Type: `string` - Description: Name of the Cluster this machine pool belongs to. + - **FailureDomains [optional]** + - Type: `[]string` + - Description: FailureDomains is the list of failure domains this MachinePool should be attached to. - **Replicas [optional]** - Type: `*int32` - Description: Number of desired machine instances. Defaults to 1. @@ -415,4 +418,3 @@ inconsistent experience across providers. 10/23/2019: First round of feedback from community 10/23/2019: Present proposal at a community meeting 10/31/2019: Open proposal PR - diff --git a/exp/api/v1alpha3/machinepool_types.go b/exp/api/v1alpha3/machinepool_types.go index 55662b118236..ca4ab0eb46c1 100644 --- a/exp/api/v1alpha3/machinepool_types.go +++ b/exp/api/v1alpha3/machinepool_types.go @@ -59,6 +59,9 @@ type MachinePoolSpec struct { // This field must match the provider IDs as seen on the node objects corresponding to a machine pool's machine instances. // +optional ProviderIDList []string `json:"providerIDList,omitempty"` + + // FailureDomains is the list of failure domains this MachinePool should be attached to. + FailureDomains []string `json:"failureDomains,omitempty"` } // ANCHOR_END: MachinePoolSpec diff --git a/exp/api/v1alpha3/zz_generated.deepcopy.go b/exp/api/v1alpha3/zz_generated.deepcopy.go index 1204c841d48b..38aff47d155b 100644 --- a/exp/api/v1alpha3/zz_generated.deepcopy.go +++ b/exp/api/v1alpha3/zz_generated.deepcopy.go @@ -110,6 +110,11 @@ func (in *MachinePoolSpec) DeepCopyInto(out *MachinePoolSpec) { *out = make([]string, len(*in)) copy(*out, *in) } + if in.FailureDomains != nil { + in, out := &in.FailureDomains, &out.FailureDomains + *out = make([]string, len(*in)) + copy(*out, *in) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePoolSpec.