| 1 |
/* |
| 2 |
Copyright 2017 The Kubernetes Authors. |
| 3 |
|
| 4 |
Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
you may not use this file except in compliance with the License. |
| 6 |
You may obtain a copy of the License at |
| 7 |
|
| 8 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
|
| 10 |
Unless required by applicable law or agreed to in writing, software |
| 11 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 |
See the License for the specific language governing permissions and |
| 14 |
limitations under the License. |
| 15 |
*/ |
| 16 |
|
| 17 |
package v1 |
| 18 |
|
| 19 |
import ( |
| 20 |
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 21 |
) |
| 22 |
|
| 23 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 24 |
|
| 25 |
// ReplicaSet ensures that a specified number of pod replicas are running at any given time. |
| 26 |
type ReplicaSet struct { |
| 27 |
metav1.TypeMeta `json:",inline"` |
| 28 |
|
| 29 |
// If the Labels of a ReplicaSet are empty, they are defaulted to |
| 30 |
// be the same as the Pod(s) that the ReplicaSet manages. |
| 31 |
// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata |
| 32 |
// +optional |
| 33 |
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` |
| 34 |
|
| 35 |
// Spec defines the specification of the desired behavior of the ReplicaSet. |
| 36 |
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status |
| 37 |
// +optional |
| 38 |
Spec ReplicaSetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` |
| 39 |
|
| 40 |
// Status is the most recently observed status of the ReplicaSet. |
| 41 |
// This data may be out of date by some window of time. |
| 42 |
// Populated by the system. |
| 43 |
// Read-only. |
| 44 |
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status |
| 45 |
// +optional |
| 46 |
Status ReplicaSetStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` |
| 47 |
} |
| 48 |
|
| 49 |
// ReplicaSetSpec is the specification of a ReplicaSet. |
| 50 |
type ReplicaSetSpec struct { |
| 51 |
// Replicas is the number of desired replicas. |
| 52 |
// This is a pointer to distinguish between explicit zero and unspecified. |
| 53 |
// Defaults to 1. |
| 54 |
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller |
| 55 |
// +optional |
| 56 |
Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"` |
| 57 |
} |
| 58 |
|
| 59 |
// ReplicaSetStatus represents the current status of a ReplicaSet. |
| 60 |
type ReplicaSetStatus struct { |
| 61 |
// Replicas is the most recently oberved number of replicas. |
| 62 |
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller |
| 63 |
Replicas int32 `json:"replicas" protobuf:"varint,1,opt,name=replicas"` |
| 64 |
} |