Merge pull request #3933 from RainbowMango/pr_extend_cluster_with_zones
Extend Cluster API to support multiple zones
This commit is contained in:
commit
48a37ab5b1
|
@ -16357,8 +16357,16 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"zone": {
|
"zone": {
|
||||||
"description": "Zone represents the zone of the member cluster locate in.",
|
"description": "Zone represents the zone of the member cluster locate in. Deprecated: This filed was never been used by Karmada, and it will not be removed from v1alpha1 for backward compatibility, use Zones instead.",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"zones": {
|
||||||
|
"description": "Zones represents the failure zones(also called availability zones) of the member cluster. The zones are presented as a slice to support the case that cluster runs across multiple failure zones. Refer https://kubernetes.io/docs/setup/best-practices/multiple-zones/ for more details about running Kubernetes in multiple zones.",
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string",
|
||||||
|
"default": ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -117,9 +117,19 @@ type ClusterSpec struct {
|
||||||
Region string
|
Region string
|
||||||
|
|
||||||
// Zone represents the zone of the member cluster locate in.
|
// Zone represents the zone of the member cluster locate in.
|
||||||
|
// Deprecated: This filed was never been used by Karmada, and it will not be
|
||||||
|
// removed from v1alpha1 for backward compatibility, use Zones instead.
|
||||||
// +optional
|
// +optional
|
||||||
Zone string
|
Zone string
|
||||||
|
|
||||||
|
// Zones represents the failure zones(also called availability zones) of the
|
||||||
|
// member cluster. The zones are presented as a slice to support the case
|
||||||
|
// that cluster runs across multiple failure zones.
|
||||||
|
// Refer https://kubernetes.io/docs/setup/best-practices/multiple-zones/ for
|
||||||
|
// more details about running Kubernetes in multiple zones.
|
||||||
|
// +optional
|
||||||
|
Zones []string `json:"zones,omitempty"`
|
||||||
|
|
||||||
// Taints attached to the member cluster.
|
// Taints attached to the member cluster.
|
||||||
// Taints on the cluster have the "effect" on
|
// Taints on the cluster have the "effect" on
|
||||||
// any resource that does not tolerate the Taint.
|
// any resource that does not tolerate the Taint.
|
||||||
|
|
|
@ -129,9 +129,19 @@ type ClusterSpec struct {
|
||||||
Region string `json:"region,omitempty"`
|
Region string `json:"region,omitempty"`
|
||||||
|
|
||||||
// Zone represents the zone of the member cluster locate in.
|
// Zone represents the zone of the member cluster locate in.
|
||||||
|
// Deprecated: This filed was never been used by Karmada, and it will not be
|
||||||
|
// removed from v1alpha1 for backward compatibility, use Zones instead.
|
||||||
// +optional
|
// +optional
|
||||||
Zone string `json:"zone,omitempty"`
|
Zone string `json:"zone,omitempty"`
|
||||||
|
|
||||||
|
// Zones represents the failure zones(also called availability zones) of the
|
||||||
|
// member cluster. The zones are presented as a slice to support the case
|
||||||
|
// that cluster runs across multiple failure zones.
|
||||||
|
// Refer https://kubernetes.io/docs/setup/best-practices/multiple-zones/ for
|
||||||
|
// more details about running Kubernetes in multiple zones.
|
||||||
|
// +optional
|
||||||
|
Zones []string `json:"zones,omitempty"`
|
||||||
|
|
||||||
// Taints attached to the member cluster.
|
// Taints attached to the member cluster.
|
||||||
// Taints on the cluster have the "effect" on
|
// Taints on the cluster have the "effect" on
|
||||||
// any resource that does not tolerate the Taint.
|
// any resource that does not tolerate the Taint.
|
||||||
|
|
|
@ -331,6 +331,7 @@ func autoConvert_v1alpha1_ClusterSpec_To_cluster_ClusterSpec(in *ClusterSpec, ou
|
||||||
out.Provider = in.Provider
|
out.Provider = in.Provider
|
||||||
out.Region = in.Region
|
out.Region = in.Region
|
||||||
out.Zone = in.Zone
|
out.Zone = in.Zone
|
||||||
|
out.Zones = *(*[]string)(unsafe.Pointer(&in.Zones))
|
||||||
out.Taints = *(*[]v1.Taint)(unsafe.Pointer(&in.Taints))
|
out.Taints = *(*[]v1.Taint)(unsafe.Pointer(&in.Taints))
|
||||||
out.ResourceModels = *(*[]cluster.ResourceModel)(unsafe.Pointer(&in.ResourceModels))
|
out.ResourceModels = *(*[]cluster.ResourceModel)(unsafe.Pointer(&in.ResourceModels))
|
||||||
return nil
|
return nil
|
||||||
|
@ -353,6 +354,7 @@ func autoConvert_cluster_ClusterSpec_To_v1alpha1_ClusterSpec(in *cluster.Cluster
|
||||||
out.Provider = in.Provider
|
out.Provider = in.Provider
|
||||||
out.Region = in.Region
|
out.Region = in.Region
|
||||||
out.Zone = in.Zone
|
out.Zone = in.Zone
|
||||||
|
out.Zones = *(*[]string)(unsafe.Pointer(&in.Zones))
|
||||||
out.Taints = *(*[]v1.Taint)(unsafe.Pointer(&in.Taints))
|
out.Taints = *(*[]v1.Taint)(unsafe.Pointer(&in.Taints))
|
||||||
out.ResourceModels = *(*[]ResourceModel)(unsafe.Pointer(&in.ResourceModels))
|
out.ResourceModels = *(*[]ResourceModel)(unsafe.Pointer(&in.ResourceModels))
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -170,6 +170,11 @@ func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
|
||||||
(*out)[key] = val
|
(*out)[key] = val
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if in.Zones != nil {
|
||||||
|
in, out := &in.Zones, &out.Zones
|
||||||
|
*out = make([]string, len(*in))
|
||||||
|
copy(*out, *in)
|
||||||
|
}
|
||||||
if in.Taints != nil {
|
if in.Taints != nil {
|
||||||
in, out := &in.Taints, &out.Taints
|
in, out := &in.Taints, &out.Taints
|
||||||
*out = make([]v1.Taint, len(*in))
|
*out = make([]v1.Taint, len(*in))
|
||||||
|
|
|
@ -170,6 +170,11 @@ func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
|
||||||
(*out)[key] = val
|
(*out)[key] = val
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if in.Zones != nil {
|
||||||
|
in, out := &in.Zones, &out.Zones
|
||||||
|
*out = make([]string, len(*in))
|
||||||
|
copy(*out, *in)
|
||||||
|
}
|
||||||
if in.Taints != nil {
|
if in.Taints != nil {
|
||||||
in, out := &in.Taints, &out.Taints
|
in, out := &in.Taints, &out.Taints
|
||||||
*out = make([]v1.Taint, len(*in))
|
*out = make([]v1.Taint, len(*in))
|
||||||
|
|
|
@ -1359,11 +1359,26 @@ func schema_pkg_apis_cluster_v1alpha1_ClusterSpec(ref common.ReferenceCallback)
|
||||||
},
|
},
|
||||||
"zone": {
|
"zone": {
|
||||||
SchemaProps: spec.SchemaProps{
|
SchemaProps: spec.SchemaProps{
|
||||||
Description: "Zone represents the zone of the member cluster locate in.",
|
Description: "Zone represents the zone of the member cluster locate in. Deprecated: This filed was never been used by Karmada, and it will not be removed from v1alpha1 for backward compatibility, use Zones instead.",
|
||||||
Type: []string{"string"},
|
Type: []string{"string"},
|
||||||
Format: "",
|
Format: "",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
"zones": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Description: "Zones represents the failure zones(also called availability zones) of the member cluster. The zones are presented as a slice to support the case that cluster runs across multiple failure zones. Refer https://kubernetes.io/docs/setup/best-practices/multiple-zones/ for more details about running Kubernetes in multiple zones.",
|
||||||
|
Type: []string{"array"},
|
||||||
|
Items: &spec.SchemaOrArray{
|
||||||
|
Schema: &spec.Schema{
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Default: "",
|
||||||
|
Type: []string{"string"},
|
||||||
|
Format: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
"taints": {
|
"taints": {
|
||||||
SchemaProps: spec.SchemaProps{
|
SchemaProps: spec.SchemaProps{
|
||||||
Description: "Taints attached to the member cluster. Taints on the cluster have the \"effect\" on any resource that does not tolerate the Taint.",
|
Description: "Taints attached to the member cluster. Taints on the cluster have the \"effect\" on any resource that does not tolerate the Taint.",
|
||||||
|
|
Loading…
Reference in New Issue