Commit 7414cafb authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #34860 from mbohlool/optional

Automatic merge from submit-queue +optional tag for OpenAPI spec OpenAPI rely on "omitempty" json tag to determine if a field is optional or not. This change will add "+optional" tag to all fields with "omitempty" json tag and support the tag in OpenAPI spec generator.
parents ff8f29b7 0191433d
......@@ -29,12 +29,15 @@ type TestType struct {
// the next tag removes the field from openapi spec. Adding unversioned objectMeta bring in a whole set of
// unversioned objects in the generate file that is not used anywhere other than this test type.
// +k8s:openapi-gen=false
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
Status TestTypeStatus `json:"status,omitempty"`
// +optional
Status TestTypeStatus `json:"status,omitempty"`
}
type TestTypeList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
Items []TestType `json:"items"`
......
......@@ -36,6 +36,7 @@ import (
// This is the comment tag that carries parameters for open API generation.
const tagName = "k8s:openapi-gen"
const tagOptional = "optional"
// Known values for the tag.
const (
......@@ -56,6 +57,11 @@ func hasOpenAPITagValue(comments []string, value string) bool {
return false
}
func hasOptionalTag(comments []string) bool {
tagValues := types.ExtractCommentTags("+", comments)[tagOptional]
return tagValues != nil
}
// NameSystems returns the name system used by the generators in this package.
func NameSystems() namer.NameSystems {
return namer.NameSystems{
......@@ -225,30 +231,6 @@ func getReferableName(m *types.Member) string {
}
}
func optionIndex(s, optionName string) int {
ret := 0
for s != "" {
var next string
i := strings.Index(s, ",")
if i >= 0 {
s, next = s[:i], s[i+1:]
}
if s == optionName {
return ret
}
s = next
ret++
}
return -1
}
func isPropertyRequired(m *types.Member) bool {
// A property is required if it does not have omitempty value in its json tag (documentation and implementation
// of json package requires omitempty to be at location 1 or higher.
// TODO: Move optional field definition from tags to comments.
return optionIndex(reflect.StructTag(m.Tags).Get("json"), "omitempty") < 1
}
type openAPITypeWriter struct {
*generator.SnippetWriter
refTypes map[string]*types.Type
......@@ -306,7 +288,7 @@ func (g openAPITypeWriter) generate(t *types.Type) error {
if name == "" {
continue
}
if isPropertyRequired(&m) {
if !hasOptionalTag(m.CommentLines) {
required = append(required, name)
}
if err := g.generateProperty(&m); err != nil {
......
......@@ -42,6 +42,7 @@ type ClusterSpec struct {
// Admin needs to ensure that the required secret exists. Secret should be in the same namespace where federation control plane is hosted and it should have kubeconfig in its data with key "kubeconfig".
// This will later be changed to a reference to secret in federation control plane when the federation control plane supports secrets.
// This can be left empty if the cluster allows insecure access.
// +optional
SecretRef *api.LocalObjectReference `json:"secretRef,omitempty"`
}
......@@ -62,23 +63,30 @@ type ClusterCondition struct {
// Status of the condition, one of True, False, Unknown.
Status api.ConditionStatus `json:"status"`
// Last time the condition was checked.
// +optional
LastProbeTime unversioned.Time `json:"lastProbeTime,omitempty"`
// Last time the condition transit from one status to another.
// +optional
LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty"`
// (brief) reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty"`
// Human readable message indicating details about last transition.
// +optional
Message string `json:"message,omitempty"`
}
// ClusterStatus is information about the current status of a cluster updated by cluster controller peridocally.
type ClusterStatus struct {
// Conditions is an array of current cluster conditions.
// +optional
Conditions []ClusterCondition `json:"conditions,omitempty"`
// Zones is the list of availability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'.
// These will always be in the same region.
// +optional
Zones []string `json:"zones,omitempty"`
// Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'.
// +optional
Region string `json:"region,omitempty"`
}
......@@ -90,11 +98,14 @@ type Cluster struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
// Spec defines the behavior of the Cluster.
// +optional
Spec ClusterSpec `json:"spec,omitempty"`
// Status describes the current status of a Cluster
// +optional
Status ClusterStatus `json:"status,omitempty"`
}
......@@ -103,6 +114,7 @@ type ClusterList struct {
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
// List of Cluster objects.
......@@ -118,20 +130,24 @@ type FederatedReplicaSetPreferences struct {
// If set to true then already scheduled and running replicas may be moved to other clusters to
// in order to bring cluster replicasets towards a desired state. Otherwise, if set to false,
// up and running replicas will not be moved.
// +optional
Rebalance bool `json:"rebalance,omitempty"`
// A mapping between cluser names and preferences regarding local replicasets in these clusters.
// "*" (if provided) applies to all clusters if an explicit mapping is not provided. If there is no
// "*" that clusters without explicit preferences should not have any replicas scheduled.
// +optional
Clusters map[string]ClusterReplicaSetPreferences `json:"clusters,omitempty"`
}
// Preferences regarding number of replicas assigned to a cluster replicaset within a federated replicaset.
type ClusterReplicaSetPreferences struct {
// Minimum number of replicas that should be assigned to this Local ReplicaSet. 0 by default.
// +optional
MinReplicas int64 `json:"minReplicas,omitempty"`
// Maximum number of replicas that should be assigned to this Local ReplicaSet. Unbounded if no value provided (default).
// +optional
MaxReplicas *int64 `json:"maxReplicas,omitempty"`
// A number expressing the preference to put an additional replica to this LocalReplicaSet. 0 by default.
......
......@@ -34,12 +34,15 @@ option go_package = "v1beta1";
message Cluster {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Spec defines the behavior of the Cluster.
// +optional
optional ClusterSpec spec = 2;
// Status describes the current status of a Cluster
// +optional
optional ClusterStatus status = 3;
}
......@@ -52,15 +55,19 @@ message ClusterCondition {
optional string status = 2;
// Last time the condition was checked.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.Time lastProbeTime = 3;
// Last time the condition transit from one status to another.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.Time lastTransitionTime = 4;
// (brief) reason for the condition's last transition.
// +optional
optional string reason = 5;
// Human readable message indicating details about last transition.
// +optional
optional string message = 6;
}
......@@ -68,6 +75,7 @@ message ClusterCondition {
message ClusterList {
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
// List of Cluster objects.
......@@ -87,19 +95,23 @@ message ClusterSpec {
// Admin needs to ensure that the required secret exists. Secret should be in the same namespace where federation control plane is hosted and it should have kubeconfig in its data with key "kubeconfig".
// This will later be changed to a reference to secret in federation control plane when the federation control plane supports secrets.
// This can be left empty if the cluster allows insecure access.
// +optional
optional k8s.io.kubernetes.pkg.api.v1.LocalObjectReference secretRef = 2;
}
// ClusterStatus is information about the current status of a cluster updated by cluster controller peridocally.
message ClusterStatus {
// Conditions is an array of current cluster conditions.
// +optional
repeated ClusterCondition conditions = 1;
// Zones is the list of availability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'.
// These will always be in the same region.
// +optional
repeated string zones = 5;
// Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'.
// +optional
optional string region = 6;
}
......
......@@ -42,6 +42,7 @@ type ClusterSpec struct {
// Admin needs to ensure that the required secret exists. Secret should be in the same namespace where federation control plane is hosted and it should have kubeconfig in its data with key "kubeconfig".
// This will later be changed to a reference to secret in federation control plane when the federation control plane supports secrets.
// This can be left empty if the cluster allows insecure access.
// +optional
SecretRef *v1.LocalObjectReference `json:"secretRef,omitempty" protobuf:"bytes,2,opt,name=secretRef"`
}
......@@ -62,23 +63,30 @@ type ClusterCondition struct {
// Status of the condition, one of True, False, Unknown.
Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"`
// Last time the condition was checked.
// +optional
LastProbeTime unversioned.Time `json:"lastProbeTime,omitempty" protobuf:"bytes,3,opt,name=lastProbeTime"`
// Last time the condition transit from one status to another.
// +optional
LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"`
// (brief) reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"`
// Human readable message indicating details about last transition.
// +optional
Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"`
}
// ClusterStatus is information about the current status of a cluster updated by cluster controller peridocally.
type ClusterStatus struct {
// Conditions is an array of current cluster conditions.
// +optional
Conditions []ClusterCondition `json:"conditions,omitempty" protobuf:"bytes,1,rep,name=conditions"`
// Zones is the list of availability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'.
// These will always be in the same region.
// +optional
Zones []string `json:"zones,omitempty" protobuf:"bytes,5,rep,name=zones"`
// Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'.
// +optional
Region string `json:"region,omitempty" protobuf:"bytes,6,opt,name=region"`
}
......@@ -90,11 +98,14 @@ type Cluster struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Spec defines the behavior of the Cluster.
// +optional
Spec ClusterSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
// Status describes the current status of a Cluster
// +optional
Status ClusterStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
......@@ -103,6 +114,7 @@ type ClusterList struct {
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
// +optional
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// List of Cluster objects.
......
......@@ -62,6 +62,7 @@ type ObjectMeta struct {
// some resources may allow a client to request the generation of an appropriate name
// automatically. Name is primarily intended for creation idempotence and configuration
// definition.
// +optional
Name string `json:"name,omitempty"`
// GenerateName indicates that the name should be made unique by the server prior to persisting
......@@ -75,35 +76,42 @@ type ObjectMeta struct {
// generated name exists - instead, it will either return 201 Created or 500 with Reason
// ServerTimeout indicating a unique name could not be found in the time allotted, and the client
// should retry (optionally after the time indicated in the Retry-After header).
// +optional
GenerateName string `json:"generateName,omitempty"`
// Namespace defines the space within which name must be unique. An empty namespace is
// equivalent to the "default" namespace, but "default" is the canonical representation.
// Not all objects are required to be scoped to a namespace - the value of this field for
// those objects will be empty.
// +optional
Namespace string `json:"namespace,omitempty"`
// SelfLink is a URL representing this object.
// +optional
SelfLink string `json:"selfLink,omitempty"`
// UID is the unique in time and space value for this object. It is typically generated by
// the server on successful creation of a resource and is not allowed to change on PUT
// operations.
// +optional
UID types.UID `json:"uid,omitempty"`
// An opaque value that represents the version of this resource. May be used for optimistic
// concurrency, change detection, and the watch operation on a resource or set of resources.
// Clients must treat these values as opaque and values may only be valid for a particular
// resource or set of resources. Only servers will generate resource versions.
// +optional
ResourceVersion string `json:"resourceVersion,omitempty"`
// A sequence number representing a specific generation of the desired state.
// Populated by the system. Read-only.
// +optional
Generation int64 `json:"generation,omitempty"`
// CreationTimestamp is a timestamp representing the server time when this object was
// created. It is not guaranteed to be set in happens-before order across separate operations.
// Clients may not set this value. It is represented in RFC3339 form and is in UTC.
// +optional
CreationTimestamp unversioned.Time `json:"creationTimestamp,omitempty"`
// DeletionTimestamp is the time after which this resource will be deleted. This
......@@ -115,10 +123,12 @@ type ObjectMeta struct {
// a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination
// signal to the containers in the pod. Once the resource is deleted in the API, the Kubelet
// will send a hard termination signal to the container.
// +optional
DeletionTimestamp *unversioned.Time `json:"deletionTimestamp,omitempty"`
// DeletionGracePeriodSeconds records the graceful deletion value set when graceful deletion
// was requested. Represents the most recent grace period, and may only be shortened once set.
// +optional
DeletionGracePeriodSeconds *int64 `json:"deletionGracePeriodSeconds,omitempty"`
// Labels are key value pairs that may be used to scope and select individual resources.
......@@ -130,29 +140,34 @@ type ObjectMeta struct {
// The prefix is optional. If the prefix is not specified, the key is assumed to be private
// to the user. Other system components that wish to use labels must specify a prefix. The
// "kubernetes.io/" prefix is reserved for use by kubernetes components.
// +optional
Labels map[string]string `json:"labels,omitempty"`
// Annotations are unstructured key value data stored with a resource that may be set by
// external tooling. They are not queryable and should be preserved when modifying
// objects. Annotation keys have the same formatting restrictions as Label keys. See the
// comments on Labels for details.
// +optional
Annotations map[string]string `json:"annotations,omitempty"`
// List of objects depended by this object. If ALL objects in the list have
// been deleted, this object will be garbage collected. If this object is managed by a controller,
// then an entry in this list will point to this controller, with the controller field set to true.
// There cannot be more than one managing controller.
// +optional
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"`
// Must be empty before the object is deleted from the registry. Each entry
// is an identifier for the responsible component that will remove the entry
// from the list. If the deletionTimestamp of the object is non-nil, entries
// in this list can only be removed.
// +optional
Finalizers []string `json:"finalizers,omitempty"`
// The name of the cluster which the object belongs to.
// This is used to distinguish resources with same name and namespace in different clusters.
// This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.
// +optional
ClusterName string `json:"clusterName,omitempty"`
}
......@@ -177,6 +192,7 @@ type Volume struct {
// The VolumeSource represents the location and type of a volume to mount.
// This is optional for now. If not specified, the Volume is implied to be an EmptyDir.
// This implied behavior is deprecated and will be removed in a future version.
// +optional
VolumeSource `json:",inline,omitempty"`
}
......@@ -190,58 +206,80 @@ type VolumeSource struct {
// ---
// TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not
// mount host directories as read/write.
// +optional
HostPath *HostPathVolumeSource `json:"hostPath,omitempty"`
// EmptyDir represents a temporary directory that shares a pod's lifetime.
// +optional
EmptyDir *EmptyDirVolumeSource `json:"emptyDir,omitempty"`
// GCEPersistentDisk represents a GCE Disk resource that is attached to a
// kubelet's host machine and then exposed to the pod.
// +optional
GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"gcePersistentDisk,omitempty"`
// AWSElasticBlockStore represents an AWS EBS disk that is attached to a
// kubelet's host machine and then exposed to the pod.
// +optional
AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore,omitempty"`
// GitRepo represents a git repository at a particular revision.
// +optional
GitRepo *GitRepoVolumeSource `json:"gitRepo,omitempty"`
// Secret represents a secret that should populate this volume.
// +optional
Secret *SecretVolumeSource `json:"secret,omitempty"`
// NFS represents an NFS mount on the host that shares a pod's lifetime
// +optional
NFS *NFSVolumeSource `json:"nfs,omitempty"`
// ISCSIVolumeSource represents an ISCSI Disk resource that is attached to a
// kubelet's host machine and then exposed to the pod.
// +optional
ISCSI *ISCSIVolumeSource `json:"iscsi,omitempty"`
// Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime
// +optional
Glusterfs *GlusterfsVolumeSource `json:"glusterfs,omitempty"`
// PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace
// +optional
PersistentVolumeClaim *PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty"`
// RBD represents a Rados Block Device mount on the host that shares a pod's lifetime
// +optional
RBD *RBDVolumeSource `json:"rbd,omitempty"`
// Quobyte represents a Quobyte mount on the host that shares a pod's lifetime
// +optional
Quobyte *QuobyteVolumeSource `json:"quobyte,omitempty"`
// FlexVolume represents a generic volume resource that is
// provisioned/attached using an exec based plugin. This is an alpha feature and may change in future.
// +optional
FlexVolume *FlexVolumeSource `json:"flexVolume,omitempty"`
// Cinder represents a cinder volume attached and mounted on kubelets host machine
// +optional
Cinder *CinderVolumeSource `json:"cinder,omitempty"`
// CephFS represents a Cephfs mount on the host that shares a pod's lifetime
// +optional
CephFS *CephFSVolumeSource `json:"cephfs,omitempty"`
// Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running
// +optional
Flocker *FlockerVolumeSource `json:"flocker,omitempty"`
// DownwardAPI represents metadata about the pod that should populate this volume
// +optional
DownwardAPI *DownwardAPIVolumeSource `json:"downwardAPI,omitempty"`
// FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.
// +optional
FC *FCVolumeSource `json:"fc,omitempty"`
// AzureFile represents an Azure File Service mount on the host and bind mount to the pod.
// +optional
AzureFile *AzureFileVolumeSource `json:"azureFile,omitempty"`
// ConfigMap represents a configMap that should populate this volume
// +optional
ConfigMap *ConfigMapVolumeSource `json:"configMap,omitempty"`
// VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine
// +optional
VsphereVolume *VsphereVirtualDiskVolumeSource `json:"vsphereVolume,omitempty"`
// AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
// +optional
AzureDisk *AzureDiskVolumeSource `json:"azureDisk,omitempty"`
}
......@@ -250,42 +288,58 @@ type VolumeSource struct {
type PersistentVolumeSource struct {
// GCEPersistentDisk represents a GCE Disk resource that is attached to a
// kubelet's host machine and then exposed to the pod.
// +optional
GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"gcePersistentDisk,omitempty"`
// AWSElasticBlockStore represents an AWS EBS disk that is attached to a
// kubelet's host machine and then exposed to the pod.
// +optional
AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore,omitempty"`
// HostPath represents a directory on the host.
// Provisioned by a developer or tester.
// This is useful for single-node development and testing only!
// On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster.
// +optional
HostPath *HostPathVolumeSource `json:"hostPath,omitempty"`
// Glusterfs represents a Glusterfs volume that is attached to a host and exposed to the pod
// +optional
Glusterfs *GlusterfsVolumeSource `json:"glusterfs,omitempty"`
// NFS represents an NFS mount on the host that shares a pod's lifetime
// +optional
NFS *NFSVolumeSource `json:"nfs,omitempty"`
// RBD represents a Rados Block Device mount on the host that shares a pod's lifetime
// +optional
RBD *RBDVolumeSource `json:"rbd,omitempty"`
// Quobyte represents a Quobyte mount on the host that shares a pod's lifetime
// +optional
Quobyte *QuobyteVolumeSource `json:"quobyte,omitempty"`
// ISCSIVolumeSource represents an ISCSI resource that is attached to a
// kubelet's host machine and then exposed to the pod.
// +optional
ISCSI *ISCSIVolumeSource `json:"iscsi,omitempty"`
// FlexVolume represents a generic volume resource that is
// provisioned/attached using an exec based plugin. This is an alpha feature and may change in future.
// +optional
FlexVolume *FlexVolumeSource `json:"flexVolume,omitempty"`
// Cinder represents a cinder volume attached and mounted on kubelets host machine
// +optional
Cinder *CinderVolumeSource `json:"cinder,omitempty"`
// CephFS represents a Ceph FS mount on the host that shares a pod's lifetime
// +optional
CephFS *CephFSVolumeSource `json:"cephfs,omitempty"`
// FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.
// +optional
FC *FCVolumeSource `json:"fc,omitempty"`
// Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running
// +optional
Flocker *FlockerVolumeSource `json:"flocker,omitempty"`
// AzureFile represents an Azure File Service mount on the host and bind mount to the pod.
// +optional
AzureFile *AzureFileVolumeSource `json:"azureFile,omitempty"`
// VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine
// +optional
VsphereVolume *VsphereVirtualDiskVolumeSource `json:"vsphereVolume,omitempty"`
// AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
// +optional
AzureDisk *AzureDiskVolumeSource `json:"azureDisk,omitempty"`
}
......@@ -294,6 +348,7 @@ type PersistentVolumeClaimVolumeSource struct {
ClaimName string `json:"claimName"`
// Optional: Defaults to false (read/write). ReadOnly here
// will force the ReadOnly setting in VolumeMounts
// +optional
ReadOnly bool `json:"readOnly,omitempty"`
}
......@@ -302,12 +357,15 @@ type PersistentVolumeClaimVolumeSource struct {
type PersistentVolume struct {
unversioned.TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`
// +optional
ObjectMeta `json:"metadata,omitempty"`
//Spec defines a persistent volume owned by the cluster
// +optional
Spec PersistentVolumeSpec `json:"spec,omitempty"`
// Status represents the current information about persistent volume.
// +optional
Status PersistentVolumeStatus `json:"status,omitempty"`
}
......@@ -317,14 +375,17 @@ type PersistentVolumeSpec struct {
// Source represents the location and type of a volume to mount.
PersistentVolumeSource `json:",inline"`
// AccessModes contains all ways the volume can be mounted
// +optional
AccessModes []PersistentVolumeAccessMode `json:"accessModes,omitempty"`
// ClaimRef is part of a bi-directional binding between PersistentVolume and PersistentVolumeClaim.
// ClaimRef is expected to be non-nil when bound.
// claim.VolumeName is the authoritative bind between PV and PVC.
// When set to non-nil value, PVC.Spec.Selector of the referenced PVC is
// ignored, i.e. labels of this PV do not need to match PVC selector.
// +optional
ClaimRef *ObjectReference `json:"claimRef,omitempty"`
// Optional: what happens to a persistent volume when released from its claim.
// +optional
PersistentVolumeReclaimPolicy PersistentVolumeReclaimPolicy `json:"persistentVolumeReclaimPolicy,omitempty"`
}
......@@ -345,15 +406,19 @@ const (
type PersistentVolumeStatus struct {
// Phase indicates if a volume is available, bound to a claim, or released by a claim
// +optional
Phase PersistentVolumePhase `json:"phase,omitempty"`
// A human-readable message indicating details about why the volume is in this state.
// +optional
Message string `json:"message,omitempty"`
// Reason is a brief CamelCase string that describes any failure and is meant for machine parsing and tidy display in the CLI
// +optional
Reason string `json:"reason,omitempty"`
}
type PersistentVolumeList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
Items []PersistentVolume `json:"items"`
}
......@@ -363,17 +428,21 @@ type PersistentVolumeList struct {
// PersistentVolumeClaim is a user's request for and claim to a persistent volume
type PersistentVolumeClaim struct {
unversioned.TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`
// +optional
ObjectMeta `json:"metadata,omitempty"`
// Spec defines the volume requested by a pod author
// +optional
Spec PersistentVolumeClaimSpec `json:"spec,omitempty"`
// Status represents the current information about a claim
// +optional
Status PersistentVolumeClaimStatus `json:"status,omitempty"`
}
type PersistentVolumeClaimList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
Items []PersistentVolumeClaim `json:"items"`
}
......@@ -382,23 +451,30 @@ type PersistentVolumeClaimList struct {
// and allows a Source for provider-specific attributes
type PersistentVolumeClaimSpec struct {
// Contains the types of access modes required
// +optional
AccessModes []PersistentVolumeAccessMode `json:"accessModes,omitempty"`
// A label query over volumes to consider for binding. This selector is
// ignored when VolumeName is set
// +optional
Selector *unversioned.LabelSelector `json:"selector,omitempty"`
// Resources represents the minimum resources required
// +optional
Resources ResourceRequirements `json:"resources,omitempty"`
// VolumeName is the binding reference to the PersistentVolume backing this
// claim. When set to non-empty value Selector is not evaluated
// +optional
VolumeName string `json:"volumeName,omitempty"`
}
type PersistentVolumeClaimStatus struct {
// Phase represents the current phase of PersistentVolumeClaim
// +optional
Phase PersistentVolumeClaimPhase `json:"phase,omitempty"`
// AccessModes contains all ways the volume backing the PVC can be mounted
// +optional
AccessModes []PersistentVolumeAccessMode `json:"accessModes,omitempty"`
// Represents the actual resources of the underlying volume
// +optional
Capacity ResourceList `json:"capacity,omitempty"`
}
......@@ -459,6 +535,7 @@ type EmptyDirVolumeSource struct {
// this will cover the most common needs.
// Optional: what type of storage medium should back this directory.
// The default is "" which means to use the node's default medium.
// +optional
Medium StorageMedium `json:"medium,omitempty"`
}
......@@ -493,13 +570,16 @@ type GCEPersistentDiskVolumeSource struct {
// Must be a filesystem type supported by the host operating system.
// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
// TODO: how do we prevent errors in the filesystem from compromising the machine
// +optional
FSType string `json:"fsType,omitempty"`
// Optional: Partition on the disk to mount.
// If omitted, kubelet will attempt to mount the device name.
// Ex. For /dev/sda1, this field is "1", for /dev/sda, this field is 0 or empty.
// +optional
Partition int32 `json:"partition,omitempty"`
// Optional: Defaults to false (read/write). ReadOnly here will force
// the ReadOnly setting in VolumeMounts.
// +optional
ReadOnly bool `json:"readOnly,omitempty"`
}
......@@ -509,20 +589,26 @@ type GCEPersistentDiskVolumeSource struct {
type ISCSIVolumeSource struct {
// Required: iSCSI target portal
// the portal is either an IP or ip_addr:port if port is other than default (typically TCP ports 860 and 3260)
// +optional
TargetPortal string `json:"targetPortal,omitempty"`
// Required: target iSCSI Qualified Name
// +optional
IQN string `json:"iqn,omitempty"`
// Required: iSCSI target lun number
// +optional
Lun int32 `json:"lun,omitempty"`
// Optional: Defaults to 'default' (tcp). iSCSI interface name that uses an iSCSI transport.
// +optional
ISCSIInterface string `json:"iscsiInterface,omitempty"`
// Filesystem type to mount.
// Must be a filesystem type supported by the host operating system.
// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
// TODO: how do we prevent errors in the filesystem from compromising the machine
// +optional
FSType string `json:"fsType,omitempty"`
// Optional: Defaults to false (read/write). ReadOnly here will force
// the ReadOnly setting in VolumeMounts.
// +optional
ReadOnly bool `json:"readOnly,omitempty"`
}
......@@ -538,9 +624,11 @@ type FCVolumeSource struct {
// Must be a filesystem type supported by the host operating system.
// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
// TODO: how do we prevent errors in the filesystem from compromising the machine
// +optional
FSType string `json:"fsType,omitempty"`
// Optional: Defaults to false (read/write). ReadOnly here will force
// the ReadOnly setting in VolumeMounts.
// +optional
ReadOnly bool `json:"readOnly,omitempty"`
}
......@@ -552,17 +640,21 @@ type FlexVolumeSource struct {
// Filesystem type to mount.
// Must be a filesystem type supported by the host operating system.
// Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script.
// +optional
FSType string `json:"fsType,omitempty"`
// Optional: SecretRef is reference to the secret object containing
// sensitive information to pass to the plugin scripts. This may be
// empty if no secret object is specified. If the secret object
// contains more than one secret, all secrets are passed to the plugin
// scripts.
// +optional
SecretRef *LocalObjectReference `json:"secretRef,omitempty"`
// Optional: Defaults to false (read/write). ReadOnly here will force
// the ReadOnly setting in VolumeMounts.
// +optional
ReadOnly bool `json:"readOnly,omitempty"`
// Optional: Extra driver options if any.
// +optional
Options map[string]string `json:"options,omitempty"`
}
......@@ -579,13 +671,16 @@ type AWSElasticBlockStoreVolumeSource struct {
// Must be a filesystem type supported by the host operating system.
// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
// TODO: how do we prevent errors in the filesystem from compromising the machine
// +optional
FSType string `json:"fsType,omitempty"`
// Optional: Partition on the disk to mount.
// If omitted, kubelet will attempt to mount the device name.
// Ex. For /dev/sda1, this field is "1", for /dev/sda, this field is 0 or empty.
// +optional
Partition int32 `json:"partition,omitempty"`
// Optional: Defaults to false (read/write). ReadOnly here will force
// the ReadOnly setting in VolumeMounts.
// +optional
ReadOnly bool `json:"readOnly,omitempty"`
}
......@@ -596,11 +691,13 @@ type GitRepoVolumeSource struct {
// Repository URL
Repository string `json:"repository"`
// Commit hash, this is optional
// +optional
Revision string `json:"revision,omitempty"`
// Clone target, this is optional
// Must not contain or start with '..'. If '.' is supplied, the volume directory will be the
// git repository. Otherwise, if specified, the volume will contain the git repository in
// the subdirectory with the given name.
// +optional
Directory string `json:"directory,omitempty"`
// TODO: Consider credentials here.
}
......@@ -612,6 +709,7 @@ type GitRepoVolumeSource struct {
// Secret volumes support ownership management and SELinux relabeling.
type SecretVolumeSource struct {
// Name of the secret in the pod's namespace to use.
// +optional
SecretName string `json:"secretName,omitempty"`
// If unspecified, each key-value pair in the Data field of the referenced
// Secret will be projected into the volume as a file whose name is the
......@@ -620,12 +718,14 @@ type SecretVolumeSource struct {
// present. If a key is specified which is not present in the Secret,
// the volume setup will error. Paths must be relative and may not contain
// the '..' path or start with '..'.
// +optional
Items []KeyToPath `json:"items,omitempty"`
// Mode bits to use on created files by default. Must be a value between
// 0 and 0777.
// Directories within the path are not affected by this setting.
// This might be in conflict with other options that affect the file
// mode, like fsGroup, and the result can be other mode bits set.
// +optional
DefaultMode *int32 `json:"defaultMode,omitempty"`
}
......@@ -640,6 +740,7 @@ type NFSVolumeSource struct {
// Optional: Defaults to false (read/write). ReadOnly here will force
// the NFS export to be mounted with read-only permissions
// +optional
ReadOnly bool `json:"readOnly,omitempty"`
}
......@@ -656,14 +757,17 @@ type QuobyteVolumeSource struct {
// Defaults to false (read/write). ReadOnly here will force
// the Quobyte to be mounted with read-only permissions
// +optional
ReadOnly bool `json:"readOnly,omitempty"`
// User to map volume access to
// Defaults to the root user
// +optional
User string `json:"user,omitempty"`
// Group to map volume access to
// Default is no group
// +optional
Group string `json:"group,omitempty"`
}
......@@ -678,6 +782,7 @@ type GlusterfsVolumeSource struct {
// Optional: Defaults to false (read/write). ReadOnly here will force
// the Glusterfs to be mounted with read-only permissions
// +optional
ReadOnly bool `json:"readOnly,omitempty"`
}
......@@ -692,17 +797,23 @@ type RBDVolumeSource struct {
// Must be a filesystem type supported by the host operating system.
// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
// TODO: how do we prevent errors in the filesystem from compromising the machine
// +optional
FSType string `json:"fsType,omitempty"`
// Optional: RadosPool is the rados pool name,default is rbd
// +optional
RBDPool string `json:"pool,omitempty"`
// Optional: RBDUser is the rados user name, default is admin
// +optional
RadosUser string `json:"user,omitempty"`
// Optional: Keyring is the path to key ring for RBDUser, default is /etc/ceph/keyring
// +optional
Keyring string `json:"keyring,omitempty"`
// Optional: SecretRef is name of the authentication secret for RBDUser, default is nil.
// +optional
SecretRef *LocalObjectReference `json:"secretRef,omitempty"`
// Optional: Defaults to false (read/write). ReadOnly here will force
// the ReadOnly setting in VolumeMounts.
// +optional
ReadOnly bool `json:"readOnly,omitempty"`
}
......@@ -716,9 +827,11 @@ type CinderVolumeSource struct {
// Filesystem type to mount.
// Must be a filesystem type supported by the host operating system.
// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
// +optional
FSType string `json:"fsType,omitempty"`
// Optional: Defaults to false (read/write). ReadOnly here will force
// the ReadOnly setting in VolumeMounts.
// +optional
ReadOnly bool `json:"readOnly,omitempty"`
}
......@@ -728,15 +841,20 @@ type CephFSVolumeSource struct {
// Required: Monitors is a collection of Ceph monitors
Monitors []string `json:"monitors"`
// Optional: Used as the mounted root, rather than the full Ceph tree, default is /
// +optional
Path string `json:"path,omitempty"`
// Optional: User is the rados user name, default is admin
// +optional
User string `json:"user,omitempty"`
// Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret
// +optional
SecretFile string `json:"secretFile,omitempty"`
// Optional: SecretRef is reference to the authentication secret for User, default is empty.
// +optional
SecretRef *LocalObjectReference `json:"secretRef,omitempty"`
// Optional: Defaults to false (read/write). ReadOnly here will force
// the ReadOnly setting in VolumeMounts.
// +optional
ReadOnly bool `json:"readOnly,omitempty"`
}
......@@ -746,8 +864,10 @@ type CephFSVolumeSource struct {
type FlockerVolumeSource struct {
// Name of the dataset stored as metadata -> name on the dataset for Flocker
// should be considered as deprecated
// +optional
DatasetName string `json:"datasetName,omitempty"`
// UUID of the dataset. This is unique identifier of a Flocker dataset
// +optional
DatasetUUID string `json:"datasetUUID,omitempty"`
}
......@@ -755,12 +875,14 @@ type FlockerVolumeSource struct {
// Downward API volumes support ownership management and SELinux relabeling.
type DownwardAPIVolumeSource struct {
// Items is a list of DownwardAPIVolume file
// +optional
Items []DownwardAPIVolumeFile `json:"items,omitempty"`
// Mode bits to use on created files by default. Must be a value between
// 0 and 0777.
// Directories within the path are not affected by this setting.
// This might be in conflict with other options that affect the file
// mode, like fsGroup, and the result can be other mode bits set.
// +optional
DefaultMode *int32 `json:"defaultMode,omitempty"`
}
......@@ -769,14 +891,17 @@ type DownwardAPIVolumeFile struct {
// Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'
Path string `json:"path"`
// Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.
// +optional
FieldRef *ObjectFieldSelector `json:"fieldRef,omitempty"`
// Selects a resource of the container: only resources limits and requests
// (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.
// +optional
ResourceFieldRef *ResourceFieldSelector `json:"resourceFieldRef,omitempty"`
// Optional: mode bits to use on this file, must be a value between 0
// and 0777. If not specified, the volume defaultMode will be used.
// This might be in conflict with other options that affect the file
// mode, like fsGroup, and the result can be other mode bits set.
// +optional
Mode *int32 `json:"mode,omitempty"`
}
......@@ -788,6 +913,7 @@ type AzureFileVolumeSource struct {
ShareName string `json:"shareName"`
// Defaults to false (read/write). ReadOnly here will force
// the ReadOnly setting in VolumeMounts.
// +optional
ReadOnly bool `json:"readOnly,omitempty"`
}
......@@ -798,6 +924,7 @@ type VsphereVirtualDiskVolumeSource struct {
// Filesystem type to mount.
// Must be a filesystem type supported by the host operating system.
// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
// +optional
FSType string `json:"fsType,omitempty"`
}
......@@ -816,13 +943,16 @@ type AzureDiskVolumeSource struct {
// The URI the the data disk in the blob storage
DataDiskURI string `json:"diskURI"`
// Host Caching mode: None, Read Only, Read Write.
// +optional
CachingMode *AzureDataDiskCachingMode `json:"cachingMode,omitempty"`
// Filesystem type to mount.
// Must be a filesystem type supported by the host operating system.
// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
// +optional
FSType *string `json:"fsType,omitempty"`
// Defaults to false (read/write). ReadOnly here will force
// the ReadOnly setting in VolumeMounts.
// +optional
ReadOnly *bool `json:"readOnly,omitempty"`
}
......@@ -841,12 +971,14 @@ type ConfigMapVolumeSource struct {
// present. If a key is specified which is not present in the ConfigMap,
// the volume setup will error. Paths must be relative and may not contain
// the '..' path or start with '..'.
// +optional
Items []KeyToPath `json:"items,omitempty"`
// Mode bits to use on created files by default. Must be a value between
// 0 and 0777.
// Directories within the path are not affected by this setting.
// This might be in conflict with other options that affect the file
// mode, like fsGroup, and the result can be other mode bits set.
// +optional
DefaultMode *int32 `json:"defaultMode,omitempty"`
}
......@@ -864,6 +996,7 @@ type KeyToPath struct {
// and 0777. If not specified, the volume defaultMode will be used.
// This might be in conflict with other options that affect the file
// mode, like fsGroup, and the result can be other mode bits set.
// +optional
Mode *int32 `json:"mode,omitempty"`
}
......@@ -871,15 +1004,19 @@ type KeyToPath struct {
type ContainerPort struct {
// Optional: If specified, this must be an IANA_SVC_NAME Each named port
// in a pod must have a unique name.
// +optional
Name string `json:"name,omitempty"`
// Optional: If specified, this must be a valid port number, 0 < x < 65536.
// If HostNetwork is specified, this must match ContainerPort.
// +optional
HostPort int32 `json:"hostPort,omitempty"`
// Required: This must be a valid port number, 0 < x < 65536.
ContainerPort int32 `json:"containerPort"`
// Required: Supports "TCP" and "UDP".
// +optional
Protocol Protocol `json:"protocol,omitempty"`
// Optional: What host IP to bind the external port to.
// +optional
HostIP string `json:"hostIP,omitempty"`
}
......@@ -888,11 +1025,13 @@ type VolumeMount struct {
// Required: This must match the Name of a Volume [above].
Name string `json:"name"`
// Optional: Defaults to false (read-write).
// +optional
ReadOnly bool `json:"readOnly,omitempty"`
// Required. Must not contain ':'.
MountPath string `json:"mountPath"`
// Path within the volume from which the container's volume should be mounted.
// Defaults to "" (volume's root).
// +optional
SubPath string `json:"subPath,omitempty"`
}
......@@ -908,8 +1047,10 @@ type EnvVar struct {
// syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped
// references will never be expanded, regardless of whether the variable
// exists or not.
// +optional
Value string `json:"value,omitempty"`
// Optional: Specifies a source the value of this var should come from.
// +optional
ValueFrom *EnvVarSource `json:"valueFrom,omitempty"`
}
......@@ -918,13 +1059,17 @@ type EnvVar struct {
type EnvVarSource struct {
// Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations,
// spec.nodeName, spec.serviceAccountName, status.podIP.
// +optional
FieldRef *ObjectFieldSelector `json:"fieldRef,omitempty"`
// Selects a resource of the container: only resources limits and requests
// (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.
// +optional
ResourceFieldRef *ResourceFieldSelector `json:"resourceFieldRef,omitempty"`
// Selects a key of a ConfigMap.
// +optional
ConfigMapKeyRef *ConfigMapKeySelector `json:"configMapKeyRef,omitempty"`
// Selects a key of a secret in the pod's namespace.
// +optional
SecretKeyRef *SecretKeySelector `json:"secretKeyRef,omitempty"`
}
......@@ -941,10 +1086,12 @@ type ObjectFieldSelector struct {
// ResourceFieldSelector represents container resources (cpu, memory) and their output format
type ResourceFieldSelector struct {
// Container name: required for volumes, optional for env vars
// +optional
ContainerName string `json:"containerName,omitempty"`
// Required: resource to select
Resource string `json:"resource"`
// Specifies the output format of the exposed resources, defaults to "1"
// +optional
Divisor resource.Quantity `json:"divisor,omitempty"`
}
......@@ -975,15 +1122,20 @@ type HTTPHeader struct {
// HTTPGetAction describes an action based on HTTP Get requests.
type HTTPGetAction struct {
// Optional: Path to access on the HTTP server.
// +optional
Path string `json:"path,omitempty"`
// Required: Name or number of the port to access on the container.
// +optional
Port intstr.IntOrString `json:"port,omitempty"`
// Optional: Host name to connect to, defaults to the pod IP. You
// probably want to set "Host" in httpHeaders instead.
// +optional
Host string `json:"host,omitempty"`
// Optional: Scheme to use for connecting to the host, defaults to HTTP.
// +optional
Scheme URIScheme `json:"scheme,omitempty"`
// Optional: Custom headers to set in the request. HTTP allows repeated headers.
// +optional
HTTPHeaders []HTTPHeader `json:"httpHeaders,omitempty"`
}
......@@ -1000,6 +1152,7 @@ const (
// TCPSocketAction describes an action based on opening a socket
type TCPSocketAction struct {
// Required: Port to connect to.
// +optional
Port intstr.IntOrString `json:"port,omitempty"`
}
......@@ -1009,6 +1162,7 @@ type ExecAction struct {
// command is root ('/') in the container's filesystem. The command is simply exec'd, it is
// not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use
// a shell, you need to explicitly call out to that shell.
// +optional
Command []string `json:"command,omitempty"`
}
......@@ -1018,15 +1172,20 @@ type Probe struct {
// The action taken to determine the health of a container
Handler `json:",inline"`
// Length of time before health checking is activated. In seconds.
// +optional
InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty"`
// Length of time before health checking times out. In seconds.
// +optional
TimeoutSeconds int32 `json:"timeoutSeconds,omitempty"`
// How often (in seconds) to perform the probe.
// +optional
PeriodSeconds int32 `json:"periodSeconds,omitempty"`
// Minimum consecutive successes for the probe to be considered successful after having failed.
// Must be 1 for liveness.
// +optional
SuccessThreshold int32 `json:"successThreshold,omitempty"`
// Minimum consecutive failures for the probe to be considered failed after having succeeded.
// +optional
FailureThreshold int32 `json:"failureThreshold,omitempty"`
}
......@@ -1048,18 +1207,22 @@ type Capability string
// Capabilities represent POSIX capabilities that can be added or removed to a running container.
type Capabilities struct {
// Added capabilities
// +optional
Add []Capability `json:"add,omitempty"`
// Removed capabilities
// +optional
Drop []Capability `json:"drop,omitempty"`
}
// ResourceRequirements describes the compute resource requirements.
type ResourceRequirements struct {
// Limits describes the maximum amount of compute resources allowed.
// +optional
Limits ResourceList `json:"limits,omitempty"`
// Requests describes the minimum amount of compute resources required.
// If Request is omitted for a container, it defaults to Limits if that is explicitly specified,
// otherwise to an implementation-defined value
// +optional
Requests ResourceList `json:"requests,omitempty"`
}
......@@ -1075,36 +1238,51 @@ type Container struct {
// cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax
// can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded,
// regardless of whether the variable exists or not.
// +optional
Command []string `json:"command,omitempty"`
// Optional: The docker image's cmd is used if this is not provided; cannot be updated.
// Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
// cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax
// can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded,
// regardless of whether the variable exists or not.
// +optional
Args []string `json:"args,omitempty"`
// Optional: Defaults to Docker's default.
WorkingDir string `json:"workingDir,omitempty"`
Ports []ContainerPort `json:"ports,omitempty"`
Env []EnvVar `json:"env,omitempty"`
// +optional
WorkingDir string `json:"workingDir,omitempty"`
// +optional
Ports []ContainerPort `json:"ports,omitempty"`
// +optional
Env []EnvVar `json:"env,omitempty"`
// Compute resource requirements.
Resources ResourceRequirements `json:"resources,omitempty"`
VolumeMounts []VolumeMount `json:"volumeMounts,omitempty"`
LivenessProbe *Probe `json:"livenessProbe,omitempty"`
ReadinessProbe *Probe `json:"readinessProbe,omitempty"`
Lifecycle *Lifecycle `json:"lifecycle,omitempty"`
// +optional
Resources ResourceRequirements `json:"resources,omitempty"`
// +optional
VolumeMounts []VolumeMount `json:"volumeMounts,omitempty"`
// +optional
LivenessProbe *Probe `json:"livenessProbe,omitempty"`
// +optional
ReadinessProbe *Probe `json:"readinessProbe,omitempty"`
// +optional
Lifecycle *Lifecycle `json:"lifecycle,omitempty"`
// Required.
// +optional
TerminationMessagePath string `json:"terminationMessagePath,omitempty"`
// Required: Policy for pulling images for this container
ImagePullPolicy PullPolicy `json:"imagePullPolicy"`
// Optional: SecurityContext defines the security options the container should be run with.
// If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.
// +optional
SecurityContext *SecurityContext `json:"securityContext,omitempty"`
// Variables for interactive containers, these have very specialized use-cases (e.g. debugging)
// and shouldn't be used for general purpose containers.
Stdin bool `json:"stdin,omitempty"`
// +optional
Stdin bool `json:"stdin,omitempty"`
// +optional
StdinOnce bool `json:"stdinOnce,omitempty"`
TTY bool `json:"tty,omitempty"`
// +optional
TTY bool `json:"tty,omitempty"`
}
// Handler defines a specific action that should be taken
......@@ -1112,11 +1290,14 @@ type Container struct {
type Handler struct {
// One and only one of the following should be specified.
// Exec specifies the action to take.
// +optional
Exec *ExecAction `json:"exec,omitempty"`
// HTTPGet specifies the http request to perform.
// +optional
HTTPGet *HTTPGetAction `json:"httpGet,omitempty"`
// TCPSocket specifies an action involving a TCP port.
// TODO: implement a realistic TCP lifecycle hook
// +optional
TCPSocket *TCPSocketAction `json:"tcpSocket,omitempty"`
}
......@@ -1126,9 +1307,11 @@ type Handler struct {
type Lifecycle struct {
// PostStart is called immediately after a container is created. If the handler fails, the container
// is terminated and restarted.
// +optional
PostStart *Handler `json:"postStart,omitempty"`
// PreStop is called immediately before a container is terminated. The reason for termination is
// passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated.
// +optional
PreStop *Handler `json:"preStop,omitempty"`
}
......@@ -1148,38 +1331,52 @@ const (
type ContainerStateWaiting struct {
// A brief CamelCase string indicating details about why the container is in waiting state.
// +optional
Reason string `json:"reason,omitempty"`
// A human-readable message indicating details about why the container is in waiting state.
// +optional
Message string `json:"message,omitempty"`
}
type ContainerStateRunning struct {
// +optional
StartedAt unversioned.Time `json:"startedAt,omitempty"`
}
type ContainerStateTerminated struct {
ExitCode int32 `json:"exitCode"`
Signal int32 `json:"signal,omitempty"`
Reason string `json:"reason,omitempty"`
Message string `json:"message,omitempty"`
StartedAt unversioned.Time `json:"startedAt,omitempty"`
FinishedAt unversioned.Time `json:"finishedAt,omitempty"`
ContainerID string `json:"containerID,omitempty"`
ExitCode int32 `json:"exitCode"`
// +optional
Signal int32 `json:"signal,omitempty"`
// +optional
Reason string `json:"reason,omitempty"`
// +optional
Message string `json:"message,omitempty"`
// +optional
StartedAt unversioned.Time `json:"startedAt,omitempty"`
// +optional
FinishedAt unversioned.Time `json:"finishedAt,omitempty"`
// +optional
ContainerID string `json:"containerID,omitempty"`
}
// ContainerState holds a possible state of container.
// Only one of its members may be specified.
// If none of them is specified, the default one is ContainerStateWaiting.
type ContainerState struct {
Waiting *ContainerStateWaiting `json:"waiting,omitempty"`
Running *ContainerStateRunning `json:"running,omitempty"`
// +optional
Waiting *ContainerStateWaiting `json:"waiting,omitempty"`
// +optional
Running *ContainerStateRunning `json:"running,omitempty"`
// +optional
Terminated *ContainerStateTerminated `json:"terminated,omitempty"`
}
type ContainerStatus struct {
// Each container in a pod must have a unique name.
Name string `json:"name"`
State ContainerState `json:"state,omitempty"`
Name string `json:"name"`
// +optional
State ContainerState `json:"state,omitempty"`
// +optional
LastTerminationState ContainerState `json:"lastState,omitempty"`
// Ready specifies whether the container has passed its readiness check.
Ready bool `json:"ready"`
......@@ -1188,7 +1385,8 @@ type ContainerStatus struct {
RestartCount int32 `json:"restartCount"`
Image string `json:"image"`
ImageID string `json:"imageID"`
ContainerID string `json:"containerID,omitempty"`
// +optional
ContainerID string `json:"containerID,omitempty"`
}
// PodPhase is a label for the condition of a pod at the current time.
......@@ -1228,12 +1426,16 @@ const (
)
type PodCondition struct {
Type PodConditionType `json:"type"`
Status ConditionStatus `json:"status"`
LastProbeTime unversioned.Time `json:"lastProbeTime,omitempty"`
Type PodConditionType `json:"type"`
Status ConditionStatus `json:"status"`
// +optional
LastProbeTime unversioned.Time `json:"lastProbeTime,omitempty"`
// +optional
LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty"`
Reason string `json:"reason,omitempty"`
Message string `json:"message,omitempty"`
// +optional
Reason string `json:"reason,omitempty"`
// +optional
Message string `json:"message,omitempty"`
}
// RestartPolicy describes how the container should be restarted.
......@@ -1251,6 +1453,7 @@ const (
// PodList is a list of Pods.
type PodList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
Items []Pod `json:"items"`
......@@ -1297,6 +1500,7 @@ type NodeSelectorRequirement struct {
// the values array must be empty. If the operator is Gt or Lt, the values
// array must have a single element, which will be interpreted as an integer.
// This array is replaced during a strategic merge patch.
// +optional
Values []string `json:"values,omitempty"`
}
......@@ -1316,10 +1520,13 @@ const (
// Affinity is a group of affinity scheduling rules.
type Affinity struct {
// Describes node affinity scheduling rules for the pod.
// +optional
NodeAffinity *NodeAffinity `json:"nodeAffinity,omitempty"`
// Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).
// +optional
PodAffinity *PodAffinity `json:"podAffinity,omitempty"`
// Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).
// +optional
PodAntiAffinity *PodAntiAffinity `json:"podAntiAffinity,omitempty"`
}
......@@ -1333,6 +1540,7 @@ type PodAffinity struct {
// system will try to eventually evict the pod from its node.
// When there are multiple elements, the lists of nodes corresponding to each
// podAffinityTerm are intersected, i.e. all terms must be satisfied.
// +optional
// RequiredDuringSchedulingRequiredDuringExecution []PodAffinityTerm `json:"requiredDuringSchedulingRequiredDuringExecution,omitempty"`
// If the affinity requirements specified by this field are not met at
// scheduling time, the pod will not be scheduled onto the node.
......@@ -1341,6 +1549,7 @@ type PodAffinity struct {
// system may or may not try to eventually evict the pod from its node.
// When there are multiple elements, the lists of nodes corresponding to each
// podAffinityTerm are intersected, i.e. all terms must be satisfied.
// +optional
RequiredDuringSchedulingIgnoredDuringExecution []PodAffinityTerm `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"`
// The scheduler will prefer to schedule pods to nodes that satisfy
// the affinity expressions specified by this field, but it may choose
......@@ -1351,6 +1560,7 @@ type PodAffinity struct {
// compute a sum by iterating through the elements of this field and adding
// "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
// node(s) with the highest sum are the most preferred.
// +optional
PreferredDuringSchedulingIgnoredDuringExecution []WeightedPodAffinityTerm `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"`
}
......@@ -1364,6 +1574,7 @@ type PodAntiAffinity struct {
// system will try to eventually evict the pod from its node.
// When there are multiple elements, the lists of nodes corresponding to each
// podAffinityTerm are intersected, i.e. all terms must be satisfied.
// +optional
// RequiredDuringSchedulingRequiredDuringExecution []PodAffinityTerm `json:"requiredDuringSchedulingRequiredDuringExecution,omitempty"`
// If the anti-affinity requirements specified by this field are not met at
// scheduling time, the pod will not be scheduled onto the node.
......@@ -1372,6 +1583,7 @@ type PodAntiAffinity struct {
// system may or may not try to eventually evict the pod from its node.
// When there are multiple elements, the lists of nodes corresponding to each
// podAffinityTerm are intersected, i.e. all terms must be satisfied.
// +optional
RequiredDuringSchedulingIgnoredDuringExecution []PodAffinityTerm `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"`
// The scheduler will prefer to schedule pods to nodes that satisfy
// the anti-affinity expressions specified by this field, but it may choose
......@@ -1382,6 +1594,7 @@ type PodAntiAffinity struct {
// compute a sum by iterating through the elements of this field and adding
// "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
// node(s) with the highest sum are the most preferred.
// +optional
PreferredDuringSchedulingIgnoredDuringExecution []WeightedPodAffinityTerm `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"`
}
......@@ -1402,6 +1615,7 @@ type WeightedPodAffinityTerm struct {
// a pod of the set of pods is running.
type PodAffinityTerm struct {
// A label query over a set of resources, in this case pods.
// +optional
LabelSelector *unversioned.LabelSelector `json:"labelSelector,omitempty"`
// namespaces specifies which namespaces the labelSelector applies to (matches against);
// nil list means "this pod's namespace," empty list means "all namespaces"
......@@ -1415,6 +1629,7 @@ type PodAffinityTerm struct {
// For PreferredDuringScheduling pod anti-affinity, empty topologyKey is interpreted as "all topologies"
// ("all topologies" here means all the topologyKeys indicated by scheduler command-line argument --failure-domains);
// for affinity and for RequiredDuringScheduling pod anti-affinity, empty topologyKey is not allowed.
// +optional
TopologyKey string `json:"topologyKey,omitempty"`
}
......@@ -1426,6 +1641,7 @@ type NodeAffinity struct {
// If the affinity requirements specified by this field cease to be met
// at some point during pod execution (e.g. due to an update), the system
// will try to eventually evict the pod from its node.
// +optional
// RequiredDuringSchedulingRequiredDuringExecution *NodeSelector `json:"requiredDuringSchedulingRequiredDuringExecution,omitempty"`
// If the affinity requirements specified by this field are not met at
......@@ -1433,6 +1649,7 @@ type NodeAffinity struct {
// If the affinity requirements specified by this field cease to be met
// at some point during pod execution (e.g. due to an update), the system
// may or may not try to eventually evict the pod from its node.
// +optional
RequiredDuringSchedulingIgnoredDuringExecution *NodeSelector `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"`
// The scheduler will prefer to schedule pods to nodes that satisfy
// the affinity expressions specified by this field, but it may choose
......@@ -1443,6 +1660,7 @@ type NodeAffinity struct {
// compute a sum by iterating through the elements of this field and adding
// "weight" to the sum if the node matches the corresponding matchExpressions; the
// node(s) with the highest sum are the most preferred.
// +optional
PreferredDuringSchedulingIgnoredDuringExecution []PreferredSchedulingTerm `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"`
}
......@@ -1461,6 +1679,7 @@ type Taint struct {
// Required. The taint key to be applied to a node.
Key string `json:"key" patchStrategy:"merge" patchMergeKey:"key"`
// Required. The taint value corresponding to the taint key.
// +optional
Value string `json:"value,omitempty"`
// Required. The effect of the taint on pods
// that do not tolerate the taint.
......@@ -1498,17 +1717,21 @@ const (
// the triple <key,value,effect> using the matching operator <operator>.
type Toleration struct {
// Required. Key is the taint key that the toleration applies to.
// +optional
Key string `json:"key,omitempty" patchStrategy:"merge" patchMergeKey:"key"`
// operator represents a key's relationship to the value.
// Valid operators are Exists and Equal. Defaults to Equal.
// Exists is equivalent to wildcard for value, so that a pod can
// tolerate all taints of a particular category.
// +optional
Operator TolerationOperator `json:"operator,omitempty"`
// Value is the taint value the toleration matches to.
// If the operator is Exists, the value should be empty, otherwise just a regular string.
// +optional
Value string `json:"value,omitempty"`
// Effect indicates the taint effect to match. Empty means match all taint effects.
// When specified, allowed values are NoSchedule and PreferNoSchedule.
// +optional
Effect TaintEffect `json:"effect,omitempty"`
// TODO: For forgiveness (#1574), we'd eventually add at least a grace period
// here, and possibly an occurrence threshold and period.
......@@ -1528,7 +1751,8 @@ type PodSpec struct {
// List of initialization containers belonging to the pod.
InitContainers []Container `json:"-"`
// List of containers belonging to the pod.
Containers []Container `json:"containers"`
Containers []Container `json:"containers"`
// +optional
RestartPolicy RestartPolicy `json:"restartPolicy,omitempty"`
// Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request.
// Value must be non-negative integer. The value zero indicates delete immediately.
......@@ -1536,13 +1760,17 @@ type PodSpec struct {
// The grace period is the duration in seconds after the processes running in the pod are sent
// a termination signal and the time when the processes are forcibly halted with a kill signal.
// Set this value longer than the expected cleanup time for your process.
// +optional
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
// Optional duration in seconds relative to the StartTime that the pod may be active on a node
// before the system actively tries to terminate the pod; value must be positive integer
// +optional
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`
// Required: Set DNS policy.
// +optional
DNSPolicy DNSPolicy `json:"dnsPolicy,omitempty"`
// NodeSelector is a selector which must be true for the pod to fit on a node
// +optional
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// ServiceAccountName is the name of the ServiceAccount to use to run this pod
......@@ -1552,19 +1780,24 @@ type PodSpec struct {
// NodeName is a request to schedule this pod onto a specific node. If it is non-empty,
// the scheduler simply schedules this pod onto that node, assuming that it fits resource
// requirements.
// +optional
NodeName string `json:"nodeName,omitempty"`
// SecurityContext holds pod-level security attributes and common container settings.
// Optional: Defaults to empty. See type description for default values of each field.
// +optional
SecurityContext *PodSecurityContext `json:"securityContext,omitempty"`
// ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec.
// If specified, these secrets will be passed to individual puller implementations for them to use. For example,
// in the case of docker, only DockerConfig type secrets are honored.
// +optional
ImagePullSecrets []LocalObjectReference `json:"imagePullSecrets,omitempty"`
// Specifies the hostname of the Pod.
// If not specified, the pod's hostname will be set to a system-defined value.
// +optional
Hostname string `json:"hostname,omitempty"`
// If specified, the fully qualified Pod hostname will be "<hostname>.<subdomain>.<pod namespace>.svc.<cluster domain>".
// If not specified, the pod will not have a domainname at all.
// +optional
Subdomain string `json:"subdomain,omitempty"`
}
......@@ -1584,26 +1817,31 @@ type PodSecurityContext struct {
// used must be specified.
// Optional: Default to false
// +k8s:conversion-gen=false
// +optional
HostNetwork bool `json:"hostNetwork,omitempty"`
// Use the host's pid namespace.
// Optional: Default to false.
// +k8s:conversion-gen=false
// +optional
HostPID bool `json:"hostPID,omitempty"`
// Use the host's ipc namespace.
// Optional: Default to false.
// +k8s:conversion-gen=false
// +optional
HostIPC bool `json:"hostIPC,omitempty"`
// The SELinux context to be applied to all containers.
// If unspecified, the container runtime will allocate a random SELinux context for each
// container. May also be set in SecurityContext. If set in
// both SecurityContext and PodSecurityContext, the value specified in SecurityContext
// takes precedence for that container.
// +optional
SELinuxOptions *SELinuxOptions `json:"seLinuxOptions,omitempty"`
// The UID to run the entrypoint of the container process.
// Defaults to user specified in image metadata if unspecified.
// May also be set in SecurityContext. If set in both SecurityContext and
// PodSecurityContext, the value specified in SecurityContext takes precedence
// for that container.
// +optional
RunAsUser *int64 `json:"runAsUser,omitempty"`
// Indicates that the container must run as a non-root user.
// If true, the Kubelet will validate the image at runtime to ensure that it
......@@ -1611,10 +1849,12 @@ type PodSecurityContext struct {
// If unset or false, no such validation will be performed.
// May also be set in SecurityContext. If set in both SecurityContext and
// PodSecurityContext, the value specified in SecurityContext takes precedence.
// +optional
RunAsNonRoot *bool `json:"runAsNonRoot,omitempty"`
// A list of groups applied to the first process run in each container, in addition
// to the container's primary GID. If unspecified, no groups will be added to
// any container.
// +optional
SupplementalGroups []int64 `json:"supplementalGroups,omitempty"`
// A special supplemental group that applies to all containers in a pod.
// Some volume types allow the Kubelet to change the ownership of that volume
......@@ -1625,24 +1865,32 @@ type PodSecurityContext struct {
// 3. The permission bits are OR'd with rw-rw----
//
// If unset, the Kubelet will not modify the ownership and permissions of any volume.
// +optional
FSGroup *int64 `json:"fsGroup,omitempty"`
}
// PodStatus represents information about the status of a pod. Status may trail the actual
// state of a system.
type PodStatus struct {
Phase PodPhase `json:"phase,omitempty"`
// +optional
Phase PodPhase `json:"phase,omitempty"`
// +optional
Conditions []PodCondition `json:"conditions,omitempty"`
// A human readable message indicating details about why the pod is in this state.
// +optional
Message string `json:"message,omitempty"`
// A brief CamelCase message indicating details about why the pod is in this state. e.g. 'OutOfDisk'
// +optional
Reason string `json:"reason,omitempty"`
// +optional
HostIP string `json:"hostIP,omitempty"`
PodIP string `json:"podIP,omitempty"`
// +optional
PodIP string `json:"podIP,omitempty"`
// Date and time at which the object was acknowledged by the Kubelet.
// This is before the Kubelet pulled the container image(s) for the pod.
// +optional
StartTime *unversioned.Time `json:"startTime,omitempty"`
// The list has one entry per init container in the manifest. The most recent successful
......@@ -1655,15 +1903,18 @@ type PodStatus struct {
// final and should not be relied upon.
// TODO: Make real decisions about what our info should look like. Re-enable fuzz test
// when we have done this.
// +optional
ContainerStatuses []ContainerStatus `json:"containerStatuses,omitempty"`
}
// PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded
type PodStatusResult struct {
unversioned.TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`
// +optional
ObjectMeta `json:"metadata,omitempty"`
// Status represents the current information about a pod. This data may not be up
// to date.
// +optional
Status PodStatus `json:"status,omitempty"`
}
......@@ -1672,22 +1923,27 @@ type PodStatusResult struct {
// Pod is a collection of containers, used as either input (create, update) or as output (list, get).
type Pod struct {
unversioned.TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`
// +optional
ObjectMeta `json:"metadata,omitempty"`
// Spec defines the behavior of a pod.
// +optional
Spec PodSpec `json:"spec,omitempty"`
// Status represents the current information about a pod. This data may not be up
// to date.
// +optional
Status PodStatus `json:"status,omitempty"`
}
// PodTemplateSpec describes the data a pod should have when created from a template
type PodTemplateSpec struct {
// Metadata of the pods created from this template.
// +optional
ObjectMeta `json:"metadata,omitempty"`
// Spec defines the behavior of a pod.
// +optional
Spec PodSpec `json:"spec,omitempty"`
}
......@@ -1696,15 +1952,18 @@ type PodTemplateSpec struct {
// PodTemplate describes a template for creating copies of a predefined pod.
type PodTemplate struct {
unversioned.TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`
// +optional
ObjectMeta `json:"metadata,omitempty"`
// Template defines the pods that will be created from this pod template
// +optional
Template PodTemplateSpec `json:"template,omitempty"`
}
// PodTemplateList is a list of PodTemplates.
type PodTemplateList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
Items []PodTemplate `json:"items"`
......@@ -1720,6 +1979,7 @@ type ReplicationControllerSpec struct {
// Minimum number of seconds for which a newly created pod should be ready
// without any of its container crashing, for it to be considered available.
// Defaults to 0 (pod will be considered available as soon as it is ready)
// +optional
MinReadySeconds int32 `json:"minReadySeconds,omitempty"`
// Selector is a label query over pods that should match the Replicas count.
......@@ -1728,11 +1988,13 @@ type ReplicationControllerSpec struct {
// TemplateRef is a reference to an object that describes the pod that will be created if
// insufficient replicas are detected. This reference is ignored if a Template is set.
// Must be set before converting to a versioned API object
// +optional
//TemplateRef *ObjectReference `json:"templateRef,omitempty"`
// Template is the object that describes the pod that will be created if
// insufficient replicas are detected. Internally, this takes precedence over a
// TemplateRef.
// +optional
Template *PodTemplateSpec `json:"template,omitempty"`
}
......@@ -1743,18 +2005,23 @@ type ReplicationControllerStatus struct {
Replicas int32 `json:"replicas"`
// The number of pods that have labels matching the labels of the pod template of the replication controller.
// +optional
FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty"`
// The number of ready replicas for this replication controller.
// +optional
ReadyReplicas int32 `json:"readyReplicas,omitempty"`
// The number of available replicas (ready for at least minReadySeconds) for this replication controller.
// +optional
AvailableReplicas int32 `json:"availableReplicas,omitempty"`
// ObservedGeneration is the most recent generation observed by the controller.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// Represents the latest available observations of a replication controller's current state.
// +optional
Conditions []ReplicationControllerCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}
......@@ -1775,12 +2042,16 @@ type ReplicationControllerCondition struct {
// Status of the condition, one of True, False, Unknown.
Status ConditionStatus `json:"status"`
// Last time we probed the condition.
// +optional
LastProbeTime unversioned.Time `json:"lastProbeTime,omitempty"`
// The last time the condition transitioned from one status to another.
// +optional
LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty"`
// The reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty"`
// A human readable message indicating details about the transition.
// +optional
Message string `json:"message,omitempty"`
}
......@@ -1789,19 +2060,23 @@ type ReplicationControllerCondition struct {
// ReplicationController represents the configuration of a replication controller.
type ReplicationController struct {
unversioned.TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`
// +optional
ObjectMeta `json:"metadata,omitempty"`
// Spec defines the desired behavior of this replication controller.
// +optional
Spec ReplicationControllerSpec `json:"spec,omitempty"`
// Status is the current status of this replication controller. This data may be
// out of date by some window of time.
// +optional
Status ReplicationControllerStatus `json:"status,omitempty"`
}
// ReplicationControllerList is a collection of replication controllers.
type ReplicationControllerList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
Items []ReplicationController `json:"items"`
......@@ -1816,6 +2091,7 @@ const (
// ServiceList holds a list of services.
type ServiceList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
Items []Service `json:"items"`
......@@ -1859,6 +2135,7 @@ const (
type ServiceStatus struct {
// LoadBalancer contains the current status of the load-balancer,
// if one is present.
// +optional
LoadBalancer LoadBalancerStatus `json:"loadBalancer,omitempty"`
}
......@@ -1866,6 +2143,7 @@ type ServiceStatus struct {
type LoadBalancerStatus struct {
// Ingress is a list containing ingress points for the load-balancer;
// traffic intended for the service should be sent to these ingress points.
// +optional
Ingress []LoadBalancerIngress `json:"ingress,omitempty"`
}
......@@ -1874,10 +2152,12 @@ type LoadBalancerStatus struct {
type LoadBalancerIngress struct {
// IP is set for load-balancer ingress points that are IP based
// (typically GCE or OpenStack load-balancers)
// +optional
IP string `json:"ip,omitempty"`
// Hostname is set for load-balancer ingress points that are DNS based
// (typically AWS load-balancers)
// +optional
Hostname string `json:"hostname,omitempty"`
}
......@@ -1897,6 +2177,7 @@ type ServiceSpec struct {
// external load-balancer (if supported in the current cloud) which routes
// to the clusterIP.
// More info: http://kubernetes.io/docs/user-guide/services#overview
// +optional
Type ServiceType `json:"type,omitempty"`
// Required: The list of ports that are exposed by this service.
......@@ -1919,6 +2200,7 @@ type ServiceSpec struct {
// Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if
// type is ExternalName.
// More info: http://kubernetes.io/docs/user-guide/services#virtual-ips-and-service-proxies
// +optional
ClusterIP string `json:"clusterIP,omitempty"`
// ExternalName is the external reference that kubedns or equivalent will
......@@ -1928,6 +2210,7 @@ type ServiceSpec struct {
// ExternalIPs are used by external load balancers, or can be set by
// users to handle external traffic that arrives at a node.
// +optional
ExternalIPs []string `json:"externalIPs,omitempty"`
// Only applies to Service Type: LoadBalancer
......@@ -1935,14 +2218,17 @@ type ServiceSpec struct {
// This feature depends on whether the underlying cloud-provider supports specifying
// the loadBalancerIP when a load balancer is created.
// This field will be ignored if the cloud-provider does not support the feature.
// +optional
LoadBalancerIP string `json:"loadBalancerIP,omitempty"`
// Optional: Supports "ClientIP" and "None". Used to maintain session affinity.
// +optional
SessionAffinity ServiceAffinity `json:"sessionAffinity,omitempty"`
// Optional: If specified and supported by the platform, this will restrict traffic through the cloud-provider
// load-balancer will be restricted to the specified client IPs. This field will be ignored if the
// cloud-provider does not support the feature."
// +optional
LoadBalancerSourceRanges []string `json:"loadBalancerSourceRanges,omitempty"`
}
......@@ -1979,12 +2265,15 @@ type ServicePort struct {
// will answer requests sent through the proxy.
type Service struct {
unversioned.TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`
// +optional
ObjectMeta `json:"metadata,omitempty"`
// Spec defines the behavior of a service.
// +optional
Spec ServiceSpec `json:"spec,omitempty"`
// Status represents the current status of a service.
// +optional
Status ServiceStatus `json:"status,omitempty"`
}
......@@ -1996,7 +2285,8 @@ type Service struct {
// * a set of secrets
type ServiceAccount struct {
unversioned.TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`
// +optional
ObjectMeta `json:"metadata,omitempty"`
// Secrets is the list of secrets allowed to be used by pods running using this ServiceAccount
Secrets []ObjectReference `json:"secrets"`
......@@ -2004,12 +2294,14 @@ type ServiceAccount struct {
// ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images
// in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets
// can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet.
// +optional
ImagePullSecrets []LocalObjectReference `json:"imagePullSecrets,omitempty"`
}
// ServiceAccountList is a list of ServiceAccount objects
type ServiceAccountList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
Items []ServiceAccount `json:"items"`
......@@ -2031,7 +2323,8 @@ type ServiceAccountList struct {
// ]
type Endpoints struct {
unversioned.TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`
// +optional
ObjectMeta `json:"metadata,omitempty"`
// The set of all endpoints is the union of all subsets.
Subsets []EndpointSubset
......@@ -2062,8 +2355,10 @@ type EndpointAddress struct {
IP string
// Optional: Hostname of this endpoint
// Meant to be used by DNS servers etc.
// +optional
Hostname string `json:"hostname,omitempty"`
// Optional: Node hosting this endpoint. This can be used to determine endpoints local to a node.
// +optional
NodeName *string `json:"nodeName,omitempty"`
// Optional: The kubernetes object related to the entry point.
TargetRef *ObjectReference
......@@ -2085,6 +2380,7 @@ type EndpointPort struct {
// EndpointsList is a list of endpoints.
type EndpointsList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
Items []Endpoints `json:"items"`
......@@ -2094,16 +2390,20 @@ type EndpointsList struct {
type NodeSpec struct {
// PodCIDR represents the pod IP range assigned to the node
// Note: assigning IP ranges to nodes might need to be revisited when we support migratable IPs.
// +optional
PodCIDR string `json:"podCIDR,omitempty"`
// External ID of the node assigned by some machine database (e.g. a cloud provider)
// +optional
ExternalID string `json:"externalID,omitempty"`
// ID of the node assigned by the cloud provider
// Note: format is "<ProviderName>://<ProviderSpecificNodeID>"
// +optional
ProviderID string `json:"providerID,omitempty"`
// Unschedulable controls node schedulability of new pods. By default node is schedulable.
// +optional
Unschedulable bool `json:"unschedulable,omitempty"`
}
......@@ -2122,6 +2422,7 @@ type DaemonEndpoint struct {
// NodeDaemonEndpoints lists ports opened by daemons running on the Node.
type NodeDaemonEndpoints struct {
// Endpoint on which Kubelet is listening.
// +optional
KubeletEndpoint DaemonEndpoint `json:"kubeletEndpoint,omitempty"`
}
......@@ -2156,24 +2457,34 @@ type NodeSystemInfo struct {
// NodeStatus is information about the current status of a node.
type NodeStatus struct {
// Capacity represents the total resources of a node.
// +optional
Capacity ResourceList `json:"capacity,omitempty"`
// Allocatable represents the resources of a node that are available for scheduling.
// +optional
Allocatable ResourceList `json:"allocatable,omitempty"`
// NodePhase is the current lifecycle phase of the node.
// +optional
Phase NodePhase `json:"phase,omitempty"`
// Conditions is an array of current node conditions.
// +optional
Conditions []NodeCondition `json:"conditions,omitempty"`
// Queried from cloud provider, if available.
// +optional
Addresses []NodeAddress `json:"addresses,omitempty"`
// Endpoints of daemons running on the Node.
// +optional
DaemonEndpoints NodeDaemonEndpoints `json:"daemonEndpoints,omitempty"`
// Set of ids/uuids to uniquely identify the node.
// +optional
NodeInfo NodeSystemInfo `json:"nodeInfo,omitempty"`
// List of container images on this node
// +optional
Images []ContainerImage `json:"images,omitempty"`
// List of attachable volumes in use (mounted) by the node.
// +optional
VolumesInUse []UniqueVolumeName `json:"volumesInUse,omitempty"`
// List of volumes that are attached to the node.
// +optional
VolumesAttached []AttachedVolume `json:"volumesAttached,omitempty"`
}
......@@ -2194,6 +2505,7 @@ type AttachedVolume struct {
type AvoidPods struct {
// Bounded-sized list of signatures of pods that should avoid this node, sorted
// in timestamp order from oldest to newest. Size of the slice is unspecified.
// +optional
PreferAvoidPods []PreferAvoidPodsEntry `json:"preferAvoidPods,omitempty"`
}
......@@ -2202,10 +2514,13 @@ type PreferAvoidPodsEntry struct {
// The class of pods.
PodSignature PodSignature `json:"podSignature"`
// Time at which this entry was added to the list.
// +optional
EvictionTime unversioned.Time `json:"evictionTime,omitempty"`
// (brief) reason why this entry was added to the list.
// +optional
Reason string `json:"reason,omitempty"`
// Human readable message indicating why this entry was added to the list.
// +optional
Message string `json:"message,omitempty"`
}
......@@ -2213,6 +2528,7 @@ type PreferAvoidPodsEntry struct {
// Exactly one field should be set.
type PodSignature struct {
// Reference to controller whose pods should avoid this node.
// +optional
PodController *OwnerReference `json:"podController,omitempty"`
}
......@@ -2221,6 +2537,7 @@ type ContainerImage struct {
// Names by which this image is known.
Names []string `json:"names"`
// The size of the image in bytes.
// +optional
SizeBytes int64 `json:"sizeBytes,omitempty"`
}
......@@ -2258,12 +2575,16 @@ const (
)
type NodeCondition struct {
Type NodeConditionType `json:"type"`
Status ConditionStatus `json:"status"`
LastHeartbeatTime unversioned.Time `json:"lastHeartbeatTime,omitempty"`
LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty"`
Reason string `json:"reason,omitempty"`
Message string `json:"message,omitempty"`
Type NodeConditionType `json:"type"`
Status ConditionStatus `json:"status"`
// +optional
LastHeartbeatTime unversioned.Time `json:"lastHeartbeatTime,omitempty"`
// +optional
LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty"`
// +optional
Reason string `json:"reason,omitempty"`
// +optional
Message string `json:"message,omitempty"`
}
type NodeAddressType string
......@@ -2286,6 +2607,7 @@ type NodeAddress struct {
// see http://releases.k8s.io/HEAD/docs/design/resources.md for more details.
type NodeResources struct {
// Capacity represents the available resources of a node
// +optional
Capacity ResourceList `json:"capacity,omitempty"`
}
......@@ -2319,18 +2641,22 @@ type ResourceList map[ResourceName]resource.Quantity
// The name of the node according to etcd is in ObjectMeta.Name.
type Node struct {
unversioned.TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`
// +optional
ObjectMeta `json:"metadata,omitempty"`
// Spec defines the behavior of a node.
// +optional
Spec NodeSpec `json:"spec,omitempty"`
// Status describes the current status of a Node
// +optional
Status NodeStatus `json:"status,omitempty"`
}
// NodeList is a list of nodes.
type NodeList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
Items []Node `json:"items"`
......@@ -2353,6 +2679,7 @@ const (
// NamespaceStatus is information about the current status of a Namespace.
type NamespaceStatus struct {
// Phase is the current lifecycle phase of the namespace.
// +optional
Phase NamespacePhase `json:"phase,omitempty"`
}
......@@ -2373,18 +2700,22 @@ const (
// Use of multiple namespaces is optional
type Namespace struct {
unversioned.TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`
// +optional
ObjectMeta `json:"metadata,omitempty"`
// Spec defines the behavior of the Namespace.
// +optional
Spec NamespaceSpec `json:"spec,omitempty"`
// Status describes the current status of a Namespace
// +optional
Status NamespaceStatus `json:"status,omitempty"`
}
// NamespaceList is a list of Namespaces.
type NamespaceList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
Items []Namespace `json:"items"`
......@@ -2394,6 +2725,7 @@ type NamespaceList struct {
type Binding struct {
unversioned.TypeMeta `json:",inline"`
// ObjectMeta describes the object that is being bound.
// +optional
ObjectMeta `json:"metadata,omitempty"`
// Target is the object to bind to.
......@@ -2403,6 +2735,7 @@ type Binding struct {
// Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.
type Preconditions struct {
// Specifies the target UID.
// +optional
UID *types.UID `json:"uid,omitempty"`
}
......@@ -2413,14 +2746,17 @@ type DeleteOptions struct {
// Optional duration in seconds before the object should be deleted. Value must be non-negative integer.
// The value zero indicates delete immediately. If this value is nil, the default grace period for the
// specified type will be used.
// +optional
GracePeriodSeconds *int64 `json:"gracePeriodSeconds,omitempty"`
// Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be
// returned.
// +optional
Preconditions *Preconditions `json:"preconditions,omitempty"`
// Should the dependent objects be orphaned. If true/false, the "orphan"
// finalizer will be added to/removed from the object's finalizers list.
// +optional
OrphanDependents *bool `json:"orphanDependents,omitempty"`
}
......@@ -2492,18 +2828,23 @@ type PodAttachOptions struct {
unversioned.TypeMeta `json:",inline"`
// Stdin if true indicates that stdin is to be redirected for the attach call
// +optional
Stdin bool `json:"stdin,omitempty"`
// Stdout if true indicates that stdout is to be redirected for the attach call
// +optional
Stdout bool `json:"stdout,omitempty"`
// Stderr if true indicates that stderr is to be redirected for the attach call
// +optional
Stderr bool `json:"stderr,omitempty"`
// TTY if true indicates that a tty will be allocated for the attach call
// +optional
TTY bool `json:"tty,omitempty"`
// Container to attach to.
// +optional
Container string `json:"container,omitempty"`
}
......@@ -2574,17 +2915,24 @@ type OwnerReference struct {
// More info: http://kubernetes.io/docs/user-guide/identifiers#uids
UID types.UID `json:"uid"`
// If true, this reference points to the managing controller.
// +optional
Controller *bool `json:"controller,omitempty"`
}
// ObjectReference contains enough information to let you inspect or modify the referred object.
type ObjectReference struct {
Kind string `json:"kind,omitempty"`
Namespace string `json:"namespace,omitempty"`
Name string `json:"name,omitempty"`
UID types.UID `json:"uid,omitempty"`
APIVersion string `json:"apiVersion,omitempty"`
ResourceVersion string `json:"resourceVersion,omitempty"`
// +optional
Kind string `json:"kind,omitempty"`
// +optional
Namespace string `json:"namespace,omitempty"`
// +optional
Name string `json:"name,omitempty"`
// +optional
UID types.UID `json:"uid,omitempty"`
// +optional
APIVersion string `json:"apiVersion,omitempty"`
// +optional
ResourceVersion string `json:"resourceVersion,omitempty"`
// Optional. If referring to a piece of an object instead of an entire object, this string
// should contain information to identify the sub-object. For example, if the object
......@@ -2594,6 +2942,7 @@ type ObjectReference struct {
// index 2 in this pod). This syntax is chosen only to have some well-defined way of
// referencing a part of an object.
// TODO: this design is not final and this field is subject to change in the future.
// +optional
FieldPath string `json:"fieldPath,omitempty"`
}
......@@ -2605,13 +2954,16 @@ type LocalObjectReference struct {
type SerializedReference struct {
unversioned.TypeMeta `json:",inline"`
Reference ObjectReference `json:"reference,omitempty"`
// +optional
Reference ObjectReference `json:"reference,omitempty"`
}
type EventSource struct {
// Component from which the event is generated.
// +optional
Component string `json:"component,omitempty"`
// Node name on which the event is generated.
// +optional
Host string `json:"host,omitempty"`
}
......@@ -2629,40 +2981,50 @@ const (
// TODO: Decide whether to store these separately or with the object they apply to.
type Event struct {
unversioned.TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`
// +optional
ObjectMeta `json:"metadata,omitempty"`
// Required. The object that this event is about.
// +optional
InvolvedObject ObjectReference `json:"involvedObject,omitempty"`
// Optional; this should be a short, machine understandable string that gives the reason
// for this event being generated. For example, if the event is reporting that a container
// can't start, the Reason might be "ImageNotFound".
// TODO: provide exact specification for format.
// +optional
Reason string `json:"reason,omitempty"`
// Optional. A human-readable description of the status of this operation.
// TODO: decide on maximum length.
// +optional
Message string `json:"message,omitempty"`
// Optional. The component reporting this event. Should be a short machine understandable string.
// +optional
Source EventSource `json:"source,omitempty"`
// The time at which the event was first recorded. (Time of server receipt is in TypeMeta.)
// +optional
FirstTimestamp unversioned.Time `json:"firstTimestamp,omitempty"`
// The time at which the most recent occurrence of this event was recorded.
// +optional
LastTimestamp unversioned.Time `json:"lastTimestamp,omitempty"`
// The number of times this event has occurred.
// +optional
Count int32 `json:"count,omitempty"`
// Type of this event (Normal, Warning), new types could be added in the future.
// +optional
Type string `json:"type,omitempty"`
}
// EventList is a list of events.
type EventList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
Items []Event `json:"items"`
......@@ -2671,6 +3033,7 @@ type EventList struct {
// List holds a list of objects, which may not be known by the server.
type List struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
Items []runtime.Object `json:"items"`
......@@ -2691,16 +3054,22 @@ const (
// LimitRangeItem defines a min/max usage limit for any resource that matches on kind
type LimitRangeItem struct {
// Type of resource that this limit applies to
// +optional
Type LimitType `json:"type,omitempty"`
// Max usage constraints on this kind by resource name
// +optional
Max ResourceList `json:"max,omitempty"`
// Min usage constraints on this kind by resource name
// +optional
Min ResourceList `json:"min,omitempty"`
// Default resource requirement limit value by resource name.
// +optional
Default ResourceList `json:"default,omitempty"`
// DefaultRequest resource requirement request value by resource name.
// +optional
DefaultRequest ResourceList `json:"defaultRequest,omitempty"`
// MaxLimitRequestRatio represents the max burst value for the named resource
// +optional
MaxLimitRequestRatio ResourceList `json:"maxLimitRequestRatio,omitempty"`
}
......@@ -2715,15 +3084,18 @@ type LimitRangeSpec struct {
// LimitRange sets resource usage limits for each kind of resource in a Namespace
type LimitRange struct {
unversioned.TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`
// +optional
ObjectMeta `json:"metadata,omitempty"`
// Spec defines the limits enforced
// +optional
Spec LimitRangeSpec `json:"spec,omitempty"`
}
// LimitRangeList is a list of LimitRange items.
type LimitRangeList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
// Items is a list of LimitRange objects
......@@ -2779,17 +3151,21 @@ const (
// ResourceQuotaSpec defines the desired hard limits to enforce for Quota
type ResourceQuotaSpec struct {
// Hard is the set of desired hard limits for each named resource
// +optional
Hard ResourceList `json:"hard,omitempty"`
// A collection of filters that must match each object tracked by a quota.
// If not specified, the quota matches all objects.
// +optional
Scopes []ResourceQuotaScope `json:"scopes,omitempty"`
}
// ResourceQuotaStatus defines the enforced hard limits and observed use
type ResourceQuotaStatus struct {
// Hard is the set of enforced hard limits for each named resource
// +optional
Hard ResourceList `json:"hard,omitempty"`
// Used is the current observed total usage of the resource in the namespace
// +optional
Used ResourceList `json:"used,omitempty"`
}
......@@ -2798,18 +3174,22 @@ type ResourceQuotaStatus struct {
// ResourceQuota sets aggregate quota restrictions enforced per namespace
type ResourceQuota struct {
unversioned.TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`
// +optional
ObjectMeta `json:"metadata,omitempty"`
// Spec defines the desired quota
// +optional
Spec ResourceQuotaSpec `json:"spec,omitempty"`
// Status defines the actual enforced quota and its current usage
// +optional
Status ResourceQuotaStatus `json:"status,omitempty"`
}
// ResourceQuotaList is a list of ResourceQuota items
type ResourceQuotaList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
// Items is a list of ResourceQuota objects
......@@ -2822,15 +3202,18 @@ type ResourceQuotaList struct {
// the Data field must be less than MaxSecretSize bytes.
type Secret struct {
unversioned.TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`
// +optional
ObjectMeta `json:"metadata,omitempty"`
// Data contains the secret data. Each key must be a valid DNS_SUBDOMAIN
// or leading dot followed by valid DNS_SUBDOMAIN.
// The serialized form of the secret data is a base64 encoded string,
// representing the arbitrary (possibly non-string) data value here.
// +optional
Data map[string][]byte `json:"data,omitempty"`
// Used to facilitate programmatic handling of secret data.
// +optional
Type SecretType `json:"type,omitempty"`
}
......@@ -2920,6 +3303,7 @@ const (
type SecretList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
Items []Secret `json:"items"`
......@@ -2930,16 +3314,19 @@ type SecretList struct {
// ConfigMap holds configuration data for components or applications to consume.
type ConfigMap struct {
unversioned.TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`
// +optional
ObjectMeta `json:"metadata,omitempty"`
// Data contains the configuration data.
// Each key must be a valid DNS_SUBDOMAIN with an optional leading dot.
// +optional
Data map[string]string `json:"data,omitempty"`
}
// ConfigMapList is a resource containing a list of ConfigMap objects.
type ConfigMapList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
// Items is the list of ConfigMaps.
......@@ -3007,10 +3394,12 @@ const (
)
type ComponentCondition struct {
Type ComponentConditionType `json:"type"`
Status ConditionStatus `json:"status"`
Message string `json:"message,omitempty"`
Error string `json:"error,omitempty"`
Type ComponentConditionType `json:"type"`
Status ConditionStatus `json:"status"`
// +optional
Message string `json:"message,omitempty"`
// +optional
Error string `json:"error,omitempty"`
}
// +genclient=true
......@@ -3019,13 +3408,16 @@ type ComponentCondition struct {
// ComponentStatus (and ComponentStatusList) holds the cluster validation info.
type ComponentStatus struct {
unversioned.TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`
// +optional
ObjectMeta `json:"metadata,omitempty"`
// +optional
Conditions []ComponentCondition `json:"conditions,omitempty"`
}
type ComponentStatusList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
Items []ComponentStatus `json:"items"`
......@@ -3037,20 +3429,24 @@ type ComponentStatusList struct {
type SecurityContext struct {
// The capabilities to add/drop when running containers.
// Defaults to the default set of capabilities granted by the container runtime.
// +optional
Capabilities *Capabilities `json:"capabilities,omitempty"`
// Run container in privileged mode.
// Processes in privileged containers are essentially equivalent to root on the host.
// Defaults to false.
// +optional
Privileged *bool `json:"privileged,omitempty"`
// The SELinux context to be applied to the container.
// If unspecified, the container runtime will allocate a random SELinux context for each
// container. May also be set in PodSecurityContext. If set in both SecurityContext and
// PodSecurityContext, the value specified in SecurityContext takes precedence.
// +optional
SELinuxOptions *SELinuxOptions `json:"seLinuxOptions,omitempty"`
// The UID to run the entrypoint of the container process.
// Defaults to user specified in image metadata if unspecified.
// May also be set in PodSecurityContext. If set in both SecurityContext and
// PodSecurityContext, the value specified in SecurityContext takes precedence.
// +optional
RunAsUser *int64 `json:"runAsUser,omitempty"`
// Indicates that the container must run as a non-root user.
// If true, the Kubelet will validate the image at runtime to ensure that it
......@@ -3058,21 +3454,27 @@ type SecurityContext struct {
// If unset or false, no such validation will be performed.
// May also be set in PodSecurityContext. If set in both SecurityContext and
// PodSecurityContext, the value specified in SecurityContext takes precedence.
// +optional
RunAsNonRoot *bool `json:"runAsNonRoot,omitempty"`
// The read-only root filesystem allows you to restrict the locations that an application can write
// files to, ensuring the persistent data can only be written to mounts.
// +optional
ReadOnlyRootFilesystem *bool `json:"readOnlyRootFilesystem,omitempty"`
}
// SELinuxOptions are the labels to be applied to the container.
type SELinuxOptions struct {
// SELinux user label
// +optional
User string `json:"user,omitempty"`
// SELinux role label
// +optional
Role string `json:"role,omitempty"`
// SELinux type label
// +optional
Type string `json:"type,omitempty"`
// SELinux level label.
// +optional
Level string `json:"level,omitempty"`
}
......@@ -3085,7 +3487,8 @@ type SELinuxOptions struct {
// of the cluster, thus the object is less strongly typed than most.
type RangeAllocation struct {
unversioned.TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`
// +optional
ObjectMeta `json:"metadata,omitempty"`
// A string representing a unique label for a range of resources, such as a CIDR "10.0.0.0/8" or
// port range "10000-30000". Range is not strongly schema'd here. The Range is expected to define
// a start and end unless there is an implicit end.
......
......@@ -38,6 +38,7 @@ message APIGroup {
// preferredVersion is the version preferred by the API server, which
// probably is the storage version.
// +optional
optional GroupVersionForDiscovery preferredVersion = 3;
// a map of client CIDR to server address that is serving this group.
......@@ -185,9 +186,11 @@ message LabelSelector {
// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
// map is equivalent to an element of matchExpressions, whose key field is "key", the
// operator is "In", and the values array contains only "value". The requirements are ANDed.
// +optional
map<string, string> matchLabels = 1;
// matchExpressions is a list of label selector requirements. The requirements are ANDed.
// +optional
repeated LabelSelectorRequirement matchExpressions = 2;
}
......@@ -205,6 +208,7 @@ message LabelSelectorRequirement {
// the values array must be non-empty. If the operator is Exists or DoesNotExist,
// the values array must be empty. This array is replaced during a strategic
// merge patch.
// +optional
repeated string values = 3;
}
......@@ -214,6 +218,7 @@ message ListMeta {
// SelfLink is a URL representing this object.
// Populated by the system.
// Read-only.
// +optional
optional string selfLink = 1;
// String that identifies the server's internal version of this object that
......@@ -222,6 +227,7 @@ message ListMeta {
// Populated by the system.
// Read-only.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#concurrency-control-and-consistency
// +optional
optional string resourceVersion = 2;
}
......@@ -246,29 +252,35 @@ message ServerAddressByClientCIDR {
message Status {
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
// +optional
optional ListMeta metadata = 1;
// Status of the operation.
// One of: "Success" or "Failure".
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
optional string status = 2;
// A human-readable description of the status of this operation.
// +optional
optional string message = 3;
// A machine-readable description of why this operation is in the
// "Failure" status. If this value is empty there
// is no information available. A Reason clarifies an HTTP status
// code but does not override it.
// +optional
optional string reason = 4;
// Extended data associated with the reason. Each reason may define its
// own extended details. This field is optional and the data returned
// is not guaranteed to conform to any schema except that defined by
// the reason type.
// +optional
optional StatusDetails details = 5;
// Suggested HTTP return code for this status, 0 if not set.
// +optional
optional int32 code = 6;
}
......@@ -277,10 +289,12 @@ message Status {
message StatusCause {
// A machine-readable description of the cause of the error. If this value is
// empty there is no information available.
// +optional
optional string reason = 1;
// A human-readable description of the cause of the error. This field may be
// presented as-is to a reader.
// +optional
optional string message = 2;
// The field of the resource that has caused this error, as named by its JSON
......@@ -292,6 +306,7 @@ message StatusCause {
// Examples:
// "name" - the field "name" on the current resource
// "items[0].name" - the field "name" on the first array entry in "items"
// +optional
optional string field = 3;
}
......@@ -304,21 +319,26 @@ message StatusCause {
message StatusDetails {
// The name attribute of the resource associated with the status StatusReason
// (when there is a single name which can be described).
// +optional
optional string name = 1;
// The group attribute of the resource associated with the status StatusReason.
// +optional
optional string group = 2;
// The kind attribute of the resource associated with the status StatusReason.
// On some operations may differ from the requested resource Kind.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
// +optional
optional string kind = 3;
// The Causes array includes more details associated with the StatusReason
// failure. Not all StatusReasons may provide detailed causes.
// +optional
repeated StatusCause causes = 4;
// If specified, the time in seconds before the operation should be retried.
// +optional
optional int32 retryAfterSeconds = 5;
}
......@@ -367,12 +387,14 @@ message TypeMeta {
// Cannot be updated.
// In CamelCase.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
// +optional
optional string kind = 1;
// APIVersion defines the versioned schema of this representation of an object.
// Servers should convert recognized schemas to the latest internal value, and
// may reject unrecognized values.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources
// +optional
optional string apiVersion = 2;
}
......@@ -36,12 +36,14 @@ type TypeMeta struct {
// Cannot be updated.
// In CamelCase.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
// +optional
Kind string `json:"kind,omitempty" protobuf:"bytes,1,opt,name=kind"`
// APIVersion defines the versioned schema of this representation of an object.
// Servers should convert recognized schemas to the latest internal value, and
// may reject unrecognized values.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources
// +optional
APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,2,opt,name=apiVersion"`
}
......@@ -51,6 +53,7 @@ type ListMeta struct {
// SelfLink is a URL representing this object.
// Populated by the system.
// Read-only.
// +optional
SelfLink string `json:"selfLink,omitempty" protobuf:"bytes,1,opt,name=selfLink"`
// String that identifies the server's internal version of this object that
......@@ -59,6 +62,7 @@ type ListMeta struct {
// Populated by the system.
// Read-only.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#concurrency-control-and-consistency
// +optional
ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,2,opt,name=resourceVersion"`
}
......@@ -76,25 +80,31 @@ type Status struct {
TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
// +optional
ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Status of the operation.
// One of: "Success" or "Failure".
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Status string `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"`
// A human-readable description of the status of this operation.
// +optional
Message string `json:"message,omitempty" protobuf:"bytes,3,opt,name=message"`
// A machine-readable description of why this operation is in the
// "Failure" status. If this value is empty there
// is no information available. A Reason clarifies an HTTP status
// code but does not override it.
// +optional
Reason StatusReason `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason,casttype=StatusReason"`
// Extended data associated with the reason. Each reason may define its
// own extended details. This field is optional and the data returned
// is not guaranteed to conform to any schema except that defined by
// the reason type.
// +optional
Details *StatusDetails `json:"details,omitempty" protobuf:"bytes,5,opt,name=details"`
// Suggested HTTP return code for this status, 0 if not set.
// +optional
Code int32 `json:"code,omitempty" protobuf:"varint,6,opt,name=code"`
}
......@@ -107,17 +117,22 @@ type Status struct {
type StatusDetails struct {
// The name attribute of the resource associated with the status StatusReason
// (when there is a single name which can be described).
// +optional
Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
// The group attribute of the resource associated with the status StatusReason.
// +optional
Group string `json:"group,omitempty" protobuf:"bytes,2,opt,name=group"`
// The kind attribute of the resource associated with the status StatusReason.
// On some operations may differ from the requested resource Kind.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
// +optional
Kind string `json:"kind,omitempty" protobuf:"bytes,3,opt,name=kind"`
// The Causes array includes more details associated with the StatusReason
// failure. Not all StatusReasons may provide detailed causes.
// +optional
Causes []StatusCause `json:"causes,omitempty" protobuf:"bytes,4,rep,name=causes"`
// If specified, the time in seconds before the operation should be retried.
// +optional
RetryAfterSeconds int32 `json:"retryAfterSeconds,omitempty" protobuf:"varint,5,opt,name=retryAfterSeconds"`
}
......@@ -257,9 +272,11 @@ const (
type StatusCause struct {
// A machine-readable description of the cause of the error. If this value is
// empty there is no information available.
// +optional
Type CauseType `json:"reason,omitempty" protobuf:"bytes,1,opt,name=reason,casttype=CauseType"`
// A human-readable description of the cause of the error. This field may be
// presented as-is to a reader.
// +optional
Message string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"`
// The field of the resource that has caused this error, as named by its JSON
// serialization. May include dot and postfix notation for nested attributes.
......@@ -270,6 +287,7 @@ type StatusCause struct {
// Examples:
// "name" - the field "name" on the current resource
// "items[0].name" - the field "name" on the first array entry in "items"
// +optional
Field string `json:"field,omitempty" protobuf:"bytes,3,opt,name=field"`
}
......@@ -336,6 +354,7 @@ type APIGroup struct {
Versions []GroupVersionForDiscovery `json:"versions" protobuf:"bytes,2,rep,name=versions"`
// preferredVersion is the version preferred by the API server, which
// probably is the storage version.
// +optional
PreferredVersion GroupVersionForDiscovery `json:"preferredVersion,omitempty" protobuf:"bytes,3,opt,name=preferredVersion"`
// a map of client CIDR to server address that is serving this group.
// This is to help clients reach servers in the most network-efficient way possible.
......@@ -429,8 +448,10 @@ type LabelSelector struct {
// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
// map is equivalent to an element of matchExpressions, whose key field is "key", the
// operator is "In", and the values array contains only "value". The requirements are ANDed.
// +optional
MatchLabels map[string]string `json:"matchLabels,omitempty" protobuf:"bytes,1,rep,name=matchLabels"`
// matchExpressions is a list of label selector requirements. The requirements are ANDed.
// +optional
MatchExpressions []LabelSelectorRequirement `json:"matchExpressions,omitempty" protobuf:"bytes,2,rep,name=matchExpressions"`
}
......@@ -446,6 +467,7 @@ type LabelSelectorRequirement struct {
// the values array must be non-empty. If the operator is Exists or DoesNotExist,
// the values array must be empty. This array is replaced during a strategic
// merge patch.
// +optional
Values []string `json:"values,omitempty" protobuf:"bytes,3,rep,name=values"`
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -26,21 +26,26 @@ type Policy struct {
// User is the username this rule applies to.
// Either user or group is required to match the request.
// "*" matches all users.
// +optional
User string `json:"user,omitempty"`
// Group is the group this rule applies to.
// Either user or group is required to match the request.
// "*" matches all groups.
// +optional
Group string `json:"group,omitempty"`
// Readonly matches readonly requests when true, and all requests when false
// +optional
Readonly bool `json:"readonly,omitempty"`
// Resource is the name of a resource
// "*" matches all resources
// +optional
Resource string `json:"resource,omitempty"`
// Namespace is the name of a namespace
// "*" matches all namespaces (including unnamespaced requests)
// +optional
Namespace string `json:"namespace,omitempty"`
}
......@@ -32,30 +32,37 @@ type PolicySpec struct {
// User is the username this rule applies to.
// Either user or group is required to match the request.
// "*" matches all users.
// +optional
User string `json:"user,omitempty"`
// Group is the group this rule applies to.
// Either user or group is required to match the request.
// "*" matches all groups.
// +optional
Group string `json:"group,omitempty"`
// Readonly matches readonly requests when true, and all requests when false
// +optional
Readonly bool `json:"readonly,omitempty"`
// APIGroup is the name of an API group. APIGroup, Resource, and Namespace are required to match resource requests.
// "*" matches all API groups
// +optional
APIGroup string `json:"apiGroup,omitempty"`
// Resource is the name of a resource. APIGroup, Resource, and Namespace are required to match resource requests.
// "*" matches all resources
// +optional
Resource string `json:"resource,omitempty"`
// Namespace is the name of a namespace. APIGroup, Resource, and Namespace are required to match resource requests.
// "*" matches all namespaces (including unnamespaced requests)
// +optional
Namespace string `json:"namespace,omitempty"`
// NonResourcePath matches non-resource request paths.
// "*" matches all paths
// "/foo/*" matches all subpaths of foo
// +optional
NonResourcePath string `json:"nonResourcePath,omitempty"`
}
......@@ -32,13 +32,16 @@ import (
// and subject to change without notice.
type PetSet struct {
unversioned.TypeMeta `json:",inline"`
api.ObjectMeta `json:"metadata,omitempty"`
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
// Spec defines the desired identities of pets in this set.
// +optional
Spec PetSetSpec `json:"spec,omitempty"`
// Status is the current status of Pets in this PetSet. This data
// may be out of date by some window of time.
// +optional
Status PetSetStatus `json:"status,omitempty"`
}
......@@ -49,11 +52,13 @@ type PetSetSpec struct {
// same Template, but individual replicas also have a consistent identity.
// If unspecified, defaults to 1.
// TODO: Consider a rename of this field.
// +optional
Replicas int32 `json:"replicas,omitempty"`
// Selector is a label query over pods that should match the replica count.
// If empty, defaulted to labels on the pod template.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
Selector *unversioned.LabelSelector `json:"selector,omitempty"`
// Template is the object that describes the pod that will be created if
......@@ -69,6 +74,7 @@ type PetSetSpec struct {
// container in the template. A claim in this list takes precedence over
// any volumes in the template, with the same name.
// TODO: Define the behavior if a claim already exists with the same name.
// +optional
VolumeClaimTemplates []api.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty"`
// ServiceName is the name of the service that governs this PetSet.
......@@ -82,6 +88,7 @@ type PetSetSpec struct {
// PetSetStatus represents the current state of a PetSet.
type PetSetStatus struct {
// most recent generation observed by this autoscaler.
// +optional
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
// Replicas is the number of actual replicas.
......@@ -91,6 +98,7 @@ type PetSetStatus struct {
// PetSetList is a collection of PetSets.
type PetSetList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
Items []PetSet `json:"items"`
}
......@@ -38,18 +38,22 @@ option go_package = "v1alpha1";
// map to the same storage identity. PetSet is currently in alpha
// and subject to change without notice.
message PetSet {
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Spec defines the desired identities of pets in this set.
// +optional
optional PetSetSpec spec = 2;
// Status is the current status of Pets in this PetSet. This data
// may be out of date by some window of time.
// +optional
optional PetSetStatus status = 3;
}
// PetSetList is a collection of PetSets.
message PetSetList {
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
repeated PetSet items = 2;
......@@ -62,11 +66,13 @@ message PetSetSpec {
// same Template, but individual replicas also have a consistent identity.
// If unspecified, defaults to 1.
// TODO: Consider a rename of this field.
// +optional
optional int32 replicas = 1;
// Selector is a label query over pods that should match the replica count.
// If empty, defaulted to labels on the pod template.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.LabelSelector selector = 2;
// Template is the object that describes the pod that will be created if
......@@ -82,6 +88,7 @@ message PetSetSpec {
// container in the template. A claim in this list takes precedence over
// any volumes in the template, with the same name.
// TODO: Define the behavior if a claim already exists with the same name.
// +optional
repeated k8s.io.kubernetes.pkg.api.v1.PersistentVolumeClaim volumeClaimTemplates = 4;
// ServiceName is the name of the service that governs this PetSet.
......@@ -95,6 +102,7 @@ message PetSetSpec {
// PetSetStatus represents the current state of a PetSet.
message PetSetStatus {
// most recent generation observed by this autoscaler.
// +optional
optional int64 observedGeneration = 1;
// Replicas is the number of actual replicas.
......
......@@ -32,13 +32,16 @@ import (
// and subject to change without notice.
type PetSet struct {
unversioned.TypeMeta `json:",inline"`
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Spec defines the desired identities of pets in this set.
// +optional
Spec PetSetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
// Status is the current status of Pets in this PetSet. This data
// may be out of date by some window of time.
// +optional
Status PetSetStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
......@@ -49,11 +52,13 @@ type PetSetSpec struct {
// same Template, but individual replicas also have a consistent identity.
// If unspecified, defaults to 1.
// TODO: Consider a rename of this field.
// +optional
Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
// Selector is a label query over pods that should match the replica count.
// If empty, defaulted to labels on the pod template.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
Selector *unversioned.LabelSelector `json:"selector,omitempty" protobuf:"bytes,2,opt,name=selector"`
// Template is the object that describes the pod that will be created if
......@@ -69,6 +74,7 @@ type PetSetSpec struct {
// container in the template. A claim in this list takes precedence over
// any volumes in the template, with the same name.
// TODO: Define the behavior if a claim already exists with the same name.
// +optional
VolumeClaimTemplates []v1.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty" protobuf:"bytes,4,rep,name=volumeClaimTemplates"`
// ServiceName is the name of the service that governs this PetSet.
......@@ -82,6 +88,7 @@ type PetSetSpec struct {
// PetSetStatus represents the current state of a PetSet.
type PetSetStatus struct {
// most recent generation observed by this autoscaler.
// +optional
ObservedGeneration *int64 `json:"observedGeneration,omitempty" protobuf:"varint,1,opt,name=observedGeneration"`
// Replicas is the number of actual replicas.
......@@ -91,6 +98,7 @@ type PetSetStatus struct {
// PetSetList is a collection of PetSets.
type PetSetList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
Items []PetSet `json:"items" protobuf:"bytes,2,rep,name=items"`
}
......@@ -43,30 +43,36 @@ message ExtraValue {
// Note: TokenReview requests may be cached by the webhook token authenticator
// plugin in the kube-apiserver.
message TokenReview {
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Spec holds information about the request being evaluated
optional TokenReviewSpec spec = 2;
// Status is filled in by the server and indicates whether the request can be authenticated.
// +optional
optional TokenReviewStatus status = 3;
}
// TokenReviewSpec is a description of the token authentication request.
message TokenReviewSpec {
// Token is the opaque bearer token.
// +optional
optional string token = 1;
}
// TokenReviewStatus is the result of the token authentication request.
message TokenReviewStatus {
// Authenticated indicates that the token was associated with a known user.
// +optional
optional bool authenticated = 1;
// User is the UserInfo associated with the provided token.
// +optional
optional UserInfo user = 2;
// Error indicates that the token couldn't be checked
// +optional
optional string error = 3;
}
......@@ -74,17 +80,21 @@ message TokenReviewStatus {
// user.Info interface.
message UserInfo {
// The name that uniquely identifies this user among all active users.
// +optional
optional string username = 1;
// A unique value that identifies this user across time. If this user is
// deleted and another user by the same name is added, they will have
// different UIDs.
// +optional
optional string uid = 2;
// The names of groups this user is a part of.
// +optional
repeated string groups = 3;
// Any additional information provided by the authenticator.
// +optional
map<string, ExtraValue> extra = 4;
}
......@@ -32,28 +32,34 @@ import (
// plugin in the kube-apiserver.
type TokenReview struct {
unversioned.TypeMeta `json:",inline"`
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Spec holds information about the request being evaluated
Spec TokenReviewSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"`
// Status is filled in by the server and indicates whether the request can be authenticated.
// +optional
Status TokenReviewStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
// TokenReviewSpec is a description of the token authentication request.
type TokenReviewSpec struct {
// Token is the opaque bearer token.
// +optional
Token string `json:"token,omitempty" protobuf:"bytes,1,opt,name=token"`
}
// TokenReviewStatus is the result of the token authentication request.
type TokenReviewStatus struct {
// Authenticated indicates that the token was associated with a known user.
// +optional
Authenticated bool `json:"authenticated,omitempty" protobuf:"varint,1,opt,name=authenticated"`
// User is the UserInfo associated with the provided token.
// +optional
User UserInfo `json:"user,omitempty" protobuf:"bytes,2,opt,name=user"`
// Error indicates that the token couldn't be checked
// +optional
Error string `json:"error,omitempty" protobuf:"bytes,3,opt,name=error"`
}
......@@ -61,14 +67,18 @@ type TokenReviewStatus struct {
// user.Info interface.
type UserInfo struct {
// The name that uniquely identifies this user among all active users.
// +optional
Username string `json:"username,omitempty" protobuf:"bytes,1,opt,name=username"`
// A unique value that identifies this user across time. If this user is
// deleted and another user by the same name is added, they will have
// different UIDs.
// +optional
UID string `json:"uid,omitempty" protobuf:"bytes,2,opt,name=uid"`
// The names of groups this user is a part of.
// +optional
Groups []string `json:"groups,omitempty" protobuf:"bytes,3,rep,name=groups"`
// Any additional information provided by the authenticator.
// +optional
Extra map[string]ExtraValue `json:"extra,omitempty" protobuf:"bytes,4,rep,name=extra"`
}
......
......@@ -43,6 +43,7 @@ message ExtraValue {
// Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions
// checking.
message LocalSubjectAccessReview {
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Spec holds information about the request being evaluated. spec.namespace must be equal to the namespace
......@@ -50,15 +51,18 @@ message LocalSubjectAccessReview {
optional SubjectAccessReviewSpec spec = 2;
// Status is filled in by the server and indicates whether the request is allowed or not
// +optional
optional SubjectAccessReviewStatus status = 3;
}
// NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface
message NonResourceAttributes {
// Path is the URL path of the request
// +optional
optional string path = 1;
// Verb is the standard HTTP verb
// +optional
optional string verb = 2;
}
......@@ -68,24 +72,31 @@ message ResourceAttributes {
// "" (empty) is defaulted for LocalSubjectAccessReviews
// "" (empty) is empty for cluster-scoped resources
// "" (empty) means "all" for namespace scoped resources from a SubjectAccessReview or SelfSubjectAccessReview
// +optional
optional string namespace = 1;
// Verb is a kubernetes resource API verb, like: get, list, watch, create, update, delete, proxy. "*" means all.
// +optional
optional string verb = 2;
// Group is the API Group of the Resource. "*" means all.
// +optional
optional string group = 3;
// Version is the API Version of the Resource. "*" means all.
// +optional
optional string version = 4;
// Resource is one of the existing resource types. "*" means all.
// +optional
optional string resource = 5;
// Subresource is one of the existing resource types. "" means none.
// +optional
optional string subresource = 6;
// Name is the name of the resource being requested for a "get" or deleted for a "delete". "" (empty) means all.
// +optional
optional string name = 7;
}
......@@ -93,12 +104,14 @@ message ResourceAttributes {
// spec.namespace means "in all namespaces". Self is a special case, because users should always be able
// to check whether they can perform an action
message SelfSubjectAccessReview {
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Spec holds information about the request being evaluated. user and groups must be empty
optional SelfSubjectAccessReviewSpec spec = 2;
// Status is filled in by the server and indicates whether the request is allowed or not
// +optional
optional SubjectAccessReviewStatus status = 3;
}
......@@ -106,20 +119,24 @@ message SelfSubjectAccessReview {
// and NonResourceAuthorizationAttributes must be set
message SelfSubjectAccessReviewSpec {
// ResourceAuthorizationAttributes describes information for a resource access request
// +optional
optional ResourceAttributes resourceAttributes = 1;
// NonResourceAttributes describes information for a non-resource access request
// +optional
optional NonResourceAttributes nonResourceAttributes = 2;
}
// SubjectAccessReview checks whether or not a user or group can perform an action.
message SubjectAccessReview {
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Spec holds information about the request being evaluated
optional SubjectAccessReviewSpec spec = 2;
// Status is filled in by the server and indicates whether the request is allowed or not
// +optional
optional SubjectAccessReviewStatus status = 3;
}
......@@ -127,20 +144,25 @@ message SubjectAccessReview {
// and NonResourceAuthorizationAttributes must be set
message SubjectAccessReviewSpec {
// ResourceAuthorizationAttributes describes information for a resource access request
// +optional
optional ResourceAttributes resourceAttributes = 1;
// NonResourceAttributes describes information for a non-resource access request
// +optional
optional NonResourceAttributes nonResourceAttributes = 2;
// User is the user you're testing for.
// If you specify "User" but not "Group", then is it interpreted as "What if User were not a member of any groups
// +optional
optional string verb = 3;
// Groups is the groups you're testing for.
// +optional
repeated string group = 4;
// Extra corresponds to the user.Info.GetExtra() method from the authenticator. Since that is input to the authorizer
// it needs a reflection here.
// +optional
map<string, ExtraValue> extra = 5;
}
......@@ -150,11 +172,13 @@ message SubjectAccessReviewStatus {
optional bool allowed = 1;
// Reason is optional. It indicates why a request was allowed or denied.
// +optional
optional string reason = 2;
// EvaluationError is an indication that some error occurred during the authorization check.
// It is entirely possible to get an error and be able to continue determine authorization status in spite of it.
// For instance, RBAC can be missing a role, but enough roles are still present and bound to reason about the request.
// +optional
optional string evaluationError = 3;
}
......@@ -30,12 +30,14 @@ import (
// SubjectAccessReview checks whether or not a user or group can perform an action.
type SubjectAccessReview struct {
unversioned.TypeMeta `json:",inline"`
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Spec holds information about the request being evaluated
Spec SubjectAccessReviewSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"`
// Status is filled in by the server and indicates whether the request is allowed or not
// +optional
Status SubjectAccessReviewStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
......@@ -48,12 +50,14 @@ type SubjectAccessReview struct {
// to check whether they can perform an action
type SelfSubjectAccessReview struct {
unversioned.TypeMeta `json:",inline"`
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Spec holds information about the request being evaluated. user and groups must be empty
Spec SelfSubjectAccessReviewSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"`
// Status is filled in by the server and indicates whether the request is allowed or not
// +optional
Status SubjectAccessReviewStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
......@@ -65,13 +69,15 @@ type SelfSubjectAccessReview struct {
// checking.
type LocalSubjectAccessReview struct {
unversioned.TypeMeta `json:",inline"`
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Spec holds information about the request being evaluated. spec.namespace must be equal to the namespace
// you made the request against. If empty, it is defaulted.
Spec SubjectAccessReviewSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"`
// Status is filled in by the server and indicates whether the request is allowed or not
// +optional
Status SubjectAccessReviewStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
......@@ -81,26 +87,35 @@ type ResourceAttributes struct {
// "" (empty) is defaulted for LocalSubjectAccessReviews
// "" (empty) is empty for cluster-scoped resources
// "" (empty) means "all" for namespace scoped resources from a SubjectAccessReview or SelfSubjectAccessReview
// +optional
Namespace string `json:"namespace,omitempty" protobuf:"bytes,1,opt,name=namespace"`
// Verb is a kubernetes resource API verb, like: get, list, watch, create, update, delete, proxy. "*" means all.
// +optional
Verb string `json:"verb,omitempty" protobuf:"bytes,2,opt,name=verb"`
// Group is the API Group of the Resource. "*" means all.
// +optional
Group string `json:"group,omitempty" protobuf:"bytes,3,opt,name=group"`
// Version is the API Version of the Resource. "*" means all.
// +optional
Version string `json:"version,omitempty" protobuf:"bytes,4,opt,name=version"`
// Resource is one of the existing resource types. "*" means all.
// +optional
Resource string `json:"resource,omitempty" protobuf:"bytes,5,opt,name=resource"`
// Subresource is one of the existing resource types. "" means none.
// +optional
Subresource string `json:"subresource,omitempty" protobuf:"bytes,6,opt,name=subresource"`
// Name is the name of the resource being requested for a "get" or deleted for a "delete". "" (empty) means all.
// +optional
Name string `json:"name,omitempty" protobuf:"bytes,7,opt,name=name"`
}
// NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface
type NonResourceAttributes struct {
// Path is the URL path of the request
// +optional
Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"`
// Verb is the standard HTTP verb
// +optional
Verb string `json:"verb,omitempty" protobuf:"bytes,2,opt,name=verb"`
}
......@@ -108,17 +123,22 @@ type NonResourceAttributes struct {
// and NonResourceAuthorizationAttributes must be set
type SubjectAccessReviewSpec struct {
// ResourceAuthorizationAttributes describes information for a resource access request
// +optional
ResourceAttributes *ResourceAttributes `json:"resourceAttributes,omitempty" protobuf:"bytes,1,opt,name=resourceAttributes"`
// NonResourceAttributes describes information for a non-resource access request
// +optional
NonResourceAttributes *NonResourceAttributes `json:"nonResourceAttributes,omitempty" protobuf:"bytes,2,opt,name=nonResourceAttributes"`
// User is the user you're testing for.
// If you specify "User" but not "Group", then is it interpreted as "What if User were not a member of any groups
// +optional
User string `json:"user,omitempty" protobuf:"bytes,3,opt,name=verb"`
// Groups is the groups you're testing for.
// +optional
Groups []string `json:"group,omitempty" protobuf:"bytes,4,rep,name=group"`
// Extra corresponds to the user.Info.GetExtra() method from the authenticator. Since that is input to the authorizer
// it needs a reflection here.
// +optional
Extra map[string]ExtraValue `json:"extra,omitempty" protobuf:"bytes,5,rep,name=extra"`
}
......@@ -135,8 +155,10 @@ func (t ExtraValue) String() string {
// and NonResourceAuthorizationAttributes must be set
type SelfSubjectAccessReviewSpec struct {
// ResourceAuthorizationAttributes describes information for a resource access request
// +optional
ResourceAttributes *ResourceAttributes `json:"resourceAttributes,omitempty" protobuf:"bytes,1,opt,name=resourceAttributes"`
// NonResourceAttributes describes information for a non-resource access request
// +optional
NonResourceAttributes *NonResourceAttributes `json:"nonResourceAttributes,omitempty" protobuf:"bytes,2,opt,name=nonResourceAttributes"`
}
......@@ -145,9 +167,11 @@ type SubjectAccessReviewStatus struct {
// Allowed is required. True if the action would be allowed, false otherwise.
Allowed bool `json:"allowed" protobuf:"varint,1,opt,name=allowed"`
// Reason is optional. It indicates why a request was allowed or denied.
// +optional
Reason string `json:"reason,omitempty" protobuf:"bytes,2,opt,name=reason"`
// EvaluationError is an indication that some error occurred during the authorization check.
// It is entirely possible to get an error and be able to continue determine authorization status in spite of it.
// For instance, RBAC can be missing a role, but enough roles are still present and bound to reason about the request.
// +optional
EvaluationError string `json:"evaluationError,omitempty" protobuf:"bytes,3,opt,name=evaluationError"`
}
......@@ -25,18 +25,22 @@ import (
type Scale struct {
unversioned.TypeMeta `json:",inline"`
// Standard object metadata; More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata.
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
// defines the behavior of the scale. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status.
// +optional
Spec ScaleSpec `json:"spec,omitempty"`
// current status of the scale. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status. Read-only.
// +optional
Status ScaleStatus `json:"status,omitempty"`
}
// ScaleSpec describes the attributes of a scale subresource.
type ScaleSpec struct {
// desired number of instances for the scaled object.
// +optional
Replicas int32 `json:"replicas,omitempty"`
}
......@@ -49,6 +53,7 @@ type ScaleStatus struct {
// as the label selector but in the string format to avoid introspection
// by clients. The string will be in the same format as the query-param syntax.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
Selector string `json:"selector,omitempty"`
}
......@@ -59,6 +64,7 @@ type CrossVersionObjectReference struct {
// Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names
Name string `json:"name" protobuf:"bytes,2,opt,name=name"`
// API version of the referent
// +optional
APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,3,opt,name=apiVersion"`
}
......@@ -68,21 +74,25 @@ type HorizontalPodAutoscalerSpec struct {
// and will set the desired number of pods by using its Scale subresource.
ScaleTargetRef CrossVersionObjectReference `json:"scaleTargetRef"`
// lower limit for the number of pods that can be set by the autoscaler, default 1.
// +optional
MinReplicas *int32 `json:"minReplicas,omitempty"`
// upper limit for the number of pods that can be set by the autoscaler. It cannot be smaller than MinReplicas.
MaxReplicas int32 `json:"maxReplicas"`
// target average CPU utilization (represented as a percentage of requested CPU) over all the pods;
// if not specified the default autoscaling policy will be used.
// +optional
TargetCPUUtilizationPercentage *int32 `json:"targetCPUUtilizationPercentage,omitempty"`
}
// current status of a horizontal pod autoscaler
type HorizontalPodAutoscalerStatus struct {
// most recent generation observed by this autoscaler.
// +optional
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
// last time the HorizontalPodAutoscaler scaled the number of pods;
// used by the autoscaler to control how often the number of pods is changed.
// +optional
LastScaleTime *unversioned.Time `json:"lastScaleTime,omitempty"`
// current number of replicas of pods managed by this autoscaler.
......@@ -93,6 +103,7 @@ type HorizontalPodAutoscalerStatus struct {
// current average CPU utilization over all pods, represented as a percentage of requested CPU,
// e.g. 70 means that an average pod is using now 70% of its requested CPU.
// +optional
CurrentCPUUtilizationPercentage *int32 `json:"currentCPUUtilizationPercentage,omitempty"`
}
......@@ -101,18 +112,22 @@ type HorizontalPodAutoscalerStatus struct {
// configuration of a horizontal pod autoscaler.
type HorizontalPodAutoscaler struct {
unversioned.TypeMeta `json:",inline"`
api.ObjectMeta `json:"metadata,omitempty"`
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
// behaviour of autoscaler. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status.
// +optional
Spec HorizontalPodAutoscalerSpec `json:"spec,omitempty"`
// current information about the autoscaler.
// +optional
Status HorizontalPodAutoscalerStatus `json:"status,omitempty"`
}
// list of horizontal pod autoscaler objects.
type HorizontalPodAutoscalerList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
// list of horizontal pod autoscaler objects.
......
......@@ -39,24 +39,29 @@ message CrossVersionObjectReference {
optional string name = 2;
// API version of the referent
// +optional
optional string apiVersion = 3;
}
// configuration of a horizontal pod autoscaler.
message HorizontalPodAutoscaler {
// Standard object metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// behaviour of autoscaler. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status.
// +optional
optional HorizontalPodAutoscalerSpec spec = 2;
// current information about the autoscaler.
// +optional
optional HorizontalPodAutoscalerStatus status = 3;
}
// list of horizontal pod autoscaler objects.
message HorizontalPodAutoscalerList {
// Standard list metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
// list of horizontal pod autoscaler objects.
......@@ -70,6 +75,7 @@ message HorizontalPodAutoscalerSpec {
optional CrossVersionObjectReference scaleTargetRef = 1;
// lower limit for the number of pods that can be set by the autoscaler, default 1.
// +optional
optional int32 minReplicas = 2;
// upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas.
......@@ -77,16 +83,19 @@ message HorizontalPodAutoscalerSpec {
// target average CPU utilization (represented as a percentage of requested CPU) over all the pods;
// if not specified the default autoscaling policy will be used.
// +optional
optional int32 targetCPUUtilizationPercentage = 4;
}
// current status of a horizontal pod autoscaler
message HorizontalPodAutoscalerStatus {
// most recent generation observed by this autoscaler.
// +optional
optional int64 observedGeneration = 1;
// last time the HorizontalPodAutoscaler scaled the number of pods;
// used by the autoscaler to control how often the number of pods is changed.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.Time lastScaleTime = 2;
// current number of replicas of pods managed by this autoscaler.
......@@ -97,24 +106,29 @@ message HorizontalPodAutoscalerStatus {
// current average CPU utilization over all pods, represented as a percentage of requested CPU,
// e.g. 70 means that an average pod is using now 70% of its requested CPU.
// +optional
optional int32 currentCPUUtilizationPercentage = 5;
}
// Scale represents a scaling request for a resource.
message Scale {
// Standard object metadata; More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// defines the behavior of the scale. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status.
// +optional
optional ScaleSpec spec = 2;
// current status of the scale. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status. Read-only.
// +optional
optional ScaleStatus status = 3;
}
// ScaleSpec describes the attributes of a scale subresource.
message ScaleSpec {
// desired number of instances for the scaled object.
// +optional
optional int32 replicas = 1;
}
......@@ -127,6 +141,7 @@ message ScaleStatus {
// as the label selector but in the string format to avoid introspection
// by clients. The string will be in the same format as the query-param syntax.
// More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
optional string selector = 2;
}
......@@ -28,6 +28,7 @@ type CrossVersionObjectReference struct {
// Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names
Name string `json:"name" protobuf:"bytes,2,opt,name=name"`
// API version of the referent
// +optional
APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,3,opt,name=apiVersion"`
}
......@@ -37,21 +38,25 @@ type HorizontalPodAutoscalerSpec struct {
// and will set the desired number of pods by using its Scale subresource.
ScaleTargetRef CrossVersionObjectReference `json:"scaleTargetRef" protobuf:"bytes,1,opt,name=scaleTargetRef"`
// lower limit for the number of pods that can be set by the autoscaler, default 1.
// +optional
MinReplicas *int32 `json:"minReplicas,omitempty" protobuf:"varint,2,opt,name=minReplicas"`
// upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas.
MaxReplicas int32 `json:"maxReplicas" protobuf:"varint,3,opt,name=maxReplicas"`
// target average CPU utilization (represented as a percentage of requested CPU) over all the pods;
// if not specified the default autoscaling policy will be used.
// +optional
TargetCPUUtilizationPercentage *int32 `json:"targetCPUUtilizationPercentage,omitempty" protobuf:"varint,4,opt,name=targetCPUUtilizationPercentage"`
}
// current status of a horizontal pod autoscaler
type HorizontalPodAutoscalerStatus struct {
// most recent generation observed by this autoscaler.
// +optional
ObservedGeneration *int64 `json:"observedGeneration,omitempty" protobuf:"varint,1,opt,name=observedGeneration"`
// last time the HorizontalPodAutoscaler scaled the number of pods;
// used by the autoscaler to control how often the number of pods is changed.
// +optional
LastScaleTime *unversioned.Time `json:"lastScaleTime,omitempty" protobuf:"bytes,2,opt,name=lastScaleTime"`
// current number of replicas of pods managed by this autoscaler.
......@@ -62,6 +67,7 @@ type HorizontalPodAutoscalerStatus struct {
// current average CPU utilization over all pods, represented as a percentage of requested CPU,
// e.g. 70 means that an average pod is using now 70% of its requested CPU.
// +optional
CurrentCPUUtilizationPercentage *int32 `json:"currentCPUUtilizationPercentage,omitempty" protobuf:"varint,5,opt,name=currentCPUUtilizationPercentage"`
}
......@@ -71,12 +77,15 @@ type HorizontalPodAutoscalerStatus struct {
type HorizontalPodAutoscaler struct {
unversioned.TypeMeta `json:",inline"`
// Standard object metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// behaviour of autoscaler. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status.
// +optional
Spec HorizontalPodAutoscalerSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
// current information about the autoscaler.
// +optional
Status HorizontalPodAutoscalerStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
......@@ -84,6 +93,7 @@ type HorizontalPodAutoscaler struct {
type HorizontalPodAutoscalerList struct {
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// +optional
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// list of horizontal pod autoscaler objects.
......@@ -94,18 +104,22 @@ type HorizontalPodAutoscalerList struct {
type Scale struct {
unversioned.TypeMeta `json:",inline"`
// Standard object metadata; More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata.
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// defines the behavior of the scale. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status.
// +optional
Spec ScaleSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
// current status of the scale. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status. Read-only.
// +optional
Status ScaleStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
// ScaleSpec describes the attributes of a scale subresource.
type ScaleSpec struct {
// desired number of instances for the scaled object.
// +optional
Replicas int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
}
......@@ -118,5 +132,6 @@ type ScaleStatus struct {
// as the label selector but in the string format to avoid introspection
// by clients. The string will be in the same format as the query-param syntax.
// More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
Selector string `json:"selector,omitempty" protobuf:"bytes,2,opt,name=selector"`
}
......@@ -28,14 +28,17 @@ type Job struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
// Spec is a structure defining the expected behavior of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Spec JobSpec `json:"spec,omitempty"`
// Status is a structure describing current status of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Status JobStatus `json:"status,omitempty"`
}
......@@ -44,6 +47,7 @@ type JobList struct {
unversioned.TypeMeta `json:",inline"`
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
// Items is the list of Job.
......@@ -55,10 +59,12 @@ type JobTemplate struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
// Template defines jobs that will be created from this template
// http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Template JobTemplateSpec `json:"template,omitempty"`
}
......@@ -66,10 +72,12 @@ type JobTemplate struct {
type JobTemplateSpec struct {
// Standard object's metadata of the jobs created from this template.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
// Specification of the desired behavior of the job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Spec JobSpec `json:"spec,omitempty"`
}
......@@ -80,6 +88,7 @@ type JobSpec struct {
// run at any given time. The actual number of pods running in steady state will
// be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism),
// i.e. when the work left to do is less than max parallelism.
// +optional
Parallelism *int32 `json:"parallelism,omitempty"`
// Completions specifies the desired number of successfully finished pods the
......@@ -87,14 +96,17 @@ type JobSpec struct {
// pod signals the success of all pods, and allows parallelism to have any positive
// value. Setting to 1 means that parallelism is limited to 1 and the success of that
// pod signals the success of the job.
// +optional
Completions *int32 `json:"completions,omitempty"`
// Optional duration in seconds relative to the startTime that the job may be active
// before the system tries to terminate it; value must be positive integer
// +optional
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`
// Selector is a label query over pods that should match the pod count.
// Normally, the system sets this field for you.
// +optional
Selector *unversioned.LabelSelector `json:"selector,omitempty"`
// ManualSelector controls generation of pod labels and pod selectors.
......@@ -106,6 +118,7 @@ type JobSpec struct {
// and other jobs to not function correctly. However, You may see
// `manualSelector=true` in jobs that were created with the old `extensions/v1beta1`
// API.
// +optional
ManualSelector *bool `json:"manualSelector,omitempty"`
// Template is the object that describes the pod that will be created when
......@@ -117,25 +130,31 @@ type JobSpec struct {
type JobStatus struct {
// Conditions represent the latest available observations of an object's current state.
// +optional
Conditions []JobCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
// StartTime represents time when the job was acknowledged by the Job Manager.
// It is not guaranteed to be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC.
// +optional
StartTime *unversioned.Time `json:"startTime,omitempty"`
// CompletionTime represents time when the job was completed. It is not guaranteed to
// be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC.
// +optional
CompletionTime *unversioned.Time `json:"completionTime,omitempty"`
// Active is the number of actively running pods.
// +optional
Active int32 `json:"active,omitempty"`
// Succeeded is the number of pods which reached Phase Succeeded.
// +optional
Succeeded int32 `json:"succeeded,omitempty"`
// Failed is the number of pods which reached Phase Failed.
// +optional
Failed int32 `json:"failed,omitempty"`
}
......@@ -156,12 +175,16 @@ type JobCondition struct {
// Status of the condition, one of True, False, Unknown.
Status api.ConditionStatus `json:"status"`
// Last time the condition was checked.
// +optional
LastProbeTime unversioned.Time `json:"lastProbeTime,omitempty"`
// Last time the condition transit from one status to another.
// +optional
LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty"`
// (brief) reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty"`
// Human readable message indicating details about last transition.
// +optional
Message string `json:"message,omitempty"`
}
......@@ -172,14 +195,17 @@ type ScheduledJob struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
// Spec is a structure defining the expected behavior of a job, including the schedule.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Spec ScheduledJobSpec `json:"spec,omitempty"`
// Status is a structure describing current status of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Status ScheduledJobStatus `json:"status,omitempty"`
}
......@@ -188,6 +214,7 @@ type ScheduledJobList struct {
unversioned.TypeMeta `json:",inline"`
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
// Items is the list of ScheduledJob.
......@@ -202,13 +229,16 @@ type ScheduledJobSpec struct {
// Optional deadline in seconds for starting the job if it misses scheduled
// time for any reason. Missed jobs executions will be counted as failed ones.
// +optional
StartingDeadlineSeconds *int64 `json:"startingDeadlineSeconds,omitempty"`
// ConcurrencyPolicy specifies how to treat concurrent executions of a Job.
// +optional
ConcurrencyPolicy ConcurrencyPolicy `json:"concurrencyPolicy,omitempty"`
// Suspend flag tells the controller to suspend subsequent executions, it does
// not apply to already started executions. Defaults to false.
// +optional
Suspend *bool `json:"suspend,omitempty"`
// JobTemplate is the object that describes the job that will be created when
......@@ -237,8 +267,10 @@ const (
// ScheduledJobStatus represents the current state of a Job.
type ScheduledJobStatus struct {
// Active holds pointers to currently running jobs.
// +optional
Active []api.ObjectReference `json:"active,omitempty"`
// LastScheduleTime keeps information of when was the last time the job was successfully scheduled.
// +optional
LastScheduleTime *unversioned.Time `json:"lastScheduleTime,omitempty"`
}
......@@ -34,14 +34,17 @@ option go_package = "v1";
message Job {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Spec is a structure defining the expected behavior of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
optional JobSpec spec = 2;
// Status is a structure describing current status of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
optional JobStatus status = 3;
}
......@@ -54,15 +57,19 @@ message JobCondition {
optional string status = 2;
// Last time the condition was checked.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.Time lastProbeTime = 3;
// Last time the condition transit from one status to another.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.Time lastTransitionTime = 4;
// (brief) reason for the condition's last transition.
// +optional
optional string reason = 5;
// Human readable message indicating details about last transition.
// +optional
optional string message = 6;
}
......@@ -70,6 +77,7 @@ message JobCondition {
message JobList {
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
// Items is the list of Job.
......@@ -83,6 +91,7 @@ message JobSpec {
// be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism),
// i.e. when the work left to do is less than max parallelism.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
optional int32 parallelism = 1;
// Completions specifies the desired number of successfully finished pods the
......@@ -91,15 +100,18 @@ message JobSpec {
// value. Setting to 1 means that parallelism is limited to 1 and the success of that
// pod signals the success of the job.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
optional int32 completions = 2;
// Optional duration in seconds relative to the startTime that the job may be active
// before the system tries to terminate it; value must be positive integer
// +optional
optional int64 activeDeadlineSeconds = 3;
// Selector is a label query over pods that should match the pod count.
// Normally, the system sets this field for you.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
optional LabelSelector selector = 4;
// ManualSelector controls generation of pod labels and pod selectors.
......@@ -112,6 +124,7 @@ message JobSpec {
// `manualSelector=true` in jobs that were created with the old `extensions/v1beta1`
// API.
// More info: http://releases.k8s.io/HEAD/docs/design/selector-generation.md
// +optional
optional bool manualSelector = 5;
// Template is the object that describes the pod that will be created when
......@@ -124,25 +137,31 @@ message JobSpec {
message JobStatus {
// Conditions represent the latest available observations of an object's current state.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
repeated JobCondition conditions = 1;
// StartTime represents time when the job was acknowledged by the Job Manager.
// It is not guaranteed to be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.Time startTime = 2;
// CompletionTime represents time when the job was completed. It is not guaranteed to
// be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.Time completionTime = 3;
// Active is the number of actively running pods.
// +optional
optional int32 active = 4;
// Succeeded is the number of pods which reached Phase Succeeded.
// +optional
optional int32 succeeded = 5;
// Failed is the number of pods which reached Phase Failed.
// +optional
optional int32 failed = 6;
}
......@@ -153,9 +172,11 @@ message LabelSelector {
// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
// map is equivalent to an element of matchExpressions, whose key field is "key", the
// operator is "In", and the values array contains only "value". The requirements are ANDed.
// +optional
map<string, string> matchLabels = 1;
// matchExpressions is a list of label selector requirements. The requirements are ANDed.
// +optional
repeated LabelSelectorRequirement matchExpressions = 2;
}
......@@ -173,6 +194,7 @@ message LabelSelectorRequirement {
// the values array must be non-empty. If the operator is Exists or DoesNotExist,
// the values array must be empty. This array is replaced during a strategic
// merge patch.
// +optional
repeated string values = 3;
}
......@@ -28,14 +28,17 @@ type Job struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Spec is a structure defining the expected behavior of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Spec JobSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
// Status is a structure describing current status of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Status JobStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
......@@ -44,6 +47,7 @@ type JobList struct {
unversioned.TypeMeta `json:",inline"`
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is the list of Job.
......@@ -58,6 +62,7 @@ type JobSpec struct {
// be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism),
// i.e. when the work left to do is less than max parallelism.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
Parallelism *int32 `json:"parallelism,omitempty" protobuf:"varint,1,opt,name=parallelism"`
// Completions specifies the desired number of successfully finished pods the
......@@ -66,15 +71,18 @@ type JobSpec struct {
// value. Setting to 1 means that parallelism is limited to 1 and the success of that
// pod signals the success of the job.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
Completions *int32 `json:"completions,omitempty" protobuf:"varint,2,opt,name=completions"`
// Optional duration in seconds relative to the startTime that the job may be active
// before the system tries to terminate it; value must be positive integer
// +optional
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty" protobuf:"varint,3,opt,name=activeDeadlineSeconds"`
// Selector is a label query over pods that should match the pod count.
// Normally, the system sets this field for you.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
Selector *LabelSelector `json:"selector,omitempty" protobuf:"bytes,4,opt,name=selector"`
// ManualSelector controls generation of pod labels and pod selectors.
......@@ -87,6 +95,7 @@ type JobSpec struct {
// `manualSelector=true` in jobs that were created with the old `extensions/v1beta1`
// API.
// More info: http://releases.k8s.io/HEAD/docs/design/selector-generation.md
// +optional
ManualSelector *bool `json:"manualSelector,omitempty" protobuf:"varint,5,opt,name=manualSelector"`
// Template is the object that describes the pod that will be created when
......@@ -100,25 +109,31 @@ type JobStatus struct {
// Conditions represent the latest available observations of an object's current state.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
Conditions []JobCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
// StartTime represents time when the job was acknowledged by the Job Manager.
// It is not guaranteed to be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC.
// +optional
StartTime *unversioned.Time `json:"startTime,omitempty" protobuf:"bytes,2,opt,name=startTime"`
// CompletionTime represents time when the job was completed. It is not guaranteed to
// be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC.
// +optional
CompletionTime *unversioned.Time `json:"completionTime,omitempty" protobuf:"bytes,3,opt,name=completionTime"`
// Active is the number of actively running pods.
// +optional
Active int32 `json:"active,omitempty" protobuf:"varint,4,opt,name=active"`
// Succeeded is the number of pods which reached Phase Succeeded.
// +optional
Succeeded int32 `json:"succeeded,omitempty" protobuf:"varint,5,opt,name=succeeded"`
// Failed is the number of pods which reached Phase Failed.
// +optional
Failed int32 `json:"failed,omitempty" protobuf:"varint,6,opt,name=failed"`
}
......@@ -139,12 +154,16 @@ type JobCondition struct {
// Status of the condition, one of True, False, Unknown.
Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"`
// Last time the condition was checked.
// +optional
LastProbeTime unversioned.Time `json:"lastProbeTime,omitempty" protobuf:"bytes,3,opt,name=lastProbeTime"`
// Last time the condition transit from one status to another.
// +optional
LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"`
// (brief) reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"`
// Human readable message indicating details about last transition.
// +optional
Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"`
}
......@@ -155,8 +174,10 @@ type LabelSelector struct {
// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
// map is equivalent to an element of matchExpressions, whose key field is "key", the
// operator is "In", and the values array contains only "value". The requirements are ANDed.
// +optional
MatchLabels map[string]string `json:"matchLabels,omitempty" protobuf:"bytes,1,rep,name=matchLabels"`
// matchExpressions is a list of label selector requirements. The requirements are ANDed.
// +optional
MatchExpressions []LabelSelectorRequirement `json:"matchExpressions,omitempty" protobuf:"bytes,2,rep,name=matchExpressions"`
}
......@@ -172,6 +193,7 @@ type LabelSelectorRequirement struct {
// the values array must be non-empty. If the operator is Exists or DoesNotExist,
// the values array must be empty. This array is replaced during a strategic
// merge patch.
// +optional
Values []string `json:"values,omitempty" protobuf:"bytes,3,rep,name=values"`
}
......
......@@ -34,14 +34,17 @@ option go_package = "v2alpha1";
message Job {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Spec is a structure defining the expected behavior of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
optional JobSpec spec = 2;
// Status is a structure describing current status of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
optional JobStatus status = 3;
}
......@@ -54,15 +57,19 @@ message JobCondition {
optional string status = 2;
// Last time the condition was checked.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.Time lastProbeTime = 3;
// Last time the condition transit from one status to another.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.Time lastTransitionTime = 4;
// (brief) reason for the condition's last transition.
// +optional
optional string reason = 5;
// Human readable message indicating details about last transition.
// +optional
optional string message = 6;
}
......@@ -70,6 +77,7 @@ message JobCondition {
message JobList {
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
// Items is the list of Job.
......@@ -83,6 +91,7 @@ message JobSpec {
// be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism),
// i.e. when the work left to do is less than max parallelism.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
optional int32 parallelism = 1;
// Completions specifies the desired number of successfully finished pods the
......@@ -91,15 +100,18 @@ message JobSpec {
// value. Setting to 1 means that parallelism is limited to 1 and the success of that
// pod signals the success of the job.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
optional int32 completions = 2;
// Optional duration in seconds relative to the startTime that the job may be active
// before the system tries to terminate it; value must be positive integer
// +optional
optional int64 activeDeadlineSeconds = 3;
// Selector is a label query over pods that should match the pod count.
// Normally, the system sets this field for you.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
optional LabelSelector selector = 4;
// ManualSelector controls generation of pod labels and pod selectors.
......@@ -112,6 +124,7 @@ message JobSpec {
// `manualSelector=true` in jobs that were created with the old `extensions/v1beta1`
// API.
// More info: http://releases.k8s.io/HEAD/docs/design/selector-generation.md
// +optional
optional bool manualSelector = 5;
// Template is the object that describes the pod that will be created when
......@@ -124,25 +137,31 @@ message JobSpec {
message JobStatus {
// Conditions represent the latest available observations of an object's current state.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
repeated JobCondition conditions = 1;
// StartTime represents time when the job was acknowledged by the Job Manager.
// It is not guaranteed to be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.Time startTime = 2;
// CompletionTime represents time when the job was completed. It is not guaranteed to
// be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.Time completionTime = 3;
// Active is the number of actively running pods.
// +optional
optional int32 active = 4;
// Succeeded is the number of pods which reached Phase Succeeded.
// +optional
optional int32 succeeded = 5;
// Failed is the number of pods which reached Phase Failed.
// +optional
optional int32 failed = 6;
}
......@@ -150,10 +169,12 @@ message JobStatus {
message JobTemplate {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Template defines jobs that will be created from this template
// http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
optional JobTemplateSpec template = 2;
}
......@@ -161,10 +182,12 @@ message JobTemplate {
message JobTemplateSpec {
// Standard object's metadata of the jobs created from this template.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
optional JobSpec spec = 2;
}
......@@ -175,9 +198,11 @@ message LabelSelector {
// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
// map is equivalent to an element of matchExpressions, whose key field is "key", the
// operator is "In", and the values array contains only "value". The requirements are ANDed.
// +optional
map<string, string> matchLabels = 1;
// matchExpressions is a list of label selector requirements. The requirements are ANDed.
// +optional
repeated LabelSelectorRequirement matchExpressions = 2;
}
......@@ -195,6 +220,7 @@ message LabelSelectorRequirement {
// the values array must be non-empty. If the operator is Exists or DoesNotExist,
// the values array must be empty. This array is replaced during a strategic
// merge patch.
// +optional
repeated string values = 3;
}
......@@ -202,14 +228,17 @@ message LabelSelectorRequirement {
message ScheduledJob {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Spec is a structure defining the expected behavior of a job, including the schedule.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
optional ScheduledJobSpec spec = 2;
// Status is a structure describing current status of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
optional ScheduledJobStatus status = 3;
}
......@@ -217,6 +246,7 @@ message ScheduledJob {
message ScheduledJobList {
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
// Items is the list of ScheduledJob.
......@@ -230,13 +260,16 @@ message ScheduledJobSpec {
// Optional deadline in seconds for starting the job if it misses scheduled
// time for any reason. Missed jobs executions will be counted as failed ones.
// +optional
optional int64 startingDeadlineSeconds = 2;
// ConcurrencyPolicy specifies how to treat concurrent executions of a Job.
// +optional
optional string concurrencyPolicy = 3;
// Suspend flag tells the controller to suspend subsequent executions, it does
// not apply to already started executions. Defaults to false.
// +optional
optional bool suspend = 4;
// JobTemplate is the object that describes the job that will be created when
......@@ -247,9 +280,11 @@ message ScheduledJobSpec {
// ScheduledJobStatus represents the current state of a Job.
message ScheduledJobStatus {
// Active holds pointers to currently running jobs.
// +optional
repeated k8s.io.kubernetes.pkg.api.v1.ObjectReference active = 1;
// LastScheduleTime keeps information of when was the last time the job was successfully scheduled.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.Time lastScheduleTime = 4;
}
......@@ -26,14 +26,17 @@ type Job struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Spec is a structure defining the expected behavior of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Spec JobSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
// Status is a structure describing current status of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Status JobStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
......@@ -42,6 +45,7 @@ type JobList struct {
unversioned.TypeMeta `json:",inline"`
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is the list of Job.
......@@ -53,10 +57,12 @@ type JobTemplate struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Template defines jobs that will be created from this template
// http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Template JobTemplateSpec `json:"template,omitempty" protobuf:"bytes,2,opt,name=template"`
}
......@@ -64,10 +70,12 @@ type JobTemplate struct {
type JobTemplateSpec struct {
// Standard object's metadata of the jobs created from this template.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Specification of the desired behavior of the job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Spec JobSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
}
......@@ -79,6 +87,7 @@ type JobSpec struct {
// be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism),
// i.e. when the work left to do is less than max parallelism.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
Parallelism *int32 `json:"parallelism,omitempty" protobuf:"varint,1,opt,name=parallelism"`
// Completions specifies the desired number of successfully finished pods the
......@@ -87,15 +96,18 @@ type JobSpec struct {
// value. Setting to 1 means that parallelism is limited to 1 and the success of that
// pod signals the success of the job.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
Completions *int32 `json:"completions,omitempty" protobuf:"varint,2,opt,name=completions"`
// Optional duration in seconds relative to the startTime that the job may be active
// before the system tries to terminate it; value must be positive integer
// +optional
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty" protobuf:"varint,3,opt,name=activeDeadlineSeconds"`
// Selector is a label query over pods that should match the pod count.
// Normally, the system sets this field for you.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
Selector *LabelSelector `json:"selector,omitempty" protobuf:"bytes,4,opt,name=selector"`
// ManualSelector controls generation of pod labels and pod selectors.
......@@ -108,6 +120,7 @@ type JobSpec struct {
// `manualSelector=true` in jobs that were created with the old `extensions/v1beta1`
// API.
// More info: http://releases.k8s.io/HEAD/docs/design/selector-generation.md
// +optional
ManualSelector *bool `json:"manualSelector,omitempty" protobuf:"varint,5,opt,name=manualSelector"`
// Template is the object that describes the pod that will be created when
......@@ -121,25 +134,31 @@ type JobStatus struct {
// Conditions represent the latest available observations of an object's current state.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
Conditions []JobCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
// StartTime represents time when the job was acknowledged by the Job Manager.
// It is not guaranteed to be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC.
// +optional
StartTime *unversioned.Time `json:"startTime,omitempty" protobuf:"bytes,2,opt,name=startTime"`
// CompletionTime represents time when the job was completed. It is not guaranteed to
// be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC.
// +optional
CompletionTime *unversioned.Time `json:"completionTime,omitempty" protobuf:"bytes,3,opt,name=completionTime"`
// Active is the number of actively running pods.
// +optional
Active int32 `json:"active,omitempty" protobuf:"varint,4,opt,name=active"`
// Succeeded is the number of pods which reached Phase Succeeded.
// +optional
Succeeded int32 `json:"succeeded,omitempty" protobuf:"varint,5,opt,name=succeeded"`
// Failed is the number of pods which reached Phase Failed.
// +optional
Failed int32 `json:"failed,omitempty" protobuf:"varint,6,opt,name=failed"`
}
......@@ -160,12 +179,16 @@ type JobCondition struct {
// Status of the condition, one of True, False, Unknown.
Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"`
// Last time the condition was checked.
// +optional
LastProbeTime unversioned.Time `json:"lastProbeTime,omitempty" protobuf:"bytes,3,opt,name=lastProbeTime"`
// Last time the condition transit from one status to another.
// +optional
LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"`
// (brief) reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"`
// Human readable message indicating details about last transition.
// +optional
Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"`
}
......@@ -174,14 +197,17 @@ type ScheduledJob struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Spec is a structure defining the expected behavior of a job, including the schedule.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Spec ScheduledJobSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
// Status is a structure describing current status of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Status ScheduledJobStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
......@@ -190,6 +216,7 @@ type ScheduledJobList struct {
unversioned.TypeMeta `json:",inline"`
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is the list of ScheduledJob.
......@@ -204,13 +231,16 @@ type ScheduledJobSpec struct {
// Optional deadline in seconds for starting the job if it misses scheduled
// time for any reason. Missed jobs executions will be counted as failed ones.
// +optional
StartingDeadlineSeconds *int64 `json:"startingDeadlineSeconds,omitempty" protobuf:"varint,2,opt,name=startingDeadlineSeconds"`
// ConcurrencyPolicy specifies how to treat concurrent executions of a Job.
// +optional
ConcurrencyPolicy ConcurrencyPolicy `json:"concurrencyPolicy,omitempty" protobuf:"bytes,3,opt,name=concurrencyPolicy,casttype=ConcurrencyPolicy"`
// Suspend flag tells the controller to suspend subsequent executions, it does
// not apply to already started executions. Defaults to false.
// +optional
Suspend *bool `json:"suspend,omitempty" protobuf:"varint,4,opt,name=suspend"`
// JobTemplate is the object that describes the job that will be created when
......@@ -239,9 +269,11 @@ const (
// ScheduledJobStatus represents the current state of a Job.
type ScheduledJobStatus struct {
// Active holds pointers to currently running jobs.
// +optional
Active []v1.ObjectReference `json:"active,omitempty" protobuf:"bytes,1,rep,name=active"`
// LastScheduleTime keeps information of when was the last time the job was successfully scheduled.
// +optional
LastScheduleTime *unversioned.Time `json:"lastScheduleTime,omitempty" protobuf:"bytes,4,opt,name=lastScheduleTime"`
}
......@@ -252,8 +284,10 @@ type LabelSelector struct {
// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
// map is equivalent to an element of matchExpressions, whose key field is "key", the
// operator is "In", and the values array contains only "value". The requirements are ANDed.
// +optional
MatchLabels map[string]string `json:"matchLabels,omitempty" protobuf:"bytes,1,rep,name=matchLabels"`
// matchExpressions is a list of label selector requirements. The requirements are ANDed.
// +optional
MatchExpressions []LabelSelectorRequirement `json:"matchExpressions,omitempty" protobuf:"bytes,2,rep,name=matchExpressions"`
}
......@@ -269,6 +303,7 @@ type LabelSelectorRequirement struct {
// the values array must be non-empty. If the operator is Exists or DoesNotExist,
// the values array must be empty. This array is replaced during a strategic
// merge patch.
// +optional
Values []string `json:"values,omitempty" protobuf:"bytes,3,rep,name=values"`
}
......
......@@ -27,12 +27,15 @@ import (
// Describes a certificate signing request
type CertificateSigningRequest struct {
unversioned.TypeMeta `json:",inline"`
api.ObjectMeta `json:"metadata,omitempty"`
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
// The certificate request itself and any additional information.
// +optional
Spec CertificateSigningRequestSpec `json:"spec,omitempty"`
// Derived information about the request.
// +optional
Status CertificateSigningRequestStatus `json:"status,omitempty"`
}
......@@ -45,16 +48,21 @@ type CertificateSigningRequestSpec struct {
// Information about the requesting user (if relevant)
// See user.Info interface for details
Username string `json:"username,omitempty"`
UID string `json:"uid,omitempty"`
Groups []string `json:"groups,omitempty"`
// +optional
Username string `json:"username,omitempty"`
// +optional
UID string `json:"uid,omitempty"`
// +optional
Groups []string `json:"groups,omitempty"`
}
type CertificateSigningRequestStatus struct {
// Conditions applied to the request, such as approval or denial.
// +optional
Conditions []CertificateSigningRequestCondition `json:"conditions,omitempty"`
// If request was approved, the controller will place the issued certificate here.
// +optional
Certificate []byte `json:"certificate,omitempty"`
}
......@@ -70,16 +78,21 @@ type CertificateSigningRequestCondition struct {
// request approval state, currently Approved or Denied.
Type RequestConditionType `json:"type"`
// brief reason for the request state
// +optional
Reason string `json:"reason,omitempty"`
// human readable message with details about the request state
// +optional
Message string `json:"message,omitempty"`
// timestamp for the last update to this condition
// +optional
LastUpdateTime unversioned.Time `json:"lastUpdateTime,omitempty"`
}
type CertificateSigningRequestList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
// +optional
Items []CertificateSigningRequest `json:"items,omitempty"`
}
......@@ -32,12 +32,15 @@ option go_package = "v1alpha1";
// Describes a certificate signing request
message CertificateSigningRequest {
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// The certificate request itself and any additional information.
// +optional
optional CertificateSigningRequestSpec spec = 2;
// Derived information about the request.
// +optional
optional CertificateSigningRequestStatus status = 3;
}
......@@ -46,16 +49,20 @@ message CertificateSigningRequestCondition {
optional string type = 1;
// brief reason for the request state
// +optional
optional string reason = 2;
// human readable message with details about the request state
// +optional
optional string message = 3;
// timestamp for the last update to this condition
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.Time lastUpdateTime = 4;
}
message CertificateSigningRequestList {
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
repeated CertificateSigningRequest items = 2;
......@@ -70,18 +77,23 @@ message CertificateSigningRequestSpec {
// Information about the requesting user (if relevant)
// See user.Info interface for details
// +optional
optional string username = 2;
// +optional
optional string uid = 3;
// +optional
repeated string groups = 4;
}
message CertificateSigningRequestStatus {
// Conditions applied to the request, such as approval or denial.
// +optional
repeated CertificateSigningRequestCondition conditions = 1;
// If request was approved, the controller will place the issued certificate here.
// +optional
optional bytes certificate = 2;
}
......@@ -27,12 +27,15 @@ import (
// Describes a certificate signing request
type CertificateSigningRequest struct {
unversioned.TypeMeta `json:",inline"`
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// The certificate request itself and any additional information.
// +optional
Spec CertificateSigningRequestSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
// Derived information about the request.
// +optional
Status CertificateSigningRequestStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
......@@ -45,16 +48,21 @@ type CertificateSigningRequestSpec struct {
// Information about the requesting user (if relevant)
// See user.Info interface for details
Username string `json:"username,omitempty" protobuf:"bytes,2,opt,name=username"`
UID string `json:"uid,omitempty" protobuf:"bytes,3,opt,name=uid"`
Groups []string `json:"groups,omitempty" protobuf:"bytes,4,rep,name=groups"`
// +optional
Username string `json:"username,omitempty" protobuf:"bytes,2,opt,name=username"`
// +optional
UID string `json:"uid,omitempty" protobuf:"bytes,3,opt,name=uid"`
// +optional
Groups []string `json:"groups,omitempty" protobuf:"bytes,4,rep,name=groups"`
}
type CertificateSigningRequestStatus struct {
// Conditions applied to the request, such as approval or denial.
// +optional
Conditions []CertificateSigningRequestCondition `json:"conditions,omitempty" protobuf:"bytes,1,rep,name=conditions"`
// If request was approved, the controller will place the issued certificate here.
// +optional
Certificate []byte `json:"certificate,omitempty" protobuf:"bytes,2,opt,name=certificate"`
}
......@@ -70,15 +78,19 @@ type CertificateSigningRequestCondition struct {
// request approval state, currently Approved or Denied.
Type RequestConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=RequestConditionType"`
// brief reason for the request state
// +optional
Reason string `json:"reason,omitempty" protobuf:"bytes,2,opt,name=reason"`
// human readable message with details about the request state
// +optional
Message string `json:"message,omitempty" protobuf:"bytes,3,opt,name=message"`
// timestamp for the last update to this condition
// +optional
LastUpdateTime unversioned.Time `json:"lastUpdateTime,omitempty" protobuf:"bytes,4,opt,name=lastUpdateTime"`
}
type CertificateSigningRequestList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
Items []CertificateSigningRequest `json:"items" protobuf:"bytes,2,rep,name=items"`
......
......@@ -271,25 +271,33 @@ type KubeletConfiguration struct {
// for additional third party volume plugins
VolumePluginDir string `json:"volumePluginDir"`
// cloudProvider is the provider for cloud services.
// +optional
CloudProvider string `json:"cloudProvider,omitempty"`
// cloudConfigFile is the path to the cloud provider configuration file.
// +optional
CloudConfigFile string `json:"cloudConfigFile,omitempty"`
// KubeletCgroups is the absolute name of cgroups to isolate the kubelet in.
// +optional
KubeletCgroups string `json:"kubeletCgroups,omitempty"`
// Enable QoS based Cgroup hierarchy: top level cgroups for QoS Classes
// And all Burstable and BestEffort pods are brought up under their
// specific top level QoS cgroup.
// +optional
CgroupsPerQOS bool `json:"cgroupsPerQOS,omitempty"`
// driver that the kubelet uses to manipulate cgroups on the host (cgroupfs or systemd)
// +optional
CgroupDriver string `json:"cgroupDriver,omitempty"`
// Cgroups that container runtime is expected to be isolated in.
// +optional
RuntimeCgroups string `json:"runtimeCgroups,omitempty"`
// SystemCgroups is absolute name of cgroups in which to place
// all non-kernel processes that are not already in a container. Empty
// for no container. Rolling back the flag requires a reboot.
// +optional
SystemCgroups string `json:"systemCgroups,omitempty"`
// CgroupRoot is the root cgroup to use for pods.
// If CgroupsPerQOS is enabled, this is the root of the QoS cgroup hierarchy.
// +optional
CgroupRoot string `json:"cgroupRoot,omitempty"`
// containerRuntime is the container runtime to use.
ContainerRuntime string `json:"containerRuntime"`
......@@ -299,14 +307,18 @@ type KubeletConfiguration struct {
RemoteImageEndpoint string `json:"remoteImageEndpoint"`
// runtimeRequestTimeout is the timeout for all runtime requests except long running
// requests - pull, logs, exec and attach.
// +optional
RuntimeRequestTimeout unversioned.Duration `json:"runtimeRequestTimeout,omitempty"`
// rktPath is the path of rkt binary. Leave empty to use the first rkt in
// $PATH.
// +optional
RktPath string `json:"rktPath,omitempty"`
// rktApiEndpoint is the endpoint of the rkt API service to communicate with.
// +optional
RktAPIEndpoint string `json:"rktAPIEndpoint,omitempty"`
// rktStage1Image is the image to use as stage1. Local paths and
// http/https URLs are supported.
// +optional
RktStage1Image string `json:"rktStage1Image,omitempty"`
// lockFilePath is the path that kubelet will use to as a lock file.
// It uses this file as a lock to synchronize with other kubelet processes
......@@ -373,9 +385,11 @@ type KubeletConfiguration struct {
SerializeImagePulls bool `json:"serializeImagePulls"`
// outOfDiskTransitionFrequency is duration for which the kubelet has to
// wait before transitioning out of out-of-disk node condition status.
// +optional
OutOfDiskTransitionFrequency unversioned.Duration `json:"outOfDiskTransitionFrequency,omitempty"`
// nodeIP is IP address of the node. If set, kubelet will use this IP
// address for the node.
// +optional
NodeIP string `json:"nodeIP,omitempty"`
// nodeLabels to add when registering the node in the cluster.
NodeLabels map[string]string `json:"nodeLabels"`
......@@ -384,16 +398,22 @@ type KubeletConfiguration struct {
// enable gathering custom metrics.
EnableCustomMetrics bool `json:"enableCustomMetrics"`
// Comma-delimited list of hard eviction expressions. For example, 'memory.available<300Mi'.
// +optional
EvictionHard string `json:"evictionHard,omitempty"`
// Comma-delimited list of soft eviction expressions. For example, 'memory.available<300Mi'.
// +optional
EvictionSoft string `json:"evictionSoft,omitempty"`
// Comma-delimeted list of grace periods for each soft eviction signal. For example, 'memory.available=30s'.
// +optional
EvictionSoftGracePeriod string `json:"evictionSoftGracePeriod,omitempty"`
// Duration for which the kubelet has to wait before transitioning out of an eviction pressure condition.
// +optional
EvictionPressureTransitionPeriod unversioned.Duration `json:"evictionPressureTransitionPeriod,omitempty"`
// Maximum allowed grace period (in seconds) to use when terminating pods in response to a soft eviction threshold being met.
// +optional
EvictionMaxPodGracePeriod int32 `json:"evictionMaxPodGracePeriod,omitempty"`
// Comma-delimited list of minimum reclaims (e.g. imagefs.available=2Gi) that describes the minimum amount of resource the kubelet will reclaim when performing a pod eviction if that resource is under pressure.
// +optional
EvictionMinimumReclaim string `json:"evictionMinimumReclaim,omitempty"`
// Maximum number of pods per core. Cannot exceed MaxPods
PodsPerCore int32 `json:"podsPerCore"`
......@@ -426,9 +446,11 @@ type KubeletConfiguration struct {
// Values must be within the range [0, 31]. Must be different from IPTablesMasqueradeBit
IPTablesDropBit int32 `json:"iptablesDropBit"`
// Whitelist of unsafe sysctls or sysctl patterns (ending in *).
// +optional
AllowedUnsafeSysctls []string `json:"experimentalAllowedUnsafeSysctls,omitempty"`
// How to integrate with runtime. If set to cri, kubelet will switch to
// using the new Container Runtine Interface.
// +optional
ExperimentalRuntimeIntegrationType string `json:"experimentalRuntimeIntegrationType,omitempty"`
}
......
......@@ -343,8 +343,10 @@ type KubeletConfiguration struct {
// Enable QoS based Cgroup hierarchy: top level cgroups for QoS Classes
// And all Burstable and BestEffort pods are brought up under their
// specific top level QoS cgroup.
// +optional
CgroupsPerQOS *bool `json:"cgroupsPerQOS,omitempty"`
// driver that the kubelet uses to manipulate cgroups on the host (cgroupfs or systemd)
// +optional
CgroupDriver string `json:"cgroupDriver,omitempty"`
// containerRuntime is the container runtime to use.
ContainerRuntime string `json:"containerRuntime"`
......@@ -482,8 +484,10 @@ type KubeletConfiguration struct {
IPTablesDropBit *int32 `json:"iptablesDropBit"`
// Whitelist of unsafe sysctls or sysctl patterns (ending in *). Use these at your own risk.
// Resource isolation might be lacking and pod might influence each other on the same node.
// +optional
AllowedUnsafeSysctls []string `json:"allowedUnsafeSysctls,omitempty"`
// How to integrate with runtime. If set to CRI, kubelet will switch to
// using the new Container Runtine Interface.
// +optional
ExperimentalRuntimeIntegrationType string `json:"experimentalRuntimeIntegrationType,omitempty"`
}
......@@ -45,6 +45,7 @@ const (
// describes the attributes of a scale subresource
type ScaleSpec struct {
// desired number of instances for the scaled object.
// +optional
Replicas int32 `json:"replicas,omitempty"`
}
......@@ -55,6 +56,7 @@ type ScaleStatus struct {
// label query over pods that should match the replicas count.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
Selector *unversioned.LabelSelector `json:"selector,omitempty"`
}
......@@ -65,12 +67,15 @@ type ScaleStatus struct {
type Scale struct {
unversioned.TypeMeta `json:",inline"`
// Standard object metadata; More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata.
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
// defines the behavior of the scale. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status.
// +optional
Spec ScaleSpec `json:"spec,omitempty"`
// current status of the scale. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status. Read-only.
// +optional
Status ScaleStatus `json:"status,omitempty"`
}
......@@ -111,12 +116,15 @@ type ThirdPartyResource struct {
unversioned.TypeMeta `json:",inline"`
// Standard object metadata
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
// Description is the description of this object.
// +optional
Description string `json:"description,omitempty"`
// Versions are versions for this third party object
// +optional
Versions []APIVersion `json:"versions,omitempty"`
}
......@@ -124,6 +132,7 @@ type ThirdPartyResourceList struct {
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
// Items is the list of horizontal pod autoscalers.
......@@ -134,6 +143,7 @@ type ThirdPartyResourceList struct {
// TODO: we should consider merge this struct with GroupVersion in unversioned.go
type APIVersion struct {
// Name of this version (e.g. 'v1').
// +optional
Name string `json:"name,omitempty"`
}
......@@ -141,9 +151,11 @@ type APIVersion struct {
type ThirdPartyResourceData struct {
unversioned.TypeMeta `json:",inline"`
// Standard object metadata.
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
// Data is the raw JSON data for this data.
// +optional
Data []byte `json:"data,omitempty"`
}
......@@ -151,43 +163,53 @@ type ThirdPartyResourceData struct {
type Deployment struct {
unversioned.TypeMeta `json:",inline"`
api.ObjectMeta `json:"metadata,omitempty"`
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
// Specification of the desired behavior of the Deployment.
// +optional
Spec DeploymentSpec `json:"spec,omitempty"`
// Most recently observed status of the Deployment.
// +optional
Status DeploymentStatus `json:"status,omitempty"`
}
type DeploymentSpec struct {
// Number of desired pods. This is a pointer to distinguish between explicit
// zero and not specified. Defaults to 1.
// +optional
Replicas int32 `json:"replicas,omitempty"`
// Label selector for pods. Existing ReplicaSets whose pods are
// selected by this will be the ones affected by this deployment.
// +optional
Selector *unversioned.LabelSelector `json:"selector,omitempty"`
// Template describes the pods that will be created.
Template api.PodTemplateSpec `json:"template"`
// The deployment strategy to use to replace existing pods with new ones.
// +optional
Strategy DeploymentStrategy `json:"strategy,omitempty"`
// Minimum number of seconds for which a newly created pod should be ready
// without any of its container crashing, for it to be considered available.
// Defaults to 0 (pod will be considered available as soon as it is ready)
// +optional
MinReadySeconds int32 `json:"minReadySeconds,omitempty"`
// The number of old ReplicaSets to retain to allow rollback.
// This is a pointer to distinguish between explicit zero and not specified.
// +optional
RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"`
// Indicates that the deployment is paused and will not be processed by the
// deployment controller.
// +optional
Paused bool `json:"paused,omitempty"`
// The config this deployment is rolling back to. Will be cleared after rollback is done.
// +optional
RollbackTo *RollbackConfig `json:"rollbackTo,omitempty"`
}
......@@ -197,6 +219,7 @@ type DeploymentRollback struct {
// Required: This must match the Name of a deployment.
Name string `json:"name"`
// The annotations to be updated to a deployment
// +optional
UpdatedAnnotations map[string]string `json:"updatedAnnotations,omitempty"`
// The config of this deployment rollback.
RollbackTo RollbackConfig `json:"rollbackTo"`
......@@ -204,6 +227,7 @@ type DeploymentRollback struct {
type RollbackConfig struct {
// The revision to rollback to. If set to 0, rollbck to the last revision.
// +optional
Revision int64 `json:"revision,omitempty"`
}
......@@ -216,6 +240,7 @@ const (
type DeploymentStrategy struct {
// Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate.
// +optional
Type DeploymentStrategyType `json:"type,omitempty"`
// Rolling update config params. Present only if DeploymentStrategyType =
......@@ -223,6 +248,7 @@ type DeploymentStrategy struct {
//---
// TODO: Update this to follow our convention for oneOf, whatever we decide it
// to be.
// +optional
RollingUpdate *RollingUpdateDeployment `json:"rollingUpdate,omitempty"`
}
......@@ -248,6 +274,7 @@ type RollingUpdateDeployment struct {
// can be scaled down further, followed by scaling up the new RC, ensuring
// that at least 70% of original number of pods are available at all times
// during the update.
// +optional
MaxUnavailable intstr.IntOrString `json:"maxUnavailable,omitempty"`
// The maximum number of pods that can be scheduled above the original number of
......@@ -260,28 +287,35 @@ type RollingUpdateDeployment struct {
// immediately when the rolling update starts. Once old pods have been killed,
// new RC can be scaled up further, ensuring that total number of pods running
// at any time during the update is atmost 130% of original pods.
// +optional
MaxSurge intstr.IntOrString `json:"maxSurge,omitempty"`
}
type DeploymentStatus struct {
// The generation observed by the deployment controller.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// Total number of non-terminated pods targeted by this deployment (their labels match the selector).
// +optional
Replicas int32 `json:"replicas,omitempty"`
// Total number of non-terminated pods targeted by this deployment that have the desired template spec.
// +optional
UpdatedReplicas int32 `json:"updatedReplicas,omitempty"`
// Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.
// +optional
AvailableReplicas int32 `json:"availableReplicas,omitempty"`
// Total number of unavailable pods targeted by this deployment.
// +optional
UnavailableReplicas int32 `json:"unavailableReplicas,omitempty"`
}
type DeploymentList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
// Items is the list of deployments.
......@@ -292,6 +326,7 @@ type DeploymentList struct {
/* Commenting out for v1.2. We are planning to bring these types back with a more robust DaemonSet update implementation in v1.3, hence not deleting but just commenting the types out.
type DaemonSetUpdateStrategy struct {
// Type of daemon set update. Only "RollingUpdate" is supported at this time. Default is RollingUpdate.
// +optional
Type DaemonSetUpdateStrategyType `json:"type,omitempty"`
// Rolling update config params. Present only if DaemonSetUpdateStrategy =
......@@ -299,6 +334,7 @@ type DaemonSetUpdateStrategy struct {
//---
// TODO: Update this to follow our convention for oneOf, whatever we decide it
// to be. Same as DeploymentStrategy.RollingUpdate.
// +optional
RollingUpdate *RollingUpdateDaemonSet `json:"rollingUpdate,omitempty"`
}
......@@ -324,12 +360,14 @@ type RollingUpdateDaemonSet struct {
// it then proceeds onto other DaemonSet pods, thus ensuring that at least
// 70% of original number of DaemonSet pods are available at all times
// during the update.
// +optional
MaxUnavailable intstr.IntOrString `json:"maxUnavailable,omitempty"`
// Minimum number of seconds for which a newly created DaemonSet pod should
// be ready without any of its container crashing, for it to be considered
// available. Defaults to 0 (pod will be considered available as soon as it
// is ready).
// +optional
MinReadySeconds int `json:"minReadySeconds,omitempty"`
}
*/
......@@ -340,6 +378,7 @@ type DaemonSetSpec struct {
// Must match in order to be controlled.
// If empty, defaulted to labels on Pod template.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
Selector *unversioned.LabelSelector `json:"selector,omitempty"`
// Template is the object that describes the pod that will be created.
......@@ -351,17 +390,19 @@ type DaemonSetSpec struct {
// TODO(madhusudancs): Uncomment while implementing DaemonSet updates.
/* Commenting out for v1.2. We are planning to bring these fields back with a more robust DaemonSet update implementation in v1.3, hence not deleting but just commenting these fields out.
// Update strategy to replace existing DaemonSet pods with new pods.
UpdateStrategy DaemonSetUpdateStrategy `json:"updateStrategy,omitempty"`
// Label key that is added to DaemonSet pods to distinguish between old and
// new pod templates during DaemonSet update.
// Users can set this to an empty string to indicate that the system should
// not add any label. If unspecified, system uses
// DefaultDaemonSetUniqueLabelKey("daemonset.kubernetes.io/podTemplateHash").
// Value of this key is hash of DaemonSetSpec.PodTemplateSpec.
// No label is added if this is set to empty string.
UniqueLabelKey string `json:"uniqueLabelKey,omitempty"`
// Update strategy to replace existing DaemonSet pods with new pods.
// +optional
UpdateStrategy DaemonSetUpdateStrategy `json:"updateStrategy,omitempty"`
// Label key that is added to DaemonSet pods to distinguish between old and
// new pod templates during DaemonSet update.
// Users can set this to an empty string to indicate that the system should
// not add any label. If unspecified, system uses
// DefaultDaemonSetUniqueLabelKey("daemonset.kubernetes.io/podTemplateHash").
// Value of this key is hash of DaemonSetSpec.PodTemplateSpec.
// No label is added if this is set to empty string.
// +optional
UniqueLabelKey string `json:"uniqueLabelKey,omitempty"`
*/
}
......@@ -398,10 +439,12 @@ type DaemonSet struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
// Spec defines the desired behavior of this daemon set.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Spec DaemonSetSpec `json:"spec,omitempty"`
// Status is the current status of this daemon set. This data may be
......@@ -409,6 +452,7 @@ type DaemonSet struct {
// Populated by the system.
// Read-only.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Status DaemonSetStatus `json:"status,omitempty"`
}
......@@ -417,6 +461,7 @@ type DaemonSetList struct {
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
// Items is a list of daemon sets.
......@@ -427,6 +472,7 @@ type ThirdPartyResourceDataList struct {
unversioned.TypeMeta `json:",inline"`
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
// Items is a list of third party objects
Items []ThirdPartyResourceData `json:"items"`
......@@ -442,14 +488,17 @@ type Ingress struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
// Spec is the desired state of the Ingress.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Spec IngressSpec `json:"spec,omitempty"`
// Status is the current state of the Ingress.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Status IngressStatus `json:"status,omitempty"`
}
......@@ -458,6 +507,7 @@ type IngressList struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
// Items is the list of Ingress.
......@@ -470,6 +520,7 @@ type IngressSpec struct {
// rule. At least one of 'backend' or 'rules' must be specified. This field
// is optional to allow the loadbalancer controller or defaulting logic to
// specify a global default.
// +optional
Backend *IngressBackend `json:"backend,omitempty"`
// TLS configuration. Currently the Ingress only supports a single TLS
......@@ -477,10 +528,12 @@ type IngressSpec struct {
// will be multiplexed on the same port according to the hostname specified
// through the SNI TLS extension, if the ingress controller fulfilling the
// ingress supports SNI.
// +optional
TLS []IngressTLS `json:"tls,omitempty"`
// A list of host rules used to configure the Ingress. If unspecified, or
// no rule matches, all traffic is sent to the default backend.
// +optional
Rules []IngressRule `json:"rules,omitempty"`
// TODO: Add the ability to specify load-balancer IP through claims
}
......@@ -491,12 +544,14 @@ type IngressTLS struct {
// this list must match the name/s used in the tlsSecret. Defaults to the
// wildcard host setting for the loadbalancer controller fulfilling this
// Ingress, if left unspecified.
// +optional
Hosts []string `json:"hosts,omitempty"`
// SecretName is the name of the secret used to terminate SSL traffic on 443.
// Field is left optional to allow SSL routing based on SNI hostname alone.
// If the SNI host in a listener conflicts with the "Host" header field used
// by an IngressRule, the SNI host is used for termination and value of the
// Host header is used for routing.
// +optional
SecretName string `json:"secretName,omitempty"`
// TODO: Consider specifying different modes of termination, protocols etc.
}
......@@ -504,6 +559,7 @@ type IngressTLS struct {
// IngressStatus describe the current state of the Ingress.
type IngressStatus struct {
// LoadBalancer contains the current status of the load-balancer.
// +optional
LoadBalancer api.LoadBalancerStatus `json:"loadBalancer,omitempty"`
}
......@@ -523,12 +579,14 @@ type IngressRule struct {
// Incoming requests are matched against the host before the IngressRuleValue.
// If the host is unspecified, the Ingress routes all traffic based on the
// specified IngressRuleValue.
// +optional
Host string `json:"host,omitempty"`
// IngressRuleValue represents a rule to route requests for this IngressRule.
// If unspecified, the rule defaults to a http catch-all. Whether that sends
// just traffic matching the host to the default backend or all traffic to the
// default backend, is left to the controller fulfilling the Ingress. Http is
// currently the only supported IngressRuleValue.
// +optional
IngressRuleValue `json:",inline,omitempty"`
}
......@@ -543,6 +601,7 @@ type IngressRuleValue struct {
// 2. Consider adding fields for ingress-type specific global options
// usable by a loadbalancer, like http keep-alive.
// +optional
HTTP *HTTPIngressRuleValue `json:"http,omitempty"`
}
......@@ -568,6 +627,7 @@ type HTTPIngressPath struct {
// part of a URL as defined by RFC 3986. Paths must begin with
// a '/'. If unspecified, the path defaults to a catch all sending
// traffic to the backend.
// +optional
Path string `json:"path,omitempty"`
// Backend defines the referenced service endpoint to which the traffic
......@@ -589,19 +649,23 @@ type IngressBackend struct {
// ReplicaSet represents the configuration of a replica set.
type ReplicaSet struct {
unversioned.TypeMeta `json:",inline"`
api.ObjectMeta `json:"metadata,omitempty"`
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
// Spec defines the desired behavior of this ReplicaSet.
// +optional
Spec ReplicaSetSpec `json:"spec,omitempty"`
// Status is the current status of this ReplicaSet. This data may be
// out of date by some window of time.
// +optional
Status ReplicaSetStatus `json:"status,omitempty"`
}
// ReplicaSetList is a collection of ReplicaSets.
type ReplicaSetList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
Items []ReplicaSet `json:"items"`
......@@ -617,16 +681,19 @@ type ReplicaSetSpec struct {
// Minimum number of seconds for which a newly created pod should be ready
// without any of its container crashing, for it to be considered available.
// Defaults to 0 (pod will be considered available as soon as it is ready)
// +optional
MinReadySeconds int32 `json:"minReadySeconds,omitempty"`
// Selector is a label query over pods that should match the replica count.
// Must match in order to be controlled.
// If empty, defaulted to labels on pod template.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
Selector *unversioned.LabelSelector `json:"selector,omitempty"`
// Template is the object that describes the pod that will be created if
// insufficient replicas are detected.
// +optional
Template api.PodTemplateSpec `json:"template,omitempty"`
}
......@@ -636,18 +703,23 @@ type ReplicaSetStatus struct {
Replicas int32 `json:"replicas"`
// The number of pods that have labels matching the labels of the pod template of the replicaset.
// +optional
FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty"`
// The number of ready replicas for this replica set.
// +optional
ReadyReplicas int32 `json:"readyReplicas,omitempty"`
// The number of available replicas (ready for at least minReadySeconds) for this replica set.
// +optional
AvailableReplicas int32 `json:"availableReplicas,omitempty"`
// ObservedGeneration is the most recent generation observed by the controller.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// Represents the latest available observations of a replica set's current state.
// +optional
Conditions []ReplicaSetCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}
......@@ -668,12 +740,16 @@ type ReplicaSetCondition struct {
// Status of the condition, one of True, False, Unknown.
Status api.ConditionStatus `json:"status"`
// Last time we probed the condition.
// +optional
LastProbeTime unversioned.Time `json:"lastProbeTime,omitempty"`
// The last time the condition transitioned from one status to another.
// +optional
LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty"`
// The reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty"`
// A human readable message indicating details about the transition.
// +optional
Message string `json:"message,omitempty"`
}
......@@ -684,37 +760,48 @@ type ReplicaSetCondition struct {
// that will be applied to a pod and container.
type PodSecurityPolicy struct {
unversioned.TypeMeta `json:",inline"`
api.ObjectMeta `json:"metadata,omitempty"`
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
// Spec defines the policy enforced.
// +optional
Spec PodSecurityPolicySpec `json:"spec,omitempty"`
}
// PodSecurityPolicySpec defines the policy enforced.
type PodSecurityPolicySpec struct {
// Privileged determines if a pod can request to be run as privileged.
// +optional
Privileged bool `json:"privileged,omitempty"`
// DefaultAddCapabilities is the default set of capabilities that will be added to the container
// unless the pod spec specifically drops the capability. You may not list a capability in both
// DefaultAddCapabilities and RequiredDropCapabilities.
// +optional
DefaultAddCapabilities []api.Capability `json:"defaultAddCapabilities,omitempty"`
// RequiredDropCapabilities are the capabilities that will be dropped from the container. These
// are required to be dropped and cannot be added.
// +optional
RequiredDropCapabilities []api.Capability `json:"requiredDropCapabilities,omitempty"`
// AllowedCapabilities is a list of capabilities that can be requested to add to the container.
// Capabilities in this field may be added at the pod author's discretion.
// You must not list a capability in both AllowedCapabilities and RequiredDropCapabilities.
// +optional
AllowedCapabilities []api.Capability `json:"allowedCapabilities,omitempty"`
// Volumes is a white list of allowed volume plugins. Empty indicates that all plugins
// may be used.
// +optional
Volumes []FSType `json:"volumes,omitempty"`
// HostNetwork determines if the policy allows the use of HostNetwork in the pod spec.
// +optional
HostNetwork bool `json:"hostNetwork,omitempty"`
// HostPorts determines which host port ranges are allowed to be exposed.
// +optional
HostPorts []HostPortRange `json:"hostPorts,omitempty"`
// HostPID determines if the policy allows the use of HostPID in the pod spec.
// +optional
HostPID bool `json:"hostPID,omitempty"`
// HostIPC determines if the policy allows the use of HostIPC in the pod spec.
// +optional
HostIPC bool `json:"hostIPC,omitempty"`
// SELinux is the strategy that will dictate the allowable labels that may be set.
SELinux SELinuxStrategyOptions `json:"seLinux"`
......@@ -729,6 +816,7 @@ type PodSecurityPolicySpec struct {
// the PSP should deny the pod.
// If set to false the container may run with a read only root file system if it wishes but it
// will not be forced to.
// +optional
ReadOnlyRootFilesystem bool `json:"readOnlyRootFilesystem,omitempty"`
}
......@@ -776,6 +864,7 @@ type SELinuxStrategyOptions struct {
Rule SELinuxStrategy `json:"rule"`
// seLinuxOptions required to run as; required for MustRunAs
// More info: http://releases.k8s.io/HEAD/docs/design/security_context.md#security-context
// +optional
SELinuxOptions *api.SELinuxOptions `json:"seLinuxOptions,omitempty"`
}
......@@ -795,6 +884,7 @@ type RunAsUserStrategyOptions struct {
// Rule is the strategy that will dictate the allowable RunAsUser values that may be set.
Rule RunAsUserStrategy `json:"rule"`
// Ranges are the allowed ranges of uids that may be used.
// +optional
Ranges []IDRange `json:"ranges,omitempty"`
}
......@@ -822,9 +912,11 @@ const (
// FSGroupStrategyOptions defines the strategy type and options used to create the strategy.
type FSGroupStrategyOptions struct {
// Rule is the strategy that will dictate what FSGroup is used in the SecurityContext.
// +optional
Rule FSGroupStrategyType `json:"rule,omitempty"`
// Ranges are the allowed ranges of fs groups. If you would like to force a single
// fs group then supply a single range with the same start and end.
// +optional
Ranges []IDRange `json:"ranges,omitempty"`
}
......@@ -842,9 +934,11 @@ const (
// SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy.
type SupplementalGroupsStrategyOptions struct {
// Rule is the strategy that will dictate what supplemental groups is used in the SecurityContext.
// +optional
Rule SupplementalGroupsStrategyType `json:"rule,omitempty"`
// Ranges are the allowed ranges of supplemental groups. If you would like to force a single
// supplemental group then supply a single range with the same start and end.
// +optional
Ranges []IDRange `json:"ranges,omitempty"`
}
......@@ -862,6 +956,7 @@ const (
// PodSecurityPolicyList is a list of PodSecurityPolicy objects.
type PodSecurityPolicyList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
Items []PodSecurityPolicy `json:"items"`
......@@ -871,9 +966,11 @@ type PodSecurityPolicyList struct {
type NetworkPolicy struct {
unversioned.TypeMeta `json:",inline"`
api.ObjectMeta `json:"metadata,omitempty"`
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
// Specification of the desired behavior for this NetworkPolicy.
// +optional
Spec NetworkPolicySpec `json:"spec,omitempty"`
}
......@@ -893,6 +990,7 @@ type NetworkPolicySpec struct {
// If this field is empty then this NetworkPolicy does not affect ingress isolation.
// If this field is present and contains at least one rule, this policy allows any traffic
// which matches at least one of the ingress rules in this list.
// +optional
Ingress []NetworkPolicyIngressRule `json:"ingress,omitempty"`
}
......@@ -905,6 +1003,7 @@ type NetworkPolicyIngressRule struct {
// If this field is present and contains at least one item, then this rule allows traffic
// only if the traffic matches at least one port in the list.
// TODO: Update this to be a pointer to slice as soon as auto-generation supports it.
// +optional
Ports []NetworkPolicyPort `json:"ports,omitempty"`
// List of sources which should be able to access the pods selected for this rule.
......@@ -914,12 +1013,14 @@ type NetworkPolicyIngressRule struct {
// If this field is present and contains at least on item, this rule allows traffic only if the
// traffic matches at least one item in the from list.
// TODO: Update this to be a pointer to slice as soon as auto-generation supports it.
// +optional
From []NetworkPolicyPeer `json:"from,omitempty"`
}
type NetworkPolicyPort struct {
// Optional. The protocol (TCP or UDP) which traffic must match.
// If not specified, this field defaults to TCP.
// +optional
Protocol *api.Protocol `json:"protocol,omitempty"`
// If specified, the port on the given protocol. This can
......@@ -927,6 +1028,7 @@ type NetworkPolicyPort struct {
// this matches all port names and numbers.
// If present, only traffic on the specified protocol AND port
// will be matched.
// +optional
Port *intstr.IntOrString `json:"port,omitempty"`
}
......@@ -937,6 +1039,7 @@ type NetworkPolicyPeer struct {
// This field follows standard label selector semantics.
// If not provided, this selector selects no pods.
// If present but empty, this selector selects all pods in this namespace.
// +optional
PodSelector *unversioned.LabelSelector `json:"podSelector,omitempty"`
// Selects Namespaces using cluster scoped-labels. This
......@@ -944,12 +1047,14 @@ type NetworkPolicyPeer struct {
// This field follows standard label selector semantics.
// If omitted, this selector selects no namespaces.
// If present but empty, this selector selects all namespaces.
// +optional
NamespaceSelector *unversioned.LabelSelector `json:"namespaceSelector,omitempty"`
}
// NetworkPolicyList is a list of NetworkPolicy objects.
type NetworkPolicyList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
Items []NetworkPolicy `json:"items"`
......
......@@ -33,6 +33,7 @@ option go_package = "v1beta1";
// An APIVersion represents a single concrete version of an object model.
message APIVersion {
// Name of this version (e.g. 'v1').
// +optional
optional string name = 1;
}
......@@ -71,10 +72,12 @@ message CustomMetricTargetList {
message DaemonSet {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Spec defines the desired behavior of this daemon set.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
optional DaemonSetSpec spec = 2;
// Status is the current status of this daemon set. This data may be
......@@ -82,6 +85,7 @@ message DaemonSet {
// Populated by the system.
// Read-only.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
optional DaemonSetStatus status = 3;
}
......@@ -89,6 +93,7 @@ message DaemonSet {
message DaemonSetList {
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
// Items is a list of daemon sets.
......@@ -101,6 +106,7 @@ message DaemonSetSpec {
// Must match in order to be controlled.
// If empty, defaulted to labels on Pod template.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
optional LabelSelector selector = 1;
// Template is the object that describes the pod that will be created.
......@@ -136,18 +142,22 @@ message DaemonSetStatus {
// Deployment enables declarative updates for Pods and ReplicaSets.
message Deployment {
// Standard object metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the Deployment.
// +optional
optional DeploymentSpec spec = 2;
// Most recently observed status of the Deployment.
// +optional
optional DeploymentStatus status = 3;
}
// DeploymentList is a list of Deployments.
message DeploymentList {
// Standard list metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
// Items is the list of Deployments.
......@@ -160,6 +170,7 @@ message DeploymentRollback {
optional string name = 1;
// The annotations to be updated to a deployment
// +optional
map<string, string> updatedAnnotations = 2;
// The config of this deployment rollback.
......@@ -170,56 +181,69 @@ message DeploymentRollback {
message DeploymentSpec {
// Number of desired pods. This is a pointer to distinguish between explicit
// zero and not specified. Defaults to 1.
// +optional
optional int32 replicas = 1;
// Label selector for pods. Existing ReplicaSets whose pods are
// selected by this will be the ones affected by this deployment.
// +optional
optional LabelSelector selector = 2;
// Template describes the pods that will be created.
optional k8s.io.kubernetes.pkg.api.v1.PodTemplateSpec template = 3;
// The deployment strategy to use to replace existing pods with new ones.
// +optional
optional DeploymentStrategy strategy = 4;
// Minimum number of seconds for which a newly created pod should be ready
// without any of its container crashing, for it to be considered available.
// Defaults to 0 (pod will be considered available as soon as it is ready)
// +optional
optional int32 minReadySeconds = 5;
// The number of old ReplicaSets to retain to allow rollback.
// This is a pointer to distinguish between explicit zero and not specified.
// +optional
optional int32 revisionHistoryLimit = 6;
// Indicates that the deployment is paused and will not be processed by the
// deployment controller.
// +optional
optional bool paused = 7;
// The config this deployment is rolling back to. Will be cleared after rollback is done.
// +optional
optional RollbackConfig rollbackTo = 8;
}
// DeploymentStatus is the most recently observed status of the Deployment.
message DeploymentStatus {
// The generation observed by the deployment controller.
// +optional
optional int64 observedGeneration = 1;
// Total number of non-terminated pods targeted by this deployment (their labels match the selector).
// +optional
optional int32 replicas = 2;
// Total number of non-terminated pods targeted by this deployment that have the desired template spec.
// +optional
optional int32 updatedReplicas = 3;
// Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.
// +optional
optional int32 availableReplicas = 4;
// Total number of unavailable pods targeted by this deployment.
// +optional
optional int32 unavailableReplicas = 5;
}
// DeploymentStrategy describes how to replace existing pods with new ones.
message DeploymentStrategy {
// Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate.
// +optional
optional string type = 1;
// Rolling update config params. Present only if DeploymentStrategyType =
......@@ -227,6 +251,7 @@ message DeploymentStrategy {
// ---
// TODO: Update this to follow our convention for oneOf, whatever we decide it
// to be.
// +optional
optional RollingUpdateDeployment rollingUpdate = 2;
}
......@@ -242,10 +267,12 @@ message ExportOptions {
// FSGroupStrategyOptions defines the strategy type and options used to create the strategy.
message FSGroupStrategyOptions {
// Rule is the strategy that will dictate what FSGroup is used in the SecurityContext.
// +optional
optional string rule = 1;
// Ranges are the allowed ranges of fs groups. If you would like to force a single
// fs group then supply a single range with the same start and end.
// +optional
repeated IDRange ranges = 2;
}
......@@ -259,6 +286,7 @@ message HTTPIngressPath {
// part of a URL as defined by RFC 3986. Paths must begin with
// a '/'. If unspecified, the path defaults to a catch all sending
// traffic to the backend.
// +optional
optional string path = 1;
// Backend defines the referenced service endpoint to which the traffic
......@@ -279,18 +307,22 @@ message HTTPIngressRuleValue {
// configuration of a horizontal pod autoscaler.
message HorizontalPodAutoscaler {
// Standard object metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// behaviour of autoscaler. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status.
// +optional
optional HorizontalPodAutoscalerSpec spec = 2;
// current information about the autoscaler.
// +optional
optional HorizontalPodAutoscalerStatus status = 3;
}
// list of horizontal pod autoscaler objects.
message HorizontalPodAutoscalerList {
// Standard list metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
// list of horizontal pod autoscaler objects.
......@@ -304,6 +336,7 @@ message HorizontalPodAutoscalerSpec {
optional SubresourceReference scaleRef = 1;
// lower limit for the number of pods that can be set by the autoscaler, default 1.
// +optional
optional int32 minReplicas = 2;
// upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas.
......@@ -311,16 +344,19 @@ message HorizontalPodAutoscalerSpec {
// target average CPU utilization (represented as a percentage of requested CPU) over all the pods;
// if not specified it defaults to the target CPU utilization at 80% of the requested resources.
// +optional
optional CPUTargetUtilization cpuUtilization = 4;
}
// current status of a horizontal pod autoscaler
message HorizontalPodAutoscalerStatus {
// most recent generation observed by this autoscaler.
// +optional
optional int64 observedGeneration = 1;
// last time the HorizontalPodAutoscaler scaled the number of pods;
// used by the autoscaler to control how often the number of pods is changed.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.Time lastScaleTime = 2;
// current number of replicas of pods managed by this autoscaler.
......@@ -331,6 +367,7 @@ message HorizontalPodAutoscalerStatus {
// current average CPU utilization over all pods, represented as a percentage of requested CPU,
// e.g. 70 means that an average pod is using now 70% of its requested CPU.
// +optional
optional int32 currentCPUUtilizationPercentage = 5;
}
......@@ -360,14 +397,17 @@ message IDRange {
message Ingress {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Spec is the desired state of the Ingress.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
optional IngressSpec spec = 2;
// Status is the current state of the Ingress.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
optional IngressStatus status = 3;
}
......@@ -384,6 +424,7 @@ message IngressBackend {
message IngressList {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
// Items is the list of Ingress.
......@@ -406,6 +447,7 @@ message IngressRule {
// Incoming requests are matched against the host before the IngressRuleValue.
// If the host is unspecified, the Ingress routes all traffic based on the
// specified IngressRuleValue.
// +optional
optional string host = 1;
// IngressRuleValue represents a rule to route requests for this IngressRule.
......@@ -413,6 +455,7 @@ message IngressRule {
// just traffic matching the host to the default backend or all traffic to the
// default backend, is left to the controller fulfilling the Ingress. Http is
// currently the only supported IngressRuleValue.
// +optional
optional IngressRuleValue ingressRuleValue = 2;
}
......@@ -421,6 +464,7 @@ message IngressRule {
// mixing different types of rules in a single Ingress is disallowed, so exactly
// one of the following must be set.
message IngressRuleValue {
// +optional
optional HTTPIngressRuleValue http = 1;
}
......@@ -430,6 +474,7 @@ message IngressSpec {
// rule. At least one of 'backend' or 'rules' must be specified. This field
// is optional to allow the loadbalancer controller or defaulting logic to
// specify a global default.
// +optional
optional IngressBackend backend = 1;
// TLS configuration. Currently the Ingress only supports a single TLS
......@@ -437,16 +482,19 @@ message IngressSpec {
// will be multiplexed on the same port according to the hostname specified
// through the SNI TLS extension, if the ingress controller fulfilling the
// ingress supports SNI.
// +optional
repeated IngressTLS tls = 2;
// A list of host rules used to configure the Ingress. If unspecified, or
// no rule matches, all traffic is sent to the default backend.
// +optional
repeated IngressRule rules = 3;
}
// IngressStatus describe the current state of the Ingress.
message IngressStatus {
// LoadBalancer contains the current status of the load-balancer.
// +optional
optional k8s.io.kubernetes.pkg.api.v1.LoadBalancerStatus loadBalancer = 1;
}
......@@ -456,6 +504,7 @@ message IngressTLS {
// this list must match the name/s used in the tlsSecret. Defaults to the
// wildcard host setting for the loadbalancer controller fulfilling this
// Ingress, if left unspecified.
// +optional
repeated string hosts = 1;
// SecretName is the name of the secret used to terminate SSL traffic on 443.
......@@ -463,6 +512,7 @@ message IngressTLS {
// If the SNI host in a listener conflicts with the "Host" header field used
// by an IngressRule, the SNI host is used for termination and value of the
// Host header is used for routing.
// +optional
optional string secretName = 2;
}
......@@ -470,14 +520,17 @@ message IngressTLS {
message Job {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Spec is a structure defining the expected behavior of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
optional JobSpec spec = 2;
// Status is a structure describing current status of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
optional JobStatus status = 3;
}
......@@ -490,15 +543,19 @@ message JobCondition {
optional string status = 2;
// Last time the condition was checked.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.Time lastProbeTime = 3;
// Last time the condition transit from one status to another.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.Time lastTransitionTime = 4;
// (brief) reason for the condition's last transition.
// +optional
optional string reason = 5;
// Human readable message indicating details about last transition.
// +optional
optional string message = 6;
}
......@@ -506,6 +563,7 @@ message JobCondition {
message JobList {
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
// Items is the list of Job.
......@@ -519,6 +577,7 @@ message JobSpec {
// be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism),
// i.e. when the work left to do is less than max parallelism.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
optional int32 parallelism = 1;
// Completions specifies the desired number of successfully finished pods the
......@@ -527,15 +586,18 @@ message JobSpec {
// value. Setting to 1 means that parallelism is limited to 1 and the success of that
// pod signals the success of the job.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
optional int32 completions = 2;
// Optional duration in seconds relative to the startTime that the job may be active
// before the system tries to terminate it; value must be positive integer
// +optional
optional int64 activeDeadlineSeconds = 3;
// Selector is a label query over pods that should match the pod count.
// Normally, the system sets this field for you.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
optional LabelSelector selector = 4;
// AutoSelector controls generation of pod labels and pod selectors.
......@@ -543,6 +605,7 @@ message JobSpec {
// to allow conversion from batch/v1 Jobs, where it corresponds to, but has the opposite
// meaning as, ManualSelector.
// More info: http://releases.k8s.io/HEAD/docs/design/selector-generation.md
// +optional
optional bool autoSelector = 5;
// Template is the object that describes the pod that will be created when
......@@ -555,25 +618,31 @@ message JobSpec {
message JobStatus {
// Conditions represent the latest available observations of an object's current state.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
repeated JobCondition conditions = 1;
// StartTime represents time when the job was acknowledged by the Job Manager.
// It is not guaranteed to be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.Time startTime = 2;
// CompletionTime represents time when the job was completed. It is not guaranteed to
// be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.Time completionTime = 3;
// Active is the number of actively running pods.
// +optional
optional int32 active = 4;
// Succeeded is the number of pods which reached Phase Succeeded.
// +optional
optional int32 succeeded = 5;
// Failed is the number of pods which reached Phase Failed.
// +optional
optional int32 failed = 6;
}
......@@ -584,9 +653,11 @@ message LabelSelector {
// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
// map is equivalent to an element of matchExpressions, whose key field is "key", the
// operator is "In", and the values array contains only "value". The requirements are ANDed.
// +optional
map<string, string> matchLabels = 1;
// matchExpressions is a list of label selector requirements. The requirements are ANDed.
// +optional
repeated LabelSelectorRequirement matchExpressions = 2;
}
......@@ -604,15 +675,18 @@ message LabelSelectorRequirement {
// the values array must be non-empty. If the operator is Exists or DoesNotExist,
// the values array must be empty. This array is replaced during a strategic
// merge patch.
// +optional
repeated string values = 3;
}
message NetworkPolicy {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior for this NetworkPolicy.
// +optional
optional NetworkPolicySpec spec = 2;
}
......@@ -625,6 +699,7 @@ message NetworkPolicyIngressRule {
// If this field is present and contains at least one item, then this rule allows traffic
// only if the traffic matches at least one port in the list.
// TODO: Update this to be a pointer to slice as soon as auto-generation supports it.
// +optional
repeated NetworkPolicyPort ports = 1;
// List of sources which should be able to access the pods selected for this rule.
......@@ -634,6 +709,7 @@ message NetworkPolicyIngressRule {
// If this field is present and contains at least on item, this rule allows traffic only if the
// traffic matches at least one item in the from list.
// TODO: Update this to be a pointer to slice as soon as auto-generation supports it.
// +optional
repeated NetworkPolicyPeer from = 2;
}
......@@ -641,6 +717,7 @@ message NetworkPolicyIngressRule {
message NetworkPolicyList {
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
// Items is a list of schema objects.
......@@ -652,6 +729,7 @@ message NetworkPolicyPeer {
// This field follows standard label selector semantics.
// If not provided, this selector selects no pods.
// If present but empty, this selector selects all pods in this namespace.
// +optional
optional LabelSelector podSelector = 1;
// Selects Namespaces using cluster scoped-labels. This
......@@ -659,12 +737,14 @@ message NetworkPolicyPeer {
// This field follows standard label selector semantics.
// If omitted, this selector selects no namespaces.
// If present but empty, this selector selects all namespaces.
// +optional
optional LabelSelector namespaceSelector = 2;
}
message NetworkPolicyPort {
// Optional. The protocol (TCP or UDP) which traffic must match.
// If not specified, this field defaults to TCP.
// +optional
optional string protocol = 1;
// If specified, the port on the given protocol. This can
......@@ -672,6 +752,7 @@ message NetworkPolicyPort {
// this matches all port names and numbers.
// If present, only traffic on the specified protocol AND port
// will be matched.
// +optional
optional k8s.io.kubernetes.pkg.util.intstr.IntOrString port = 2;
}
......@@ -691,6 +772,7 @@ message NetworkPolicySpec {
// If this field is empty then this NetworkPolicy does not affect ingress isolation.
// If this field is present and contains at least one rule, this policy allows any traffic
// which matches at least one of the ingress rules in this list.
// +optional
repeated NetworkPolicyIngressRule ingress = 2;
}
......@@ -699,9 +781,11 @@ message NetworkPolicySpec {
message PodSecurityPolicy {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// spec defines the policy enforced.
// +optional
optional PodSecurityPolicySpec spec = 2;
}
......@@ -709,6 +793,7 @@ message PodSecurityPolicy {
message PodSecurityPolicyList {
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
// Items is a list of schema objects.
......@@ -718,36 +803,45 @@ message PodSecurityPolicyList {
// Pod Security Policy Spec defines the policy enforced.
message PodSecurityPolicySpec {
// privileged determines if a pod can request to be run as privileged.
// +optional
optional bool privileged = 1;
// DefaultAddCapabilities is the default set of capabilities that will be added to the container
// unless the pod spec specifically drops the capability. You may not list a capabiility in both
// DefaultAddCapabilities and RequiredDropCapabilities.
// +optional
repeated string defaultAddCapabilities = 2;
// RequiredDropCapabilities are the capabilities that will be dropped from the container. These
// are required to be dropped and cannot be added.
// +optional
repeated string requiredDropCapabilities = 3;
// AllowedCapabilities is a list of capabilities that can be requested to add to the container.
// Capabilities in this field may be added at the pod author's discretion.
// You must not list a capability in both AllowedCapabilities and RequiredDropCapabilities.
// +optional
repeated string allowedCapabilities = 4;
// volumes is a white list of allowed volume plugins. Empty indicates that all plugins
// may be used.
// +optional
repeated string volumes = 5;
// hostNetwork determines if the policy allows the use of HostNetwork in the pod spec.
// +optional
optional bool hostNetwork = 6;
// hostPorts determines which host port ranges are allowed to be exposed.
// +optional
repeated HostPortRange hostPorts = 7;
// hostPID determines if the policy allows the use of HostPID in the pod spec.
// +optional
optional bool hostPID = 8;
// hostIPC determines if the policy allows the use of HostIPC in the pod spec.
// +optional
optional bool hostIPC = 9;
// seLinux is the strategy that will dictate the allowable labels that may be set.
......@@ -767,6 +861,7 @@ message PodSecurityPolicySpec {
// the PSP should deny the pod.
// If set to false the container may run with a read only root file system if it wishes but it
// will not be forced to.
// +optional
optional bool readOnlyRootFilesystem = 14;
}
......@@ -775,10 +870,12 @@ message ReplicaSet {
// If the Labels of a ReplicaSet are empty, they are defaulted to
// be the same as the Pod(s) that the ReplicaSet manages.
// Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Spec defines the specification of the desired behavior of the ReplicaSet.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
optional ReplicaSetSpec spec = 2;
// Status is the most recently observed status of the ReplicaSet.
......@@ -786,6 +883,7 @@ message ReplicaSet {
// Populated by the system.
// Read-only.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
optional ReplicaSetStatus status = 3;
}
......@@ -798,15 +896,19 @@ message ReplicaSetCondition {
optional string status = 2;
// Last time we probed the condition.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.Time lastProbeTime = 3;
// The last time the condition transitioned from one status to another.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.Time lastTransitionTime = 4;
// The reason for the condition's last transition.
// +optional
optional string reason = 5;
// A human readable message indicating details about the transition.
// +optional
optional string message = 6;
}
......@@ -814,6 +916,7 @@ message ReplicaSetCondition {
message ReplicaSetList {
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
// List of ReplicaSets.
......@@ -827,22 +930,26 @@ message ReplicaSetSpec {
// This is a pointer to distinguish between explicit zero and unspecified.
// Defaults to 1.
// More info: http://kubernetes.io/docs/user-guide/replication-controller#what-is-a-replication-controller
// +optional
optional int32 replicas = 1;
// Minimum number of seconds for which a newly created pod should be ready
// without any of its container crashing, for it to be considered available.
// Defaults to 0 (pod will be considered available as soon as it is ready)
// +optional
optional int32 minReadySeconds = 4;
// Selector is a label query over pods that should match the replica count.
// If the selector is empty, it is defaulted to the labels present on the pod template.
// Label keys and values that must match in order to be controlled by this replica set.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
optional LabelSelector selector = 2;
// Template is the object that describes the pod that will be created if
// insufficient replicas are detected.
// More info: http://kubernetes.io/docs/user-guide/replication-controller#pod-template
// +optional
optional k8s.io.kubernetes.pkg.api.v1.PodTemplateSpec template = 3;
}
......@@ -853,18 +960,23 @@ message ReplicaSetStatus {
optional int32 replicas = 1;
// The number of pods that have labels matching the labels of the pod template of the replicaset.
// +optional
optional int32 fullyLabeledReplicas = 2;
// The number of ready replicas for this replica set.
// +optional
optional int32 readyReplicas = 4;
// The number of available replicas (ready for at least minReadySeconds) for this replica set.
// +optional
optional int32 availableReplicas = 5;
// ObservedGeneration reflects the generation of the most recently observed ReplicaSet.
// +optional
optional int64 observedGeneration = 3;
// Represents the latest available observations of a replica set's current state.
// +optional
repeated ReplicaSetCondition conditions = 6;
}
......@@ -874,6 +986,7 @@ message ReplicationControllerDummy {
message RollbackConfig {
// The revision to rollback to. If set to 0, rollbck to the last revision.
// +optional
optional int64 revision = 1;
}
......@@ -889,6 +1002,7 @@ message RollingUpdateDeployment {
// can be scaled down further, followed by scaling up the new RC, ensuring
// that the total number of pods available at all times during the update is at
// least 70% of desired pods.
// +optional
optional k8s.io.kubernetes.pkg.util.intstr.IntOrString maxUnavailable = 1;
// The maximum number of pods that can be scheduled above the desired number of
......@@ -902,6 +1016,7 @@ message RollingUpdateDeployment {
// 130% of desired pods. Once old pods have been killed,
// new RC can be scaled up further, ensuring that total number of pods running
// at any time during the update is atmost 130% of desired pods.
// +optional
optional k8s.io.kubernetes.pkg.util.intstr.IntOrString maxSurge = 2;
}
......@@ -911,6 +1026,7 @@ message RunAsUserStrategyOptions {
optional string rule = 1;
// Ranges are the allowed ranges of uids that may be used.
// +optional
repeated IDRange ranges = 2;
}
......@@ -921,24 +1037,29 @@ message SELinuxStrategyOptions {
// seLinuxOptions required to run as; required for MustRunAs
// More info: http://releases.k8s.io/HEAD/docs/design/security_context.md#security-context
// +optional
optional k8s.io.kubernetes.pkg.api.v1.SELinuxOptions seLinuxOptions = 2;
}
// represents a scaling request for a resource.
message Scale {
// Standard object metadata; More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// defines the behavior of the scale. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status.
// +optional
optional ScaleSpec spec = 2;
// current status of the scale. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status. Read-only.
// +optional
optional ScaleStatus status = 3;
}
// describes the attributes of a scale subresource
message ScaleSpec {
// desired number of instances for the scaled object.
// +optional
optional int32 replicas = 1;
}
......@@ -948,6 +1069,7 @@ message ScaleStatus {
optional int32 replicas = 1;
// label query over pods that should match the replicas count. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
map<string, string> selector = 2;
// label selector for pods that should match the replicas count. This is a serializated
......@@ -956,31 +1078,38 @@ message ScaleStatus {
// query-param syntax. If the target type only supports map-based selectors, both this
// field and map-based selector field are populated.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
optional string targetSelector = 3;
}
// SubresourceReference contains enough information to let you inspect or modify the referred subresource.
message SubresourceReference {
// Kind of the referent; More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
// +optional
optional string kind = 1;
// Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names
// +optional
optional string name = 2;
// API version of the referent
// +optional
optional string apiVersion = 3;
// Subresource name of the referent
// +optional
optional string subresource = 4;
}
// SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy.
message SupplementalGroupsStrategyOptions {
// Rule is the strategy that will dictate what supplemental groups is used in the SecurityContext.
// +optional
optional string rule = 1;
// Ranges are the allowed ranges of supplemental groups. If you would like to force a single
// supplemental group then supply a single range with the same start and end.
// +optional
repeated IDRange ranges = 2;
}
......@@ -988,21 +1117,26 @@ message SupplementalGroupsStrategyOptions {
// types to the API. It consists of one or more Versions of the api.
message ThirdPartyResource {
// Standard object metadata
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Description is the description of this object.
// +optional
optional string description = 2;
// Versions are versions for this third party object
// +optional
repeated APIVersion versions = 3;
}
// An internal object, used for versioned storage in etcd. Not exposed to the end user.
message ThirdPartyResourceData {
// Standard object metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Data is the raw JSON data for this data.
// +optional
optional bytes data = 2;
}
......@@ -1010,6 +1144,7 @@ message ThirdPartyResourceData {
message ThirdPartyResourceDataList {
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
// Items is the list of ThirdpartyResourceData.
......@@ -1019,6 +1154,7 @@ message ThirdPartyResourceDataList {
// ThirdPartyResourceList is a list of ThirdPartyResources.
message ThirdPartyResourceList {
// Standard list metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
// Items is the list of ThirdPartyResources.
......
......@@ -26,6 +26,7 @@ import (
// describes the attributes of a scale subresource
type ScaleSpec struct {
// desired number of instances for the scaled object.
// +optional
Replicas int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
}
......@@ -35,6 +36,7 @@ type ScaleStatus struct {
Replicas int32 `json:"replicas" protobuf:"varint,1,opt,name=replicas"`
// label query over pods that should match the replicas count. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
Selector map[string]string `json:"selector,omitempty" protobuf:"bytes,2,rep,name=selector"`
// label selector for pods that should match the replicas count. This is a serializated
......@@ -43,6 +45,7 @@ type ScaleStatus struct {
// query-param syntax. If the target type only supports map-based selectors, both this
// field and map-based selector field are populated.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
TargetSelector string `json:"targetSelector,omitempty" protobuf:"bytes,3,opt,name=targetSelector"`
}
......@@ -53,12 +56,15 @@ type ScaleStatus struct {
type Scale struct {
unversioned.TypeMeta `json:",inline"`
// Standard object metadata; More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata.
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// defines the behavior of the scale. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status.
// +optional
Spec ScaleSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
// current status of the scale. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status. Read-only.
// +optional
Status ScaleStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
......@@ -70,12 +76,16 @@ type ReplicationControllerDummy struct {
// SubresourceReference contains enough information to let you inspect or modify the referred subresource.
type SubresourceReference struct {
// Kind of the referent; More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
// +optional
Kind string `json:"kind,omitempty" protobuf:"bytes,1,opt,name=kind"`
// Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names
// +optional
Name string `json:"name,omitempty" protobuf:"bytes,2,opt,name=name"`
// API version of the referent
// +optional
APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,3,opt,name=apiVersion"`
// Subresource name of the referent
// +optional
Subresource string `json:"subresource,omitempty" protobuf:"bytes,4,opt,name=subresource"`
}
......@@ -114,21 +124,25 @@ type HorizontalPodAutoscalerSpec struct {
// and will set the desired number of pods by modifying its spec.
ScaleRef SubresourceReference `json:"scaleRef" protobuf:"bytes,1,opt,name=scaleRef"`
// lower limit for the number of pods that can be set by the autoscaler, default 1.
// +optional
MinReplicas *int32 `json:"minReplicas,omitempty" protobuf:"varint,2,opt,name=minReplicas"`
// upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas.
MaxReplicas int32 `json:"maxReplicas" protobuf:"varint,3,opt,name=maxReplicas"`
// target average CPU utilization (represented as a percentage of requested CPU) over all the pods;
// if not specified it defaults to the target CPU utilization at 80% of the requested resources.
// +optional
CPUUtilization *CPUTargetUtilization `json:"cpuUtilization,omitempty" protobuf:"bytes,4,opt,name=cpuUtilization"`
}
// current status of a horizontal pod autoscaler
type HorizontalPodAutoscalerStatus struct {
// most recent generation observed by this autoscaler.
// +optional
ObservedGeneration *int64 `json:"observedGeneration,omitempty" protobuf:"varint,1,opt,name=observedGeneration"`
// last time the HorizontalPodAutoscaler scaled the number of pods;
// used by the autoscaler to control how often the number of pods is changed.
// +optional
LastScaleTime *unversioned.Time `json:"lastScaleTime,omitempty" protobuf:"bytes,2,opt,name=lastScaleTime"`
// current number of replicas of pods managed by this autoscaler.
......@@ -139,6 +153,7 @@ type HorizontalPodAutoscalerStatus struct {
// current average CPU utilization over all pods, represented as a percentage of requested CPU,
// e.g. 70 means that an average pod is using now 70% of its requested CPU.
// +optional
CurrentCPUUtilizationPercentage *int32 `json:"currentCPUUtilizationPercentage,omitempty" protobuf:"varint,5,opt,name=currentCPUUtilizationPercentage"`
}
......@@ -146,12 +161,15 @@ type HorizontalPodAutoscalerStatus struct {
type HorizontalPodAutoscaler struct {
unversioned.TypeMeta `json:",inline"`
// Standard object metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// behaviour of autoscaler. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status.
// +optional
Spec HorizontalPodAutoscalerSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
// current information about the autoscaler.
// +optional
Status HorizontalPodAutoscalerStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
......@@ -159,6 +177,7 @@ type HorizontalPodAutoscaler struct {
type HorizontalPodAutoscalerList struct {
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// +optional
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// list of horizontal pod autoscaler objects.
......@@ -174,12 +193,15 @@ type ThirdPartyResource struct {
unversioned.TypeMeta `json:",inline"`
// Standard object metadata
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Description is the description of this object.
// +optional
Description string `json:"description,omitempty" protobuf:"bytes,2,opt,name=description"`
// Versions are versions for this third party object
// +optional
Versions []APIVersion `json:"versions,omitempty" protobuf:"bytes,3,rep,name=versions"`
}
......@@ -188,6 +210,7 @@ type ThirdPartyResourceList struct {
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// +optional
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is the list of ThirdPartyResources.
......@@ -197,6 +220,7 @@ type ThirdPartyResourceList struct {
// An APIVersion represents a single concrete version of an object model.
type APIVersion struct {
// Name of this version (e.g. 'v1').
// +optional
Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
}
......@@ -204,9 +228,11 @@ type APIVersion struct {
type ThirdPartyResourceData struct {
unversioned.TypeMeta `json:",inline"`
// Standard object metadata.
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Data is the raw JSON data for this data.
// +optional
Data []byte `json:"data,omitempty" protobuf:"bytes,2,opt,name=data"`
}
......@@ -216,12 +242,15 @@ type ThirdPartyResourceData struct {
type Deployment struct {
unversioned.TypeMeta `json:",inline"`
// Standard object metadata.
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Specification of the desired behavior of the Deployment.
// +optional
Spec DeploymentSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
// Most recently observed status of the Deployment.
// +optional
Status DeploymentStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
......@@ -229,31 +258,38 @@ type Deployment struct {
type DeploymentSpec struct {
// Number of desired pods. This is a pointer to distinguish between explicit
// zero and not specified. Defaults to 1.
// +optional
Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
// Label selector for pods. Existing ReplicaSets whose pods are
// selected by this will be the ones affected by this deployment.
// +optional
Selector *LabelSelector `json:"selector,omitempty" protobuf:"bytes,2,opt,name=selector"`
// Template describes the pods that will be created.
Template v1.PodTemplateSpec `json:"template" protobuf:"bytes,3,opt,name=template"`
// The deployment strategy to use to replace existing pods with new ones.
// +optional
Strategy DeploymentStrategy `json:"strategy,omitempty" protobuf:"bytes,4,opt,name=strategy"`
// Minimum number of seconds for which a newly created pod should be ready
// without any of its container crashing, for it to be considered available.
// Defaults to 0 (pod will be considered available as soon as it is ready)
// +optional
MinReadySeconds int32 `json:"minReadySeconds,omitempty" protobuf:"varint,5,opt,name=minReadySeconds"`
// The number of old ReplicaSets to retain to allow rollback.
// This is a pointer to distinguish between explicit zero and not specified.
// +optional
RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty" protobuf:"varint,6,opt,name=revisionHistoryLimit"`
// Indicates that the deployment is paused and will not be processed by the
// deployment controller.
// +optional
Paused bool `json:"paused,omitempty" protobuf:"varint,7,opt,name=paused"`
// The config this deployment is rolling back to. Will be cleared after rollback is done.
// +optional
RollbackTo *RollbackConfig `json:"rollbackTo,omitempty" protobuf:"bytes,8,opt,name=rollbackTo"`
}
......@@ -263,6 +299,7 @@ type DeploymentRollback struct {
// Required: This must match the Name of a deployment.
Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
// The annotations to be updated to a deployment
// +optional
UpdatedAnnotations map[string]string `json:"updatedAnnotations,omitempty" protobuf:"bytes,2,rep,name=updatedAnnotations"`
// The config of this deployment rollback.
RollbackTo RollbackConfig `json:"rollbackTo" protobuf:"bytes,3,opt,name=rollbackTo"`
......@@ -270,6 +307,7 @@ type DeploymentRollback struct {
type RollbackConfig struct {
// The revision to rollback to. If set to 0, rollbck to the last revision.
// +optional
Revision int64 `json:"revision,omitempty" protobuf:"varint,1,opt,name=revision"`
}
......@@ -283,6 +321,7 @@ const (
// DeploymentStrategy describes how to replace existing pods with new ones.
type DeploymentStrategy struct {
// Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate.
// +optional
Type DeploymentStrategyType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type,casttype=DeploymentStrategyType"`
// Rolling update config params. Present only if DeploymentStrategyType =
......@@ -290,6 +329,7 @@ type DeploymentStrategy struct {
//---
// TODO: Update this to follow our convention for oneOf, whatever we decide it
// to be.
// +optional
RollingUpdate *RollingUpdateDeployment `json:"rollingUpdate,omitempty" protobuf:"bytes,2,opt,name=rollingUpdate"`
}
......@@ -315,6 +355,7 @@ type RollingUpdateDeployment struct {
// can be scaled down further, followed by scaling up the new RC, ensuring
// that the total number of pods available at all times during the update is at
// least 70% of desired pods.
// +optional
MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty" protobuf:"bytes,1,opt,name=maxUnavailable"`
// The maximum number of pods that can be scheduled above the desired number of
......@@ -328,24 +369,30 @@ type RollingUpdateDeployment struct {
// 130% of desired pods. Once old pods have been killed,
// new RC can be scaled up further, ensuring that total number of pods running
// at any time during the update is atmost 130% of desired pods.
// +optional
MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty" protobuf:"bytes,2,opt,name=maxSurge"`
}
// DeploymentStatus is the most recently observed status of the Deployment.
type DeploymentStatus struct {
// The generation observed by the deployment controller.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,1,opt,name=observedGeneration"`
// Total number of non-terminated pods targeted by this deployment (their labels match the selector).
// +optional
Replicas int32 `json:"replicas,omitempty" protobuf:"varint,2,opt,name=replicas"`
// Total number of non-terminated pods targeted by this deployment that have the desired template spec.
// +optional
UpdatedReplicas int32 `json:"updatedReplicas,omitempty" protobuf:"varint,3,opt,name=updatedReplicas"`
// Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.
// +optional
AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,4,opt,name=availableReplicas"`
// Total number of unavailable pods targeted by this deployment.
// +optional
UnavailableReplicas int32 `json:"unavailableReplicas,omitempty" protobuf:"varint,5,opt,name=unavailableReplicas"`
}
......@@ -353,6 +400,7 @@ type DeploymentStatus struct {
type DeploymentList struct {
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// +optional
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is the list of Deployments.
......@@ -363,6 +411,7 @@ type DeploymentList struct {
/* Commenting out for v1.2. We are planning to bring these types back with a more robust DaemonSet update implementation in v1.3, hence not deleting but just commenting the types out.
type DaemonSetUpdateStrategy struct {
// Type of daemon set update. Only "RollingUpdate" is supported at this time. Default is RollingUpdate.
// +optional
Type DaemonSetUpdateStrategyType `json:"type,omitempty"`
// Rolling update config params. Present only if DaemonSetUpdateStrategy =
......@@ -370,6 +419,7 @@ type DaemonSetUpdateStrategy struct {
//---
// TODO: Update this to follow our convention for oneOf, whatever we decide it
// to be. Same as DeploymentStrategy.RollingUpdate.
// +optional
RollingUpdate *RollingUpdateDaemonSet `json:"rollingUpdate,omitempty"`
}
......@@ -395,12 +445,14 @@ type RollingUpdateDaemonSet struct {
// it then proceeds onto other DaemonSet pods, thus ensuring that at least
// 70% of original number of DaemonSet pods are available at all times
// during the update.
// +optional
MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`
// Minimum number of seconds for which a newly created DaemonSet pod should
// be ready without any of its container crashing, for it to be considered
// available. Defaults to 0 (pod will be considered available as soon as it
// is ready).
// +optional
MinReadySeconds int32 `json:"minReadySeconds,omitempty"`
}
*/
......@@ -411,6 +463,7 @@ type DaemonSetSpec struct {
// Must match in order to be controlled.
// If empty, defaulted to labels on Pod template.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
Selector *LabelSelector `json:"selector,omitempty" protobuf:"bytes,1,opt,name=selector"`
// Template is the object that describes the pod that will be created.
......@@ -422,17 +475,19 @@ type DaemonSetSpec struct {
// TODO(madhusudancs): Uncomment while implementing DaemonSet updates.
/* Commenting out for v1.2. We are planning to bring these fields back with a more robust DaemonSet update implementation in v1.3, hence not deleting but just commenting these fields out.
// Update strategy to replace existing DaemonSet pods with new pods.
UpdateStrategy DaemonSetUpdateStrategy `json:"updateStrategy,omitempty"`
// Label key that is added to DaemonSet pods to distinguish between old and
// new pod templates during DaemonSet update.
// Users can set this to an empty string to indicate that the system should
// not add any label. If unspecified, system uses
// DefaultDaemonSetUniqueLabelKey("daemonset.kubernetes.io/podTemplateHash").
// Value of this key is hash of DaemonSetSpec.PodTemplateSpec.
// No label is added if this is set to empty string.
UniqueLabelKey *string `json:"uniqueLabelKey,omitempty"`
// Update strategy to replace existing DaemonSet pods with new pods.
// +optional
UpdateStrategy DaemonSetUpdateStrategy `json:"updateStrategy,omitempty"`
// Label key that is added to DaemonSet pods to distinguish between old and
// new pod templates during DaemonSet update.
// Users can set this to an empty string to indicate that the system should
// not add any label. If unspecified, system uses
// DefaultDaemonSetUniqueLabelKey("daemonset.kubernetes.io/podTemplateHash").
// Value of this key is hash of DaemonSetSpec.PodTemplateSpec.
// No label is added if this is set to empty string.
// +optional
UniqueLabelKey *string `json:"uniqueLabelKey,omitempty"`
*/
}
......@@ -472,10 +527,12 @@ type DaemonSet struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Spec defines the desired behavior of this daemon set.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Spec DaemonSetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
// Status is the current status of this daemon set. This data may be
......@@ -483,6 +540,7 @@ type DaemonSet struct {
// Populated by the system.
// Read-only.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Status DaemonSetStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
......@@ -491,6 +549,7 @@ type DaemonSetList struct {
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is a list of daemon sets.
......@@ -502,6 +561,7 @@ type ThirdPartyResourceDataList struct {
unversioned.TypeMeta `json:",inline"`
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is the list of ThirdpartyResourceData.
......@@ -515,14 +575,17 @@ type Job struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Spec is a structure defining the expected behavior of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Spec JobSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
// Status is a structure describing current status of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Status JobStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
......@@ -531,6 +594,7 @@ type JobList struct {
unversioned.TypeMeta `json:",inline"`
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is the list of Job.
......@@ -545,6 +609,7 @@ type JobSpec struct {
// be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism),
// i.e. when the work left to do is less than max parallelism.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
Parallelism *int32 `json:"parallelism,omitempty" protobuf:"varint,1,opt,name=parallelism"`
// Completions specifies the desired number of successfully finished pods the
......@@ -553,15 +618,18 @@ type JobSpec struct {
// value. Setting to 1 means that parallelism is limited to 1 and the success of that
// pod signals the success of the job.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
Completions *int32 `json:"completions,omitempty" protobuf:"varint,2,opt,name=completions"`
// Optional duration in seconds relative to the startTime that the job may be active
// before the system tries to terminate it; value must be positive integer
// +optional
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty" protobuf:"varint,3,opt,name=activeDeadlineSeconds"`
// Selector is a label query over pods that should match the pod count.
// Normally, the system sets this field for you.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
Selector *LabelSelector `json:"selector,omitempty" protobuf:"bytes,4,opt,name=selector"`
// AutoSelector controls generation of pod labels and pod selectors.
......@@ -569,6 +637,7 @@ type JobSpec struct {
// to allow conversion from batch/v1 Jobs, where it corresponds to, but has the opposite
// meaning as, ManualSelector.
// More info: http://releases.k8s.io/HEAD/docs/design/selector-generation.md
// +optional
AutoSelector *bool `json:"autoSelector,omitempty" protobuf:"varint,5,opt,name=autoSelector"`
// Template is the object that describes the pod that will be created when
......@@ -582,25 +651,31 @@ type JobStatus struct {
// Conditions represent the latest available observations of an object's current state.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
Conditions []JobCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
// StartTime represents time when the job was acknowledged by the Job Manager.
// It is not guaranteed to be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC.
// +optional
StartTime *unversioned.Time `json:"startTime,omitempty" protobuf:"bytes,2,opt,name=startTime"`
// CompletionTime represents time when the job was completed. It is not guaranteed to
// be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC.
// +optional
CompletionTime *unversioned.Time `json:"completionTime,omitempty" protobuf:"bytes,3,opt,name=completionTime"`
// Active is the number of actively running pods.
// +optional
Active int32 `json:"active,omitempty" protobuf:"varint,4,opt,name=active"`
// Succeeded is the number of pods which reached Phase Succeeded.
// +optional
Succeeded int32 `json:"succeeded,omitempty" protobuf:"varint,5,opt,name=succeeded"`
// Failed is the number of pods which reached Phase Failed.
// +optional
Failed int32 `json:"failed,omitempty" protobuf:"varint,6,opt,name=failed"`
}
......@@ -621,12 +696,16 @@ type JobCondition struct {
// Status of the condition, one of True, False, Unknown.
Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"`
// Last time the condition was checked.
// +optional
LastProbeTime unversioned.Time `json:"lastProbeTime,omitempty" protobuf:"bytes,3,opt,name=lastProbeTime"`
// Last time the condition transit from one status to another.
// +optional
LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"`
// (brief) reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"`
// Human readable message indicating details about last transition.
// +optional
Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"`
}
......@@ -640,14 +719,17 @@ type Ingress struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Spec is the desired state of the Ingress.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Spec IngressSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
// Status is the current state of the Ingress.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Status IngressStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
......@@ -656,6 +738,7 @@ type IngressList struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is the list of Ingress.
......@@ -668,6 +751,7 @@ type IngressSpec struct {
// rule. At least one of 'backend' or 'rules' must be specified. This field
// is optional to allow the loadbalancer controller or defaulting logic to
// specify a global default.
// +optional
Backend *IngressBackend `json:"backend,omitempty" protobuf:"bytes,1,opt,name=backend"`
// TLS configuration. Currently the Ingress only supports a single TLS
......@@ -675,10 +759,12 @@ type IngressSpec struct {
// will be multiplexed on the same port according to the hostname specified
// through the SNI TLS extension, if the ingress controller fulfilling the
// ingress supports SNI.
// +optional
TLS []IngressTLS `json:"tls,omitempty" protobuf:"bytes,2,rep,name=tls"`
// A list of host rules used to configure the Ingress. If unspecified, or
// no rule matches, all traffic is sent to the default backend.
// +optional
Rules []IngressRule `json:"rules,omitempty" protobuf:"bytes,3,rep,name=rules"`
// TODO: Add the ability to specify load-balancer IP through claims
}
......@@ -689,12 +775,14 @@ type IngressTLS struct {
// this list must match the name/s used in the tlsSecret. Defaults to the
// wildcard host setting for the loadbalancer controller fulfilling this
// Ingress, if left unspecified.
// +optional
Hosts []string `json:"hosts,omitempty" protobuf:"bytes,1,rep,name=hosts"`
// SecretName is the name of the secret used to terminate SSL traffic on 443.
// Field is left optional to allow SSL routing based on SNI hostname alone.
// If the SNI host in a listener conflicts with the "Host" header field used
// by an IngressRule, the SNI host is used for termination and value of the
// Host header is used for routing.
// +optional
SecretName string `json:"secretName,omitempty" protobuf:"bytes,2,opt,name=secretName"`
// TODO: Consider specifying different modes of termination, protocols etc.
}
......@@ -702,6 +790,7 @@ type IngressTLS struct {
// IngressStatus describe the current state of the Ingress.
type IngressStatus struct {
// LoadBalancer contains the current status of the load-balancer.
// +optional
LoadBalancer v1.LoadBalancerStatus `json:"loadBalancer,omitempty" protobuf:"bytes,1,opt,name=loadBalancer"`
}
......@@ -721,12 +810,14 @@ type IngressRule struct {
// Incoming requests are matched against the host before the IngressRuleValue.
// If the host is unspecified, the Ingress routes all traffic based on the
// specified IngressRuleValue.
// +optional
Host string `json:"host,omitempty" protobuf:"bytes,1,opt,name=host"`
// IngressRuleValue represents a rule to route requests for this IngressRule.
// If unspecified, the rule defaults to a http catch-all. Whether that sends
// just traffic matching the host to the default backend or all traffic to the
// default backend, is left to the controller fulfilling the Ingress. Http is
// currently the only supported IngressRuleValue.
// +optional
IngressRuleValue `json:",inline,omitempty" protobuf:"bytes,2,opt,name=ingressRuleValue"`
}
......@@ -741,6 +832,7 @@ type IngressRuleValue struct {
// 2. Consider adding fields for ingress-type specific global options
// usable by a loadbalancer, like http keep-alive.
// +optional
HTTP *HTTPIngressRuleValue `json:"http,omitempty" protobuf:"bytes,1,opt,name=http"`
}
......@@ -766,6 +858,7 @@ type HTTPIngressPath struct {
// part of a URL as defined by RFC 3986. Paths must begin with
// a '/'. If unspecified, the path defaults to a catch all sending
// traffic to the backend.
// +optional
Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"`
// Backend defines the referenced service endpoint to which the traffic
......@@ -798,8 +891,10 @@ type LabelSelector struct {
// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
// map is equivalent to an element of matchExpressions, whose key field is "key", the
// operator is "In", and the values array contains only "value". The requirements are ANDed.
// +optional
MatchLabels map[string]string `json:"matchLabels,omitempty" protobuf:"bytes,1,rep,name=matchLabels"`
// matchExpressions is a list of label selector requirements. The requirements are ANDed.
// +optional
MatchExpressions []LabelSelectorRequirement `json:"matchExpressions,omitempty" protobuf:"bytes,2,rep,name=matchExpressions"`
}
......@@ -815,6 +910,7 @@ type LabelSelectorRequirement struct {
// the values array must be non-empty. If the operator is Exists or DoesNotExist,
// the values array must be empty. This array is replaced during a strategic
// merge patch.
// +optional
Values []string `json:"values,omitempty" protobuf:"bytes,3,rep,name=values"`
}
......@@ -837,10 +933,12 @@ type ReplicaSet struct {
// If the Labels of a ReplicaSet are empty, they are defaulted to
// be the same as the Pod(s) that the ReplicaSet manages.
// Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Spec defines the specification of the desired behavior of the ReplicaSet.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Spec ReplicaSetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
// Status is the most recently observed status of the ReplicaSet.
......@@ -848,6 +946,7 @@ type ReplicaSet struct {
// Populated by the system.
// Read-only.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Status ReplicaSetStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
......@@ -856,6 +955,7 @@ type ReplicaSetList struct {
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
// +optional
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// List of ReplicaSets.
......@@ -869,22 +969,26 @@ type ReplicaSetSpec struct {
// This is a pointer to distinguish between explicit zero and unspecified.
// Defaults to 1.
// More info: http://kubernetes.io/docs/user-guide/replication-controller#what-is-a-replication-controller
// +optional
Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
// Minimum number of seconds for which a newly created pod should be ready
// without any of its container crashing, for it to be considered available.
// Defaults to 0 (pod will be considered available as soon as it is ready)
// +optional
MinReadySeconds int32 `json:"minReadySeconds,omitempty" protobuf:"varint,4,opt,name=minReadySeconds"`
// Selector is a label query over pods that should match the replica count.
// If the selector is empty, it is defaulted to the labels present on the pod template.
// Label keys and values that must match in order to be controlled by this replica set.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
Selector *LabelSelector `json:"selector,omitempty" protobuf:"bytes,2,opt,name=selector"`
// Template is the object that describes the pod that will be created if
// insufficient replicas are detected.
// More info: http://kubernetes.io/docs/user-guide/replication-controller#pod-template
// +optional
Template v1.PodTemplateSpec `json:"template,omitempty" protobuf:"bytes,3,opt,name=template"`
}
......@@ -895,18 +999,23 @@ type ReplicaSetStatus struct {
Replicas int32 `json:"replicas" protobuf:"varint,1,opt,name=replicas"`
// The number of pods that have labels matching the labels of the pod template of the replicaset.
// +optional
FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty" protobuf:"varint,2,opt,name=fullyLabeledReplicas"`
// The number of ready replicas for this replica set.
// +optional
ReadyReplicas int32 `json:"readyReplicas,omitempty" protobuf:"varint,4,opt,name=readyReplicas"`
// The number of available replicas (ready for at least minReadySeconds) for this replica set.
// +optional
AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,5,opt,name=availableReplicas"`
// ObservedGeneration reflects the generation of the most recently observed ReplicaSet.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,3,opt,name=observedGeneration"`
// Represents the latest available observations of a replica set's current state.
// +optional
Conditions []ReplicaSetCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}
......@@ -927,12 +1036,16 @@ type ReplicaSetCondition struct {
// Status of the condition, one of True, False, Unknown.
Status v1.ConditionStatus `json:"status"`
// Last time we probed the condition.
// +optional
LastProbeTime unversioned.Time `json:"lastProbeTime,omitempty"`
// The last time the condition transitioned from one status to another.
// +optional
LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty"`
// The reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty"`
// A human readable message indicating details about the transition.
// +optional
Message string `json:"message,omitempty"`
}
......@@ -945,37 +1058,48 @@ type PodSecurityPolicy struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// spec defines the policy enforced.
// +optional
Spec PodSecurityPolicySpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
}
// Pod Security Policy Spec defines the policy enforced.
type PodSecurityPolicySpec struct {
// privileged determines if a pod can request to be run as privileged.
// +optional
Privileged bool `json:"privileged,omitempty" protobuf:"varint,1,opt,name=privileged"`
// DefaultAddCapabilities is the default set of capabilities that will be added to the container
// unless the pod spec specifically drops the capability. You may not list a capabiility in both
// DefaultAddCapabilities and RequiredDropCapabilities.
// +optional
DefaultAddCapabilities []v1.Capability `json:"defaultAddCapabilities,omitempty" protobuf:"bytes,2,rep,name=defaultAddCapabilities,casttype=k8s.io/kubernetes/pkg/api/v1.Capability"`
// RequiredDropCapabilities are the capabilities that will be dropped from the container. These
// are required to be dropped and cannot be added.
// +optional
RequiredDropCapabilities []v1.Capability `json:"requiredDropCapabilities,omitempty" protobuf:"bytes,3,rep,name=requiredDropCapabilities,casttype=k8s.io/kubernetes/pkg/api/v1.Capability"`
// AllowedCapabilities is a list of capabilities that can be requested to add to the container.
// Capabilities in this field may be added at the pod author's discretion.
// You must not list a capability in both AllowedCapabilities and RequiredDropCapabilities.
// +optional
AllowedCapabilities []v1.Capability `json:"allowedCapabilities,omitempty" protobuf:"bytes,4,rep,name=allowedCapabilities,casttype=k8s.io/kubernetes/pkg/api/v1.Capability"`
// volumes is a white list of allowed volume plugins. Empty indicates that all plugins
// may be used.
// +optional
Volumes []FSType `json:"volumes,omitempty" protobuf:"bytes,5,rep,name=volumes,casttype=FSType"`
// hostNetwork determines if the policy allows the use of HostNetwork in the pod spec.
// +optional
HostNetwork bool `json:"hostNetwork,omitempty" protobuf:"varint,6,opt,name=hostNetwork"`
// hostPorts determines which host port ranges are allowed to be exposed.
// +optional
HostPorts []HostPortRange `json:"hostPorts,omitempty" protobuf:"bytes,7,rep,name=hostPorts"`
// hostPID determines if the policy allows the use of HostPID in the pod spec.
// +optional
HostPID bool `json:"hostPID,omitempty" protobuf:"varint,8,opt,name=hostPID"`
// hostIPC determines if the policy allows the use of HostIPC in the pod spec.
// +optional
HostIPC bool `json:"hostIPC,omitempty" protobuf:"varint,9,opt,name=hostIPC"`
// seLinux is the strategy that will dictate the allowable labels that may be set.
SELinux SELinuxStrategyOptions `json:"seLinux" protobuf:"bytes,10,opt,name=seLinux"`
......@@ -990,6 +1114,7 @@ type PodSecurityPolicySpec struct {
// the PSP should deny the pod.
// If set to false the container may run with a read only root file system if it wishes but it
// will not be forced to.
// +optional
ReadOnlyRootFilesystem bool `json:"readOnlyRootFilesystem,omitempty" protobuf:"varint,14,opt,name=readOnlyRootFilesystem"`
}
......@@ -1036,6 +1161,7 @@ type SELinuxStrategyOptions struct {
Rule SELinuxStrategy `json:"rule" protobuf:"bytes,1,opt,name=rule,casttype=SELinuxStrategy"`
// seLinuxOptions required to run as; required for MustRunAs
// More info: http://releases.k8s.io/HEAD/docs/design/security_context.md#security-context
// +optional
SELinuxOptions *v1.SELinuxOptions `json:"seLinuxOptions,omitempty" protobuf:"bytes,2,opt,name=seLinuxOptions"`
}
......@@ -1055,6 +1181,7 @@ type RunAsUserStrategyOptions struct {
// Rule is the strategy that will dictate the allowable RunAsUser values that may be set.
Rule RunAsUserStrategy `json:"rule" protobuf:"bytes,1,opt,name=rule,casttype=RunAsUserStrategy"`
// Ranges are the allowed ranges of uids that may be used.
// +optional
Ranges []IDRange `json:"ranges,omitempty" protobuf:"bytes,2,rep,name=ranges"`
}
......@@ -1082,9 +1209,11 @@ const (
// FSGroupStrategyOptions defines the strategy type and options used to create the strategy.
type FSGroupStrategyOptions struct {
// Rule is the strategy that will dictate what FSGroup is used in the SecurityContext.
// +optional
Rule FSGroupStrategyType `json:"rule,omitempty" protobuf:"bytes,1,opt,name=rule,casttype=FSGroupStrategyType"`
// Ranges are the allowed ranges of fs groups. If you would like to force a single
// fs group then supply a single range with the same start and end.
// +optional
Ranges []IDRange `json:"ranges,omitempty" protobuf:"bytes,2,rep,name=ranges"`
}
......@@ -1102,9 +1231,11 @@ const (
// SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy.
type SupplementalGroupsStrategyOptions struct {
// Rule is the strategy that will dictate what supplemental groups is used in the SecurityContext.
// +optional
Rule SupplementalGroupsStrategyType `json:"rule,omitempty" protobuf:"bytes,1,opt,name=rule,casttype=SupplementalGroupsStrategyType"`
// Ranges are the allowed ranges of supplemental groups. If you would like to force a single
// supplemental group then supply a single range with the same start and end.
// +optional
Ranges []IDRange `json:"ranges,omitempty" protobuf:"bytes,2,rep,name=ranges"`
}
......@@ -1124,6 +1255,7 @@ type PodSecurityPolicyList struct {
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is a list of schema objects.
......@@ -1134,9 +1266,11 @@ type NetworkPolicy struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Specification of the desired behavior for this NetworkPolicy.
// +optional
Spec NetworkPolicySpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
}
......@@ -1156,6 +1290,7 @@ type NetworkPolicySpec struct {
// If this field is empty then this NetworkPolicy does not affect ingress isolation.
// If this field is present and contains at least one rule, this policy allows any traffic
// which matches at least one of the ingress rules in this list.
// +optional
Ingress []NetworkPolicyIngressRule `json:"ingress,omitempty" protobuf:"bytes,2,rep,name=ingress"`
}
......@@ -1168,6 +1303,7 @@ type NetworkPolicyIngressRule struct {
// If this field is present and contains at least one item, then this rule allows traffic
// only if the traffic matches at least one port in the list.
// TODO: Update this to be a pointer to slice as soon as auto-generation supports it.
// +optional
Ports []NetworkPolicyPort `json:"ports,omitempty" protobuf:"bytes,1,rep,name=ports"`
// List of sources which should be able to access the pods selected for this rule.
......@@ -1177,12 +1313,14 @@ type NetworkPolicyIngressRule struct {
// If this field is present and contains at least on item, this rule allows traffic only if the
// traffic matches at least one item in the from list.
// TODO: Update this to be a pointer to slice as soon as auto-generation supports it.
// +optional
From []NetworkPolicyPeer `json:"from,omitempty" protobuf:"bytes,2,rep,name=from"`
}
type NetworkPolicyPort struct {
// Optional. The protocol (TCP or UDP) which traffic must match.
// If not specified, this field defaults to TCP.
// +optional
Protocol *v1.Protocol `json:"protocol,omitempty" protobuf:"bytes,1,opt,name=protocol,casttype=k8s.io/kubernetes/pkg/api/v1.Protocol"`
// If specified, the port on the given protocol. This can
......@@ -1190,6 +1328,7 @@ type NetworkPolicyPort struct {
// this matches all port names and numbers.
// If present, only traffic on the specified protocol AND port
// will be matched.
// +optional
Port *intstr.IntOrString `json:"port,omitempty" protobuf:"bytes,2,opt,name=port"`
}
......@@ -1200,6 +1339,7 @@ type NetworkPolicyPeer struct {
// This field follows standard label selector semantics.
// If not provided, this selector selects no pods.
// If present but empty, this selector selects all pods in this namespace.
// +optional
PodSelector *LabelSelector `json:"podSelector,omitempty" protobuf:"bytes,1,opt,name=podSelector"`
// Selects Namespaces using cluster scoped-labels. This
......@@ -1207,6 +1347,7 @@ type NetworkPolicyPeer struct {
// This field follows standard label selector semantics.
// If omitted, this selector selects no namespaces.
// If present but empty, this selector selects all namespaces.
// +optional
NamespaceSelector *LabelSelector `json:"namespaceSelector,omitempty" protobuf:"bytes,2,opt,name=namespaceSelector"`
}
......@@ -1215,6 +1356,7 @@ type NetworkPolicyList struct {
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is a list of schema objects.
......
......@@ -32,32 +32,38 @@ option go_package = "v1alpha1";
// ImageReview checks if the set of images in a pod are allowed.
message ImageReview {
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Spec holds information about the pod being evaluated
optional ImageReviewSpec spec = 2;
// Status is filled in by the backend and indicates whether the pod should be allowed.
// +optional
optional ImageReviewStatus status = 3;
}
// ImageReviewContainerSpec is a description of a container within the pod creation request.
message ImageReviewContainerSpec {
// This can be in the form image:tag or image@SHA:012345679abcdef.
// +optional
optional string image = 1;
}
// ImageReviewSpec is a description of the pod creation request.
message ImageReviewSpec {
// Containers is a list of a subset of the information in each container of the Pod being created.
// +optional
repeated ImageReviewContainerSpec containers = 1;
// Annotations is a list of key-value pairs extracted from the Pod's annotations.
// It only includes keys which match the pattern `*.image-policy.k8s.io/*`.
// It is up to each webhook backend to determine how to interpret these annotations, if at all.
// +optional
map<string, string> annotations = 2;
// Namespace is the namespace the pod is being created in.
// +optional
optional string namespace = 3;
}
......@@ -69,6 +75,7 @@ message ImageReviewStatus {
// Reason should be empty unless Allowed is false in which case it
// may contain a short description of what is wrong. Kubernetes
// may truncate excessively long errors when displaying to the user.
// +optional
optional string reason = 2;
}
......@@ -28,30 +28,36 @@ import (
// ImageReview checks if the set of images in a pod are allowed.
type ImageReview struct {
unversioned.TypeMeta `json:",inline"`
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Spec holds information about the pod being evaluated
Spec ImageReviewSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"`
// Status is filled in by the backend and indicates whether the pod should be allowed.
// +optional
Status ImageReviewStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
// ImageReviewSpec is a description of the pod creation request.
type ImageReviewSpec struct {
// Containers is a list of a subset of the information in each container of the Pod being created.
// +optional
Containers []ImageReviewContainerSpec `json:"containers,omitempty" protobuf:"bytes,1,rep,name=containers"`
// Annotations is a list of key-value pairs extracted from the Pod's annotations.
// It only includes keys which match the pattern `*.image-policy.k8s.io/*`.
// It is up to each webhook backend to determine how to interpret these annotations, if at all.
// +optional
Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,2,rep,name=annotations"`
// Namespace is the namespace the pod is being created in.
// +optional
Namespace string `json:"namespace,omitempty" protobuf:"bytes,3,opt,name=namespace"`
}
// ImageReviewContainerSpec is a description of a container within the pod creation request.
type ImageReviewContainerSpec struct {
// This can be in the form image:tag or image@SHA:012345679abcdef.
// +optional
Image string `json:"image,omitempty" protobuf:"bytes,1,opt,name=image"`
// In future, we may add command line overrides, exec health check command lines, and so on.
}
......@@ -63,5 +69,6 @@ type ImageReviewStatus struct {
// Reason should be empty unless Allowed is false in which case it
// may contain a short description of what is wrong. Kubernetes
// may truncate excessively long errors when displaying to the user.
// +optional
Reason string `json:"reason,omitempty" protobuf:"bytes,2,opt,name=reason"`
}
......@@ -28,10 +28,12 @@ type PodDisruptionBudgetSpec struct {
// "selector" will still be available after the eviction, i.e. even in the
// absence of the evicted pod. So for example you can prevent all voluntary
// evictions by specifying "100%".
// +optional
MinAvailable intstr.IntOrString `json:"minAvailable,omitempty"`
// Label query over pods whose evictions are managed by the disruption
// budget.
// +optional
Selector *unversioned.LabelSelector `json:"selector,omitempty"`
}
......@@ -56,17 +58,21 @@ type PodDisruptionBudgetStatus struct {
// PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods
type PodDisruptionBudget struct {
unversioned.TypeMeta `json:",inline"`
api.ObjectMeta `json:"metadata,omitempty"`
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
// Specification of the desired behavior of the PodDisruptionBudget.
// +optional
Spec PodDisruptionBudgetSpec `json:"spec,omitempty"`
// Most recently observed status of the PodDisruptionBudget.
// +optional
Status PodDisruptionBudgetStatus `json:"status,omitempty"`
}
// PodDisruptionBudgetList is a collection of PodDisruptionBudgets.
type PodDisruptionBudgetList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
Items []PodDisruptionBudget `json:"items"`
}
......@@ -78,8 +84,10 @@ type Eviction struct {
unversioned.TypeMeta `json:",inline"`
// ObjectMeta describes the pod that is being evicted.
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
// DeleteOptions may be provided
// +optional
DeleteOptions *api.DeleteOptions `json:"deleteOptions,omitempty"`
}
......@@ -35,25 +35,31 @@ option go_package = "v1alpha1";
// created by POSTing to .../pods/<pod name>/evictions.
message Eviction {
// ObjectMeta describes the pod that is being evicted.
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// DeleteOptions may be provided
// +optional
optional k8s.io.kubernetes.pkg.api.v1.DeleteOptions deleteOptions = 2;
}
// PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods
message PodDisruptionBudget {
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the PodDisruptionBudget.
// +optional
optional PodDisruptionBudgetSpec spec = 2;
// Most recently observed status of the PodDisruptionBudget.
// +optional
optional PodDisruptionBudgetStatus status = 3;
}
// PodDisruptionBudgetList is a collection of PodDisruptionBudgets.
message PodDisruptionBudgetList {
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
repeated PodDisruptionBudget items = 2;
......@@ -65,10 +71,12 @@ message PodDisruptionBudgetSpec {
// "selector" will still be available after the eviction, i.e. even in the
// absence of the evicted pod. So for example you can prevent all voluntary
// evictions by specifying "100%".
// +optional
optional k8s.io.kubernetes.pkg.util.intstr.IntOrString minAvailable = 1;
// Label query over pods whose evictions are managed by the disruption
// budget.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.LabelSelector selector = 2;
}
......
......@@ -28,10 +28,12 @@ type PodDisruptionBudgetSpec struct {
// "selector" will still be available after the eviction, i.e. even in the
// absence of the evicted pod. So for example you can prevent all voluntary
// evictions by specifying "100%".
// +optional
MinAvailable intstr.IntOrString `json:"minAvailable,omitempty" protobuf:"bytes,1,opt,name=minAvailable"`
// Label query over pods whose evictions are managed by the disruption
// budget.
// +optional
Selector *unversioned.LabelSelector `json:"selector,omitempty" protobuf:"bytes,2,opt,name=selector"`
}
......@@ -56,17 +58,21 @@ type PodDisruptionBudgetStatus struct {
// PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods
type PodDisruptionBudget struct {
unversioned.TypeMeta `json:",inline"`
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Specification of the desired behavior of the PodDisruptionBudget.
// +optional
Spec PodDisruptionBudgetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
// Most recently observed status of the PodDisruptionBudget.
// +optional
Status PodDisruptionBudgetStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
// PodDisruptionBudgetList is a collection of PodDisruptionBudgets.
type PodDisruptionBudgetList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
Items []PodDisruptionBudget `json:"items" protobuf:"bytes,2,rep,name=items"`
}
......@@ -78,8 +84,10 @@ type Eviction struct {
unversioned.TypeMeta `json:",inline"`
// ObjectMeta describes the pod that is being evicted.
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// DeleteOptions may be provided
// +optional
DeleteOptions *v1.DeleteOptions `json:"deleteOptions,omitempty" protobuf:"bytes,2,opt,name=deleteOptions"`
}
......@@ -33,6 +33,7 @@ option go_package = "v1alpha1";
// ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding.
message ClusterRole {
// Standard object's metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Rules holds all the PolicyRules for this ClusterRole
......@@ -43,6 +44,7 @@ message ClusterRole {
// and adds who information via Subject.
message ClusterRoleBinding {
// Standard object's metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Subjects holds references to the objects the role applies to.
......@@ -56,6 +58,7 @@ message ClusterRoleBinding {
// ClusterRoleBindingList is a collection of ClusterRoleBindings
message ClusterRoleBindingList {
// Standard object's metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
// Items is a list of ClusterRoleBindings
......@@ -65,6 +68,7 @@ message ClusterRoleBindingList {
// ClusterRoleList is a collection of ClusterRoles
message ClusterRoleList {
// Standard object's metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
// Items is a list of ClusterRoles
......@@ -79,28 +83,34 @@ message PolicyRule {
// AttributeRestrictions will vary depending on what the Authorizer/AuthorizationAttributeBuilder pair supports.
// If the Authorizer does not recognize how to handle the AttributeRestrictions, the Authorizer should report an error.
// +optional
optional k8s.io.kubernetes.pkg.runtime.RawExtension attributeRestrictions = 2;
// APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of
// the enumerated resources in any API group will be allowed.
// +optional
repeated string apiGroups = 3;
// Resources is a list of resources this rule applies to. ResourceAll represents all resources.
// +optional
repeated string resources = 4;
// ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.
// +optional
repeated string resourceNames = 5;
// NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path
// This name is intentionally different than the internal type so that the DefaultConvert works nicely and because the ordering may be different.
// Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding.
// Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both.
// +optional
repeated string nonResourceURLs = 6;
}
// Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding.
message Role {
// Standard object's metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Rules holds all the PolicyRules for this Role
......@@ -112,6 +122,7 @@ message Role {
// namespace only have effect in that namespace.
message RoleBinding {
// Standard object's metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Subjects holds references to the objects the role applies to.
......@@ -125,6 +136,7 @@ message RoleBinding {
// RoleBindingList is a collection of RoleBindings
message RoleBindingList {
// Standard object's metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
// Items is a list of RoleBindings
......@@ -134,6 +146,7 @@ message RoleBindingList {
// RoleList is a collection of Roles
message RoleList {
// Standard object's metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
// Items is a list of Roles
......@@ -160,6 +173,7 @@ message Subject {
optional string kind = 1;
// APIVersion holds the API group and version of the referenced object.
// +optional
optional string apiVersion = 2;
// Name of the object being referenced.
......@@ -167,6 +181,7 @@ message Subject {
// Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty
// the Authorizer should report an error.
// +optional
optional string namespace = 4;
}
......@@ -34,20 +34,25 @@ type PolicyRule struct {
Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"`
// AttributeRestrictions will vary depending on what the Authorizer/AuthorizationAttributeBuilder pair supports.
// If the Authorizer does not recognize how to handle the AttributeRestrictions, the Authorizer should report an error.
// +optional
AttributeRestrictions runtime.RawExtension `json:"attributeRestrictions,omitempty" protobuf:"bytes,2,opt,name=attributeRestrictions"`
// APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of
// the enumerated resources in any API group will be allowed.
// +optional
APIGroups []string `json:"apiGroups,omitempty" protobuf:"bytes,3,rep,name=apiGroups"`
// Resources is a list of resources this rule applies to. ResourceAll represents all resources.
// +optional
Resources []string `json:"resources,omitempty" protobuf:"bytes,4,rep,name=resources"`
// ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.
// +optional
ResourceNames []string `json:"resourceNames,omitempty" protobuf:"bytes,5,rep,name=resourceNames"`
// NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path
// This name is intentionally different than the internal type so that the DefaultConvert works nicely and because the ordering may be different.
// Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding.
// Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both.
// +optional
NonResourceURLs []string `json:"nonResourceURLs,omitempty" protobuf:"bytes,6,rep,name=nonResourceURLs"`
}
......@@ -58,11 +63,13 @@ type Subject struct {
// If the Authorizer does not recognized the kind value, the Authorizer should report an error.
Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"`
// APIVersion holds the API group and version of the referenced object.
// +optional
APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,2,opt.name=apiVersion"`
// Name of the object being referenced.
Name string `json:"name" protobuf:"bytes,3,opt,name=name"`
// Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty
// the Authorizer should report an error.
// +optional
Namespace string `json:"namespace,omitempty" protobuf:"bytes,4,opt,name=namespace"`
}
......@@ -82,6 +89,7 @@ type RoleRef struct {
type Role struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Rules holds all the PolicyRules for this Role
......@@ -96,6 +104,7 @@ type Role struct {
type RoleBinding struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Subjects holds references to the objects the role applies to.
......@@ -110,6 +119,7 @@ type RoleBinding struct {
type RoleBindingList struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// +optional
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is a list of RoleBindings
......@@ -120,6 +130,7 @@ type RoleBindingList struct {
type RoleList struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// +optional
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is a list of Roles
......@@ -133,6 +144,7 @@ type RoleList struct {
type ClusterRole struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Rules holds all the PolicyRules for this ClusterRole
......@@ -147,6 +159,7 @@ type ClusterRole struct {
type ClusterRoleBinding struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Subjects holds references to the objects the role applies to.
......@@ -161,6 +174,7 @@ type ClusterRoleBinding struct {
type ClusterRoleBindingList struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// +optional
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is a list of ClusterRoleBindings
......@@ -171,6 +185,7 @@ type ClusterRoleBindingList struct {
type ClusterRoleList struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// +optional
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is a list of ClusterRoles
......
......@@ -32,7 +32,8 @@ import (
// The name of a StorageClass object is significant, and is how users can request a particular class.
type StorageClass struct {
unversioned.TypeMeta `json:",inline"`
api.ObjectMeta `json:"metadata,omitempty"`
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
// provisioner is the driver expected to handle this StorageClass.
// This is an optionally-prefixed name, like a label key.
......@@ -45,6 +46,7 @@ type StorageClass struct {
// to the provisioner. The only validation done on keys is that they are
// not empty. The maximum number of parameters is
// 512, with a cumulative max size of 256K
// +optional
Parameters map[string]string `json:"parameters,omitempty"`
}
......@@ -53,6 +55,7 @@ type StorageClassList struct {
unversioned.TypeMeta `json:",inline"`
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
// Items is the list of StorageClasses
......
......@@ -38,6 +38,7 @@ option go_package = "v1beta1";
message StorageClass {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Provisioner indicates the type of the provisioner.
......@@ -45,6 +46,7 @@ message StorageClass {
// Parameters holds the parameters for the provisioner that should
// create volumes of this storage class.
// +optional
map<string, string> parameters = 3;
}
......@@ -52,6 +54,7 @@ message StorageClass {
message StorageClassList {
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
// Items is the list of StorageClasses
......
......@@ -33,6 +33,7 @@ type StorageClass struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Provisioner indicates the type of the provisioner.
......@@ -40,6 +41,7 @@ type StorageClass struct {
// Parameters holds the parameters for the provisioner that should
// create volumes of this storage class.
// +optional
Parameters map[string]string `json:"parameters,omitempty" protobuf:"bytes,3,rep,name=parameters"`
}
......@@ -48,6 +50,7 @@ type StorageClassList struct {
unversioned.TypeMeta `json:",inline"`
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is the list of StorageClasses
......
......@@ -24,8 +24,10 @@ import (
type Simple struct {
unversioned.TypeMeta `json:",inline"`
api.ObjectMeta `json:"metadata"`
Other string `json:"other,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
// +optional
Other string `json:"other,omitempty"`
// +optional
Labels map[string]string `json:"labels,omitempty"`
}
func (obj *Simple) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
......@@ -33,8 +35,10 @@ func (obj *Simple) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta
type SimpleRoot struct {
unversioned.TypeMeta `json:",inline"`
api.ObjectMeta `json:"metadata"`
Other string `json:"other,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
// +optional
Other string `json:"other,omitempty"`
// +optional
Labels map[string]string `json:"labels,omitempty"`
}
func (obj *SimpleRoot) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
......@@ -58,7 +62,8 @@ func (obj *SimpleGetOptions) GetObjectKind() unversioned.ObjectKind { return &ob
type SimpleList struct {
unversioned.TypeMeta `json:",inline"`
unversioned.ListMeta `json:"metadata,inline"`
Items []Simple `json:"items,omitempty"`
// +optional
Items []Simple `json:"items,omitempty"`
}
func (obj *SimpleList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
......@@ -46,11 +46,16 @@ type Server struct {
}
type ServerStatus struct {
Component string `json:"component,omitempty"`
Health string `json:"health,omitempty"`
// +optional
Component string `json:"component,omitempty"`
// +optional
Health string `json:"health,omitempty"`
// +optional
HealthCode probe.Result `json:"healthCode,omitempty"`
Msg string `json:"msg,omitempty"`
Err string `json:"err,omitempty"`
// +optional
Msg string `json:"msg,omitempty"`
// +optional
Err string `json:"err,omitempty"`
}
func (server *Server) DoServerCheck(prober httpprober.HTTPProber) (probe.Result, string, error) {
......
......@@ -28,12 +28,14 @@ import (
type Config struct {
// Legacy field from pkg/api/types.go TypeMeta.
// TODO(jlowdermilk): remove this after eliminating downstream dependencies.
// +optional
Kind string `json:"kind,omitempty"`
// DEPRECATED: APIVersion is the preferred api version for communicating with the kubernetes cluster (v1, v2, etc).
// Because a cluster can run multiple API groups and potentially multiple versions of each, it no longer makes sense to specify
// a single value for the cluster version.
// This field isn't really needed anyway, so we are deprecating it without replacement.
// It will be ignored if it is present.
// +optional
APIVersion string `json:"apiVersion,omitempty"`
// Preferences holds general information to be use for cli interactions
Preferences Preferences `json:"preferences"`
......@@ -46,13 +48,16 @@ type Config struct {
// CurrentContext is the name of the context that you would like to use by default
CurrentContext string `json:"current-context"`
// Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields
// +optional
Extensions map[string]runtime.Object `json:"extensions,omitempty"`
}
// IMPORTANT if you add fields to this struct, please update IsConfigEmpty()
type Preferences struct {
// +optional
Colors bool `json:"colors,omitempty"`
// Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields
// +optional
Extensions map[string]runtime.Object `json:"extensions,omitempty"`
}
......@@ -63,14 +68,19 @@ type Cluster struct {
// Server is the address of the kubernetes cluster (https://hostname:port).
Server string `json:"server"`
// APIVersion is the preferred api version for communicating with the kubernetes cluster (v1, v2, etc).
// +optional
APIVersion string `json:"api-version,omitempty"`
// InsecureSkipTLSVerify skips the validity check for the server's certificate. This will make your HTTPS connections insecure.
// +optional
InsecureSkipTLSVerify bool `json:"insecure-skip-tls-verify,omitempty"`
// CertificateAuthority is the path to a cert file for the certificate authority.
// +optional
CertificateAuthority string `json:"certificate-authority,omitempty"`
// CertificateAuthorityData contains PEM-encoded certificate authority certificates. Overrides CertificateAuthority
// +optional
CertificateAuthorityData []byte `json:"certificate-authority-data,omitempty"`
// Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields
// +optional
Extensions map[string]runtime.Object `json:"extensions,omitempty"`
}
......@@ -79,26 +89,37 @@ type AuthInfo struct {
// LocationOfOrigin indicates where this object came from. It is used for round tripping config post-merge, but never serialized.
LocationOfOrigin string
// ClientCertificate is the path to a client cert file for TLS.
// +optional
ClientCertificate string `json:"client-certificate,omitempty"`
// ClientCertificateData contains PEM-encoded data from a client cert file for TLS. Overrides ClientCertificate
// +optional
ClientCertificateData []byte `json:"client-certificate-data,omitempty"`
// ClientKey is the path to a client key file for TLS.
// +optional
ClientKey string `json:"client-key,omitempty"`
// ClientKeyData contains PEM-encoded data from a client key file for TLS. Overrides ClientKey
// +optional
ClientKeyData []byte `json:"client-key-data,omitempty"`
// Token is the bearer token for authentication to the kubernetes cluster.
// +optional
Token string `json:"token,omitempty"`
// TokenFile is a pointer to a file that contains a bearer token (as described above). If both Token and TokenFile are present, Token takes precedence.
// +optional
TokenFile string `json:"tokenFile,omitempty"`
// Impersonate is the username to act-as.
// +optional
Impersonate string `json:"act-as,omitempty"`
// Username is the username for basic authentication to the kubernetes cluster.
// +optional
Username string `json:"username,omitempty"`
// Password is the password for basic authentication to the kubernetes cluster.
// +optional
Password string `json:"password,omitempty"`
// AuthProvider specifies a custom authentication plugin for the kubernetes cluster.
// +optional
AuthProvider *AuthProviderConfig `json:"auth-provider,omitempty"`
// Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields
// +optional
Extensions map[string]runtime.Object `json:"extensions,omitempty"`
}
......@@ -111,14 +132,17 @@ type Context struct {
// AuthInfo is the name of the authInfo for this context
AuthInfo string `json:"user"`
// Namespace is the default namespace to use on unspecified requests
// +optional
Namespace string `json:"namespace,omitempty"`
// Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields
// +optional
Extensions map[string]runtime.Object `json:"extensions,omitempty"`
}
// AuthProviderConfig holds the configuration for a specified auth provider.
type AuthProviderConfig struct {
Name string `json:"name"`
Name string `json:"name"`
// +optional
Config map[string]string `json:"config,omitempty"`
}
......
......@@ -27,12 +27,14 @@ import (
type Config struct {
// Legacy field from pkg/api/types.go TypeMeta.
// TODO(jlowdermilk): remove this after eliminating downstream dependencies.
// +optional
Kind string `json:"kind,omitempty"`
// DEPRECATED: APIVersion is the preferred api version for communicating with the kubernetes cluster (v1, v2, etc).
// Because a cluster can run multiple API groups and potentially multiple versions of each, it no longer makes sense to specify
// a single value for the cluster version.
// This field isn't really needed anyway, so we are deprecating it without replacement.
// It will be ignored if it is present.
// +optional
APIVersion string `json:"apiVersion,omitempty"`
// Preferences holds general information to be use for cli interactions
Preferences Preferences `json:"preferences"`
......@@ -45,12 +47,15 @@ type Config struct {
// CurrentContext is the name of the context that you would like to use by default
CurrentContext string `json:"current-context"`
// Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields
// +optional
Extensions []NamedExtension `json:"extensions,omitempty"`
}
type Preferences struct {
// +optional
Colors bool `json:"colors,omitempty"`
// Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields
// +optional
Extensions []NamedExtension `json:"extensions,omitempty"`
}
......@@ -59,40 +64,56 @@ type Cluster struct {
// Server is the address of the kubernetes cluster (https://hostname:port).
Server string `json:"server"`
// APIVersion is the preferred api version for communicating with the kubernetes cluster (v1, v2, etc).
// +optional
APIVersion string `json:"api-version,omitempty"`
// InsecureSkipTLSVerify skips the validity check for the server's certificate. This will make your HTTPS connections insecure.
// +optional
InsecureSkipTLSVerify bool `json:"insecure-skip-tls-verify,omitempty"`
// CertificateAuthority is the path to a cert file for the certificate authority.
// +optional
CertificateAuthority string `json:"certificate-authority,omitempty"`
// CertificateAuthorityData contains PEM-encoded certificate authority certificates. Overrides CertificateAuthority
// +optional
CertificateAuthorityData []byte `json:"certificate-authority-data,omitempty"`
// Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields
// +optional
Extensions []NamedExtension `json:"extensions,omitempty"`
}
// AuthInfo contains information that describes identity information. This is use to tell the kubernetes cluster who you are.
type AuthInfo struct {
// ClientCertificate is the path to a client cert file for TLS.
// +optional
ClientCertificate string `json:"client-certificate,omitempty"`
// ClientCertificateData contains PEM-encoded data from a client cert file for TLS. Overrides ClientCertificate
// +optional
ClientCertificateData []byte `json:"client-certificate-data,omitempty"`
// ClientKey is the path to a client key file for TLS.
// +optional
ClientKey string `json:"client-key,omitempty"`
// ClientKeyData contains PEM-encoded data from a client key file for TLS. Overrides ClientKey
// +optional
ClientKeyData []byte `json:"client-key-data,omitempty"`
// Token is the bearer token for authentication to the kubernetes cluster.
// +optional
Token string `json:"token,omitempty"`
// TokenFile is a pointer to a file that contains a bearer token (as described above). If both Token and TokenFile are present, Token takes precedence.
// +optional
TokenFile string `json:"tokenFile,omitempty"`
// Impersonate is the username to imperonate. The name matches the flag.
// +optional
Impersonate string `json:"as,omitempty"`
// Username is the username for basic authentication to the kubernetes cluster.
// +optional
Username string `json:"username,omitempty"`
// Password is the password for basic authentication to the kubernetes cluster.
// +optional
Password string `json:"password,omitempty"`
// AuthProvider specifies a custom authentication plugin for the kubernetes cluster.
// +optional
AuthProvider *AuthProviderConfig `json:"auth-provider,omitempty"`
// Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields
// +optional
Extensions []NamedExtension `json:"extensions,omitempty"`
}
......@@ -103,8 +124,10 @@ type Context struct {
// AuthInfo is the name of the authInfo for this context
AuthInfo string `json:"user"`
// Namespace is the default namespace to use on unspecified requests
// +optional
Namespace string `json:"namespace,omitempty"`
// Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields
// +optional
Extensions []NamedExtension `json:"extensions,omitempty"`
}
......
......@@ -26,7 +26,8 @@ import (
// TODO: enable meta-only decoding for protobuf.
type MetadataOnlyObject struct {
unversioned.TypeMeta `json:",inline"`
v1.ObjectMeta `json:"metadata,omitempty"`
// +optional
v1.ObjectMeta `json:"metadata,omitempty"`
}
// MetadataOnlyObjectList allows decoding from JSON data only the typemeta and metadata of
......@@ -34,6 +35,7 @@ type MetadataOnlyObject struct {
// TODO: enable meta-only decoding for protobuf.
type MetadataOnlyObjectList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
Items []MetadataOnlyObject `json:"items"`
......
......@@ -33,7 +33,8 @@ import (
// DockerConfigJson represents ~/.docker/config.json file info
// see https://github.com/docker/docker/pull/12009
type DockerConfigJson struct {
Auths DockerConfig `json:"auths"`
Auths DockerConfig `json:"auths"`
// +optional
HttpHeaders map[string]string `json:"HttpHeaders,omitempty"`
}
......@@ -225,10 +226,14 @@ func readDockerConfigJsonFileFromBytes(contents []byte) (cfg DockerConfig, err e
// dockerConfigEntryWithAuth is used solely for deserializing the Auth field
// into a dockerConfigEntry during JSON deserialization.
type dockerConfigEntryWithAuth struct {
// +optional
Username string `json:"username,omitempty"`
// +optional
Password string `json:"password,omitempty"`
Email string `json:"email,omitempty"`
Auth string `json:"auth,omitempty"`
// +optional
Email string `json:"email,omitempty"`
// +optional
Auth string `json:"auth,omitempty"`
}
func (ident *DockerConfigEntry) UnmarshalJSON(data []byte) error {
......
......@@ -23,11 +23,12 @@ import (
type TestStruct struct {
unversioned.TypeMeta `json:",inline"`
api.ObjectMeta `json:"metadata,omitempty"`
Key string `json:"Key"`
Map map[string]int `json:"Map"`
StringList []string `json:"StringList"`
IntList []int `json:"IntList"`
// +optional
api.ObjectMeta `json:"metadata,omitempty"`
Key string `json:"Key"`
Map map[string]int `json:"Map"`
StringList []string `json:"StringList"`
IntList []int `json:"IntList"`
}
func (obj *TestStruct) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
......@@ -34,19 +34,25 @@ type NodeStats struct {
NodeName string `json:"nodeName"`
// Stats of system daemons tracked as raw containers.
// The system containers are named according to the SystemContainer* constants.
// +optional
SystemContainers []ContainerStats `json:"systemContainers,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
// The time at which data collection for the node-scoped (i.e. aggregate) stats was (re)started.
StartTime unversioned.Time `json:"startTime"`
// Stats pertaining to CPU resources.
// +optional
CPU *CPUStats `json:"cpu,omitempty"`
// Stats pertaining to memory (RAM) resources.
// +optional
Memory *MemoryStats `json:"memory,omitempty"`
// Stats pertaining to network resources.
// +optional
Network *NetworkStats `json:"network,omitempty"`
// Stats pertaining to total usage of filesystem resources on the rootfs used by node k8s components.
// NodeFs.Used is the total bytes used on the filesystem.
// +optional
Fs *FsStats `json:"fs,omitempty"`
// Stats about the underlying container runtime.
// +optional
Runtime *RuntimeStats `json:"runtime,omitempty"`
}
......@@ -55,6 +61,7 @@ type RuntimeStats struct {
// Stats about the underlying filesystem where container images are stored.
// This filesystem could be the same as the primary (root) filesystem.
// Usage here refers to the total number of bytes occupied by images on the filesystem.
// +optional
ImageFs *FsStats `json:"imageFs,omitempty"`
}
......@@ -76,9 +83,11 @@ type PodStats struct {
// Stats of containers in the measured pod.
Containers []ContainerStats `json:"containers" patchStrategy:"merge" patchMergeKey:"name"`
// Stats pertaining to network resources.
// +optional
Network *NetworkStats `json:"network,omitempty"`
// Stats pertaining to volume usage of filesystem resources.
// VolumeStats.UsedBytes is the number of bytes used by the Volume
// +optional
VolumeStats []VolumeStats `json:"volume,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
}
......@@ -89,14 +98,18 @@ type ContainerStats struct {
// The time at which data collection for this container was (re)started.
StartTime unversioned.Time `json:"startTime"`
// Stats pertaining to CPU resources.
// +optional
CPU *CPUStats `json:"cpu,omitempty"`
// Stats pertaining to memory (RAM) resources.
// +optional
Memory *MemoryStats `json:"memory,omitempty"`
// Stats pertaining to container rootfs usage of filesystem resources.
// Rootfs.UsedBytes is the number of bytes used for the container write layer.
// +optional
Rootfs *FsStats `json:"rootfs,omitempty"`
// Stats pertaining to container logs usage of filesystem resources.
// Logs.UsedBytes is the number of bytes used for the container logs.
// +optional
Logs *FsStats `json:"logs,omitempty"`
// User defined metrics that are exposed by containers in the pod. Typically, we expect only one container in the pod to be exposing user defined metrics. In the event of multiple containers exposing metrics, they will be combined here.
UserDefinedMetrics []UserDefinedMetric `json:"userDefinedMetrics,omitmepty" patchStrategy:"merge" patchMergeKey:"name"`
......@@ -114,12 +127,16 @@ type NetworkStats struct {
// The time at which these stats were updated.
Time unversioned.Time `json:"time"`
// Cumulative count of bytes received.
// +optional
RxBytes *uint64 `json:"rxBytes,omitempty"`
// Cumulative count of receive errors encountered.
// +optional
RxErrors *uint64 `json:"rxErrors,omitempty"`
// Cumulative count of bytes transmitted.
// +optional
TxBytes *uint64 `json:"txBytes,omitempty"`
// Cumulative count of transmit errors encountered.
// +optional
TxErrors *uint64 `json:"txErrors,omitempty"`
}
......@@ -129,8 +146,10 @@ type CPUStats struct {
Time unversioned.Time `json:"time"`
// Total CPU usage (sum of all cores) averaged over the sample window.
// The "core" unit can be interpreted as CPU core-nanoseconds per second.
// +optional
UsageNanoCores *uint64 `json:"usageNanoCores,omitempty"`
// Cumulative CPU usage (sum of all cores) since object creation.
// +optional
UsageCoreNanoSeconds *uint64 `json:"usageCoreNanoSeconds,omitempty"`
}
......@@ -140,18 +159,24 @@ type MemoryStats struct {
Time unversioned.Time `json:"time"`
// Available memory for use. This is defined as the memory limit - workingSetBytes.
// If memory limit is undefined, the available bytes is omitted.
// +optional
AvailableBytes *uint64 `json:"availableBytes,omitempty"`
// Total memory in use. This includes all memory regardless of when it was accessed.
// +optional
UsageBytes *uint64 `json:"usageBytes,omitempty"`
// The amount of working set memory. This includes recently accessed memory,
// dirty memory, and kernel memory. WorkingSetBytes is <= UsageBytes
// +optional
WorkingSetBytes *uint64 `json:"workingSetBytes,omitempty"`
// The amount of anonymous and swap cache memory (includes transparent
// hugepages).
// +optional
RSSBytes *uint64 `json:"rssBytes,omitempty"`
// Cumulative number of minor page faults.
// +optional
PageFaults *uint64 `json:"pageFaults,omitempty"`
// Cumulative number of major page faults.
// +optional
MajorPageFaults *uint64 `json:"majorPageFaults,omitempty"`
}
......@@ -160,22 +185,28 @@ type VolumeStats struct {
// Embedded FsStats
FsStats
// Name is the name given to the Volume
// +optional
Name string `json:"name,omitempty"`
}
// FsStats contains data about filesystem usage.
type FsStats struct {
// AvailableBytes represents the storage space available (bytes) for the filesystem.
// +optional
AvailableBytes *uint64 `json:"availableBytes,omitempty"`
// CapacityBytes represents the total capacity (bytes) of the filesystems underlying storage.
// +optional
CapacityBytes *uint64 `json:"capacityBytes,omitempty"`
// UsedBytes represents the bytes used for a specific task on the filesystem.
// This may differ from the total bytes used on the filesystem and may not equal CapacityBytes - AvailableBytes.
// e.g. For ContainerStats.Rootfs this is the bytes used by the container rootfs on the filesystem.
// +optional
UsedBytes *uint64 `json:"usedBytes,omitempty"`
// InodesFree represents the free inodes in the filesystem.
// +optional
InodesFree *uint64 `json:"inodesFree,omitempty"`
// Inodes represents the total inodes in the filesystem.
// +optional
Inodes *uint64 `json:"inodes,omitempty"`
}
......@@ -205,6 +236,7 @@ type UserDefinedMetricDescriptor struct {
Units string `json:"units"`
// Metadata labels associated with this metric.
// +optional
Labels map[string]string `json:"labels,omitempty"`
}
......
......@@ -88,23 +88,28 @@ func CreateHandlers(provider StatsProvider, summaryProvider SummaryProvider) *re
type StatsRequest struct {
// The name of the container for which to request stats.
// Default: /
// +optional
ContainerName string `json:"containerName,omitempty"`
// Max number of stats to return.
// If start and end time are specified this limit is ignored.
// Default: 60
// +optional
NumStats int `json:"num_stats,omitempty"`
// Start time for which to query information.
// If omitted, the beginning of time is assumed.
// +optional
Start time.Time `json:"start,omitempty"`
// End time for which to query information.
// If omitted, current time is assumed.
// +optional
End time.Time `json:"end,omitempty"`
// Whether to also include information from subcontainers.
// Default: false.
// +optional
Subcontainers bool `json:"subcontainers,omitempty"`
}
......
......@@ -522,10 +522,13 @@ func (t *thirdPartyResourceDataEncoder) Encode(obj runtime.Object, stream io.Wri
}
encMap := struct {
Kind string `json:"kind,omitempty"`
Items []json.RawMessage `json:"items"`
Metadata unversioned.ListMeta `json:"metadata,omitempty"`
APIVersion string `json:"apiVersion,omitempty"`
// +optional
Kind string `json:"kind,omitempty"`
Items []json.RawMessage `json:"items"`
// +optional
Metadata unversioned.ListMeta `json:"metadata,omitempty"`
// +optional
APIVersion string `json:"apiVersion,omitempty"`
}{
Kind: t.gvk.Kind + "List",
Items: listItems,
......
......@@ -94,8 +94,10 @@ message RawExtension {
// +protobuf=true
// +k8s:openapi-gen=true
message TypeMeta {
// +optional
optional string apiVersion = 1;
// +optional
optional string kind = 2;
}
......
......@@ -47,8 +47,10 @@ type SimpleMetaFactory struct {
// encoding of an object, or an error.
func (SimpleMetaFactory) Interpret(data []byte) (*unversioned.GroupVersionKind, error) {
findKind := struct {
// +optional
APIVersion string `json:"apiVersion,omitempty"`
Kind string `json:"kind,omitempty"`
// +optional
Kind string `json:"kind,omitempty"`
}{}
if err := json.Unmarshal(data, &findKind); err != nil {
return nil, fmt.Errorf("couldn't get version/kind; json parse error: %v", err)
......
......@@ -34,8 +34,10 @@ package runtime
// +protobuf=true
// +k8s:openapi-gen=true
type TypeMeta struct {
// +optional
APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty" protobuf:"bytes,1,opt,name=apiVersion"`
Kind string `json:"kind,omitempty" yaml:"kind,omitempty" protobuf:"bytes,2,opt,name=kind"`
// +optional
Kind string `json:"kind,omitempty" yaml:"kind,omitempty" protobuf:"bytes,2,opt,name=kind"`
}
const (
......
......@@ -82,6 +82,7 @@ type UpdateFunc func(input runtime.Object, res ResponseMeta) (output runtime.Obj
// Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.
type Preconditions struct {
// Specifies the target UID.
// +optional
UID *types.UID `json:"uid,omitempty"`
}
......
......@@ -31,11 +31,13 @@ import (
// in the schema.
type WatchEvent struct {
// The type of the watch event; added, modified, deleted, or error.
// +optional
Type watch.EventType `json:"type,omitempty" description:"the type of watch event; may be ADDED, MODIFIED, DELETED, or ERROR"`
// For added or modified objects, this is the new object; for deleted objects,
// it's the state of the object immediately prior to its deletion.
// For errors, it's an api.Status.
// +optional
Object runtime.RawExtension `json:"object,omitempty" description:"the object being watched; will match the type of the resource endpoint or be a Status object if the type is ERROR"`
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment