-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tamal Saha <tamal@appscode.com>
- Loading branch information
Showing
15 changed files
with
856 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
/* | ||
Copyright AppsCode Inc. and Contributors. | ||
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 v1 | ||
|
||
import ( | ||
v1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// +genclient | ||
// +genclient:nonNamespaced | ||
// +genclient:skipVerbs=updateStatus | ||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
// +kubebuilder:resource:scope=Cluster | ||
|
||
// Placement represents a set of pods with consistent identities. | ||
// Identities are defined as: | ||
// - Network: A single stable DNS and hostname. | ||
// - Storage: As many VolumeClaims as requested. | ||
// | ||
// The Placement guarantees that a given network identity will always | ||
// map to the same storage identity. | ||
type Placement struct { | ||
metav1.TypeMeta `json:",inline"` | ||
// Standard object's metadata. | ||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata | ||
// +optional | ||
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` | ||
|
||
// Spec defines the desired identities of pods in this set. | ||
// +optional | ||
Spec PlacementSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` | ||
} | ||
|
||
// A PlacementSpec is the specification of a Placement. | ||
type PlacementSpec struct { | ||
// +optional | ||
SpreadAcrossZones *SpreadAcrossZones `json:"spreadAcrossZones,omitempty"` | ||
|
||
// +optional | ||
SpreadAcrossNodes *SpreadAcrossNodes `json:"spreadAcrossNodes,omitempty"` | ||
|
||
// +optional | ||
NodeAffinity []NodeAffinityRules `json:"nodeAffinity,omitempty"` | ||
} | ||
|
||
type SpreadAcrossZones struct { | ||
Zones []string `json:"zones"` | ||
MaxSkew int32 `json:"maxSkew"` | ||
WhenUnsatisfiable v1.UnsatisfiableConstraintAction `json:"whenUnsatisfiable"` | ||
} | ||
|
||
type SpreadAcrossNodes struct { | ||
MaxSkew int32 `json:"maxSkew"` | ||
WhenUnsatisfiable v1.UnsatisfiableConstraintAction `json:"whenUnsatisfiable"` | ||
} | ||
|
||
type NodeAffinityRules struct { | ||
TopologyKey string `json:"topologyKey"` | ||
Domains []TopologyDomain `json:"domains"` | ||
WhenUnsatisfiable v1.UnsatisfiableConstraintAction `json:"whenUnsatisfiable"` | ||
} | ||
|
||
type TopologyDomain struct { | ||
Domain string `json:"domain"` | ||
Replicas string `json:"replicas"` | ||
} | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// PlacementList is a collection of Placements. | ||
type PlacementList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
// Standard list's metadata. | ||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata | ||
// +optional | ||
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` | ||
|
||
// Items is the list of stateful sets. | ||
Items []Placement `json:"items" protobuf:"bytes,2,rep,name=items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&Placement{}, &PlacementList{}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
client/clientset/versioned/typed/apps/v1/fake/fake_apps_client.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.