change cluster schema (#2026)
* change cluster schema * change cluster schema
This commit is contained in:
43
vendor/sigs.k8s.io/kubefed/pkg/apis/scheduling/v1alpha1/groupversion_info.go
generated
vendored
Normal file
43
vendor/sigs.k8s.io/kubefed/pkg/apis/scheduling/v1alpha1/groupversion_info.go
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// NOTE: Boilerplate only. Ignore this file.
|
||||
|
||||
// Package v1alpha1 contains API Schema definitions for the scheduling v1alpha1 API group
|
||||
// +kubebuilder:object:generate=true
|
||||
// +groupName=scheduling.kubefed.io
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"sigs.k8s.io/controller-runtime/pkg/scheme"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
SchemeGroupVersion = schema.GroupVersion{Group: "scheduling.kubefed.io", Version: "v1alpha1"}
|
||||
|
||||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
|
||||
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
|
||||
|
||||
// AddToScheme is required by pkg/client/...
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
// Resource is required by pkg/client/listers/...
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
99
vendor/sigs.k8s.io/kubefed/pkg/apis/scheduling/v1alpha1/replicaschedulingpreference_types.go
generated
vendored
Normal file
99
vendor/sigs.k8s.io/kubefed/pkg/apis/scheduling/v1alpha1/replicaschedulingpreference_types.go
generated
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
Copyright 2018 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// ReplicaSchedulingPreferenceSpec defines the desired state of ReplicaSchedulingPreference
|
||||
type ReplicaSchedulingPreferenceSpec struct {
|
||||
//TODO (@irfanurrehman); upgrade this to label selector only if need be.
|
||||
// The idea of this API is to have a a set of preferences which can
|
||||
// be used for a target FederatedDeployment or FederatedReplicaset.
|
||||
// Although the set of preferences in question can be applied to multiple
|
||||
// target objects using label selectors, but there are no clear advantages
|
||||
// of doing that as of now.
|
||||
// To keep the implementation and usage simple, matching ns/name of RSP
|
||||
// resource to the target resource is sufficient and only additional information
|
||||
// needed in RSP resource is a target kind (FederatedDeployment or FederatedReplicaset).
|
||||
TargetKind string `json:"targetKind"`
|
||||
|
||||
// Total number of pods desired across federated clusters.
|
||||
// Replicas specified in the spec for target deployment template or replicaset
|
||||
// template will be discarded/overridden when scheduling preferences are
|
||||
// specified.
|
||||
TotalReplicas int32 `json:"totalReplicas"`
|
||||
|
||||
// If set to true then already scheduled and running replicas may be moved to other clusters
|
||||
// in order to match current state to the specified preferences. Otherwise, if set to false,
|
||||
// up and running replicas will not be moved.
|
||||
// +optional
|
||||
Rebalance bool `json:"rebalance,omitempty"`
|
||||
|
||||
// A mapping between cluster names and preferences regarding a local workload object (dep, rs, .. ) in
|
||||
// these clusters.
|
||||
// "*" (if provided) applies to all clusters if an explicit mapping is not provided.
|
||||
// If omitted, clusters without explicit preferences should not have any replicas scheduled.
|
||||
// +optional
|
||||
Clusters map[string]ClusterPreferences `json:"clusters,omitempty"`
|
||||
}
|
||||
|
||||
// Preferences regarding number of replicas assigned to a cluster workload object (dep, rs, ..) within
|
||||
// a federated workload object.
|
||||
type ClusterPreferences struct {
|
||||
// Minimum number of replicas that should be assigned to this cluster workload object. 0 by default.
|
||||
// +optional
|
||||
MinReplicas int64 `json:"minReplicas,omitempty"`
|
||||
|
||||
// Maximum number of replicas that should be assigned to this cluster workload object.
|
||||
// Unbounded if no value provided (default).
|
||||
// +optional
|
||||
MaxReplicas *int64 `json:"maxReplicas,omitempty"`
|
||||
|
||||
// A number expressing the preference to put an additional replica to this cluster workload object.
|
||||
// 0 by default.
|
||||
Weight int64 `json:"weight,omitempty"`
|
||||
}
|
||||
|
||||
// ReplicaSchedulingPreferenceStatus defines the observed state of ReplicaSchedulingPreference
|
||||
type ReplicaSchedulingPreferenceStatus struct {
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:resource:path=replicaschedulingpreferences
|
||||
|
||||
type ReplicaSchedulingPreference struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec ReplicaSchedulingPreferenceSpec `json:"spec,omitempty"`
|
||||
Status ReplicaSchedulingPreferenceStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// ReplicaSchedulingPreferenceList contains a list of ReplicaSchedulingPreference
|
||||
type ReplicaSchedulingPreferenceList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []ReplicaSchedulingPreference `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&ReplicaSchedulingPreference{}, &ReplicaSchedulingPreferenceList{})
|
||||
}
|
||||
141
vendor/sigs.k8s.io/kubefed/pkg/apis/scheduling/v1alpha1/zz_generated.deepcopy.go
generated
vendored
Normal file
141
vendor/sigs.k8s.io/kubefed/pkg/apis/scheduling/v1alpha1/zz_generated.deepcopy.go
generated
vendored
Normal file
@@ -0,0 +1,141 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2018 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by controller-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterPreferences) DeepCopyInto(out *ClusterPreferences) {
|
||||
*out = *in
|
||||
if in.MaxReplicas != nil {
|
||||
in, out := &in.MaxReplicas, &out.MaxReplicas
|
||||
*out = new(int64)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPreferences.
|
||||
func (in *ClusterPreferences) DeepCopy() *ClusterPreferences {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterPreferences)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ReplicaSchedulingPreference) DeepCopyInto(out *ReplicaSchedulingPreference) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
out.Status = in.Status
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaSchedulingPreference.
|
||||
func (in *ReplicaSchedulingPreference) DeepCopy() *ReplicaSchedulingPreference {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ReplicaSchedulingPreference)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ReplicaSchedulingPreference) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ReplicaSchedulingPreferenceList) DeepCopyInto(out *ReplicaSchedulingPreferenceList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]ReplicaSchedulingPreference, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaSchedulingPreferenceList.
|
||||
func (in *ReplicaSchedulingPreferenceList) DeepCopy() *ReplicaSchedulingPreferenceList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ReplicaSchedulingPreferenceList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ReplicaSchedulingPreferenceList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ReplicaSchedulingPreferenceSpec) DeepCopyInto(out *ReplicaSchedulingPreferenceSpec) {
|
||||
*out = *in
|
||||
if in.Clusters != nil {
|
||||
in, out := &in.Clusters, &out.Clusters
|
||||
*out = make(map[string]ClusterPreferences, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = *val.DeepCopy()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaSchedulingPreferenceSpec.
|
||||
func (in *ReplicaSchedulingPreferenceSpec) DeepCopy() *ReplicaSchedulingPreferenceSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ReplicaSchedulingPreferenceSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ReplicaSchedulingPreferenceStatus) DeepCopyInto(out *ReplicaSchedulingPreferenceStatus) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaSchedulingPreferenceStatus.
|
||||
func (in *ReplicaSchedulingPreferenceStatus) DeepCopy() *ReplicaSchedulingPreferenceStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ReplicaSchedulingPreferenceStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
Reference in New Issue
Block a user