From 25afcc552241f3fb73094d32c0851f5afd4b2bd6 Mon Sep 17 00:00:00 2001 From: mbohlool Date: Fri, 14 Oct 2016 15:37:37 -0700 Subject: [PATCH] Add +optional tag to all fields with omitempty json tag --- .../test_apis/testgroup.k8s.io/v1/types.go | 3 + federation/apis/federation/types.go | 16 + federation/apis/federation/v1beta1/types.go | 12 + pkg/api/types.go | 533 +++++++++++++++--- pkg/api/unversioned/types.go | 22 + pkg/api/v1/types.go | 441 +++++++++++++++ pkg/apis/abac/v0/types.go | 5 + pkg/apis/abac/v1beta1/types.go | 7 + pkg/apis/apps/types.go | 10 +- pkg/apis/apps/v1alpha1/types.go | 10 +- pkg/apis/authentication/v1beta1/types.go | 12 +- pkg/apis/authorization/v1beta1/types.go | 30 +- pkg/apis/autoscaling/types.go | 17 +- pkg/apis/autoscaling/v1/types.go | 15 + pkg/apis/batch/types.go | 32 ++ pkg/apis/batch/v1/types.go | 22 + pkg/apis/batch/v2alpha1/types.go | 35 ++ pkg/apis/certificates/types.go | 21 +- pkg/apis/certificates/v1alpha1/types.go | 20 +- pkg/apis/componentconfig/types.go | 22 + pkg/apis/componentconfig/v1alpha1/types.go | 4 + pkg/apis/extensions/types.go | 133 ++++- pkg/apis/extensions/v1beta1/types.go | 162 +++++- pkg/apis/imagepolicy/v1alpha1/types.go | 9 +- pkg/apis/policy/types.go | 10 +- pkg/apis/policy/v1alpha1/types.go | 10 +- pkg/apis/rbac/v1alpha1/types.go | 15 + pkg/apis/storage/types.go | 5 +- pkg/apis/storage/v1beta1/types.go | 3 + pkg/apiserver/testing/types.go | 15 +- pkg/apiserver/validator.go | 13 +- pkg/client/unversioned/clientcmd/api/types.go | 26 +- .../unversioned/clientcmd/api/v1/types.go | 23 + .../garbagecollector/metaonly/types.go | 4 +- pkg/credentialprovider/config.go | 11 +- pkg/kubectl/testing/types.go | 11 +- pkg/kubelet/api/v1alpha1/stats/types.go | 32 ++ pkg/kubelet/server/stats/handler.go | 5 + .../thirdpartyresourcedata/codec.go | 11 +- pkg/runtime/serializer/json/meta.go | 4 +- pkg/runtime/types.go | 4 +- pkg/storage/interfaces.go | 1 + pkg/watch/json/types.go | 2 + 43 files changed, 1665 insertions(+), 133 deletions(-) diff --git a/cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io/v1/types.go b/cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io/v1/types.go index 54465c32d82..e657e8e12e8 100644 --- a/cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io/v1/types.go +++ b/cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io/v1/types.go @@ -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"` + // +optional Status TestTypeStatus `json:"status,omitempty"` } type TestTypeList struct { unversioned.TypeMeta `json:",inline"` + // +optional unversioned.ListMeta `json:"metadata,omitempty"` Items []TestType `json:"items"` diff --git a/federation/apis/federation/types.go b/federation/apis/federation/types.go index e8943887ff9..273f0f945fe 100644 --- a/federation/apis/federation/types.go +++ b/federation/apis/federation/types.go @@ -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. diff --git a/federation/apis/federation/v1beta1/types.go b/federation/apis/federation/v1beta1/types.go index f9853bfab34..84931723952 100644 --- a/federation/apis/federation/v1beta1/types.go +++ b/federation/apis/federation/v1beta1/types.go @@ -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. diff --git a/pkg/api/types.go b/pkg/api/types.go index fc944b11e3e..8cb8c08e223 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -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 using the matching 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 "...svc.". // 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 "://" + // +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. diff --git a/pkg/api/unversioned/types.go b/pkg/api/unversioned/types.go index 7d632b496b1..6178f199b84 100644 --- a/pkg/api/unversioned/types.go +++ b/pkg/api/unversioned/types.go @@ -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"` } diff --git a/pkg/api/v1/types.go b/pkg/api/v1/types.go index 0d821f2676a..fa00a3c9201 100644 --- a/pkg/api/v1/types.go +++ b/pkg/api/v1/types.go @@ -72,6 +72,7 @@ type ObjectMeta struct { // definition. // Cannot be updated. // More info: http://kubernetes.io/docs/user-guide/identifiers#names + // +optional Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` // GenerateName is an optional prefix, used by the server, to generate a unique @@ -89,6 +90,7 @@ type ObjectMeta struct { // // Applied only if Name is not specified. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#idempotency + // +optional GenerateName string `json:"generateName,omitempty" protobuf:"bytes,2,opt,name=generateName"` // Namespace defines the space within each name must be unique. An empty namespace is @@ -99,11 +101,13 @@ type ObjectMeta struct { // Must be a DNS_LABEL. // Cannot be updated. // More info: http://kubernetes.io/docs/user-guide/namespaces + // +optional Namespace string `json:"namespace,omitempty" protobuf:"bytes,3,opt,name=namespace"` // SelfLink is a URL representing this object. // Populated by the system. // Read-only. + // +optional SelfLink string `json:"selfLink,omitempty" protobuf:"bytes,4,opt,name=selfLink"` // UID is the unique in time and space value for this object. It is typically generated by @@ -113,6 +117,7 @@ type ObjectMeta struct { // Populated by the system. // Read-only. // More info: http://kubernetes.io/docs/user-guide/identifiers#uids + // +optional UID types.UID `json:"uid,omitempty" protobuf:"bytes,5,opt,name=uid,casttype=k8s.io/kubernetes/pkg/types.UID"` // An opaque value that represents the internal version of this object that can @@ -125,10 +130,12 @@ type ObjectMeta struct { // Read-only. // Value must be treated as opaque by clients and . // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#concurrency-control-and-consistency + // +optional ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,6,opt,name=resourceVersion"` // A sequence number representing a specific generation of the desired state. // Populated by the system. Read-only. + // +optional Generation int64 `json:"generation,omitempty" protobuf:"varint,7,opt,name=generation"` // CreationTimestamp is a timestamp representing the server time when this object was @@ -139,6 +146,7 @@ type ObjectMeta struct { // Read-only. // Null for lists. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // +optional CreationTimestamp unversioned.Time `json:"creationTimestamp,omitempty" protobuf:"bytes,8,opt,name=creationTimestamp"` // DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This @@ -155,41 +163,48 @@ type ObjectMeta struct { // Populated by the system when a graceful deletion is requested. // Read-only. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // +optional DeletionTimestamp *unversioned.Time `json:"deletionTimestamp,omitempty" protobuf:"bytes,9,opt,name=deletionTimestamp"` // Number of seconds allowed for this object to gracefully terminate before // it will be removed from the system. Only set when deletionTimestamp is also set. // May only be shortened. // Read-only. + // +optional DeletionGracePeriodSeconds *int64 `json:"deletionGracePeriodSeconds,omitempty" protobuf:"varint,10,opt,name=deletionGracePeriodSeconds"` // Map of string keys and values that can be used to organize and categorize // (scope and select) objects. May match selectors of replication controllers // and services. // More info: http://kubernetes.io/docs/user-guide/labels + // +optional Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,11,rep,name=labels"` // Annotations is an unstructured key value map stored with a resource that may be // set by external tools to store and retrieve arbitrary metadata. They are not // queryable and should be preserved when modifying objects. // More info: http://kubernetes.io/docs/user-guide/annotations + // +optional Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,12,rep,name=annotations"` // 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" patchStrategy:"merge" patchMergeKey:"uid" protobuf:"bytes,13,rep,name=ownerReferences"` // 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" patchStrategy:"merge" protobuf:"bytes,14,rep,name=finalizers"` // 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" protobuf:"bytes,15,opt,name=clusterName"` } @@ -223,64 +238,86 @@ 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" protobuf:"bytes,1,opt,name=hostPath"` // EmptyDir represents a temporary directory that shares a pod's lifetime. // More info: http://kubernetes.io/docs/user-guide/volumes#emptydir + // +optional EmptyDir *EmptyDirVolumeSource `json:"emptyDir,omitempty" protobuf:"bytes,2,opt,name=emptyDir"` // GCEPersistentDisk represents a GCE Disk resource that is attached to a // kubelet's host machine and then exposed to the pod. // More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk + // +optional GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"gcePersistentDisk,omitempty" protobuf:"bytes,3,opt,name=gcePersistentDisk"` // AWSElasticBlockStore represents an AWS Disk resource that is attached to a // kubelet's host machine and then exposed to the pod. // More info: http://kubernetes.io/docs/user-guide/volumes#awselasticblockstore + // +optional AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore,omitempty" protobuf:"bytes,4,opt,name=awsElasticBlockStore"` // GitRepo represents a git repository at a particular revision. + // +optional GitRepo *GitRepoVolumeSource `json:"gitRepo,omitempty" protobuf:"bytes,5,opt,name=gitRepo"` // Secret represents a secret that should populate this volume. // More info: http://kubernetes.io/docs/user-guide/volumes#secrets + // +optional Secret *SecretVolumeSource `json:"secret,omitempty" protobuf:"bytes,6,opt,name=secret"` // NFS represents an NFS mount on the host that shares a pod's lifetime // More info: http://kubernetes.io/docs/user-guide/volumes#nfs + // +optional NFS *NFSVolumeSource `json:"nfs,omitempty" protobuf:"bytes,7,opt,name=nfs"` // ISCSI represents an ISCSI Disk resource that is attached to a // kubelet's host machine and then exposed to the pod. // More info: http://releases.k8s.io/HEAD/examples/volumes/iscsi/README.md + // +optional ISCSI *ISCSIVolumeSource `json:"iscsi,omitempty" protobuf:"bytes,8,opt,name=iscsi"` // Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. // More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md + // +optional Glusterfs *GlusterfsVolumeSource `json:"glusterfs,omitempty" protobuf:"bytes,9,opt,name=glusterfs"` // PersistentVolumeClaimVolumeSource represents a reference to a // PersistentVolumeClaim in the same namespace. // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#persistentvolumeclaims + // +optional PersistentVolumeClaim *PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty" protobuf:"bytes,10,opt,name=persistentVolumeClaim"` // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md + // +optional RBD *RBDVolumeSource `json:"rbd,omitempty" protobuf:"bytes,11,opt,name=rbd"` // 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" protobuf:"bytes,12,opt,name=flexVolume"` // Cinder represents a cinder volume attached and mounted on kubelets host machine // More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md + // +optional Cinder *CinderVolumeSource `json:"cinder,omitempty" protobuf:"bytes,13,opt,name=cinder"` // CephFS represents a Ceph FS mount on the host that shares a pod's lifetime + // +optional CephFS *CephFSVolumeSource `json:"cephfs,omitempty" protobuf:"bytes,14,opt,name=cephfs"` // 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" protobuf:"bytes,15,opt,name=flocker"` // DownwardAPI represents downward API about the pod that should populate this volume + // +optional DownwardAPI *DownwardAPIVolumeSource `json:"downwardAPI,omitempty" protobuf:"bytes,16,opt,name=downwardAPI"` // 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" protobuf:"bytes,17,opt,name=fc"` // AzureFile represents an Azure File Service mount on the host and bind mount to the pod. + // +optional AzureFile *AzureFileVolumeSource `json:"azureFile,omitempty" protobuf:"bytes,18,opt,name=azureFile"` // ConfigMap represents a configMap that should populate this volume + // +optional ConfigMap *ConfigMapVolumeSource `json:"configMap,omitempty" protobuf:"bytes,19,opt,name=configMap"` // VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine + // +optional VsphereVolume *VsphereVirtualDiskVolumeSource `json:"vsphereVolume,omitempty" protobuf:"bytes,20,opt,name=vsphereVolume"` // Quobyte represents a Quobyte mount on the host that shares a pod's lifetime + // +optional Quobyte *QuobyteVolumeSource `json:"quobyte,omitempty" protobuf:"bytes,21,opt,name=quobyte"` // AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. + // +optional AzureDisk *AzureDiskVolumeSource `json:"azureDisk,omitempty" protobuf:"bytes,22,opt,name=azureDisk"` } @@ -294,6 +331,7 @@ type PersistentVolumeClaimVolumeSource struct { ClaimName string `json:"claimName" protobuf:"bytes,1,opt,name=claimName"` // Will force the ReadOnly setting in VolumeMounts. // Default false. + // +optional ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,2,opt,name=readOnly"` } @@ -303,50 +341,66 @@ type PersistentVolumeSource struct { // GCEPersistentDisk represents a GCE Disk resource that is attached to a // kubelet's host machine and then exposed to the pod. Provisioned by an admin. // More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk + // +optional GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"gcePersistentDisk,omitempty" protobuf:"bytes,1,opt,name=gcePersistentDisk"` // AWSElasticBlockStore represents an AWS Disk resource that is attached to a // kubelet's host machine and then exposed to the pod. // More info: http://kubernetes.io/docs/user-guide/volumes#awselasticblockstore + // +optional AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore,omitempty" protobuf:"bytes,2,opt,name=awsElasticBlockStore"` // 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. // More info: http://kubernetes.io/docs/user-guide/volumes#hostpath + // +optional HostPath *HostPathVolumeSource `json:"hostPath,omitempty" protobuf:"bytes,3,opt,name=hostPath"` // Glusterfs represents a Glusterfs volume that is attached to a host and // exposed to the pod. Provisioned by an admin. // More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md + // +optional Glusterfs *GlusterfsVolumeSource `json:"glusterfs,omitempty" protobuf:"bytes,4,opt,name=glusterfs"` // NFS represents an NFS mount on the host. Provisioned by an admin. // More info: http://kubernetes.io/docs/user-guide/volumes#nfs + // +optional NFS *NFSVolumeSource `json:"nfs,omitempty" protobuf:"bytes,5,opt,name=nfs"` // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md + // +optional RBD *RBDVolumeSource `json:"rbd,omitempty" protobuf:"bytes,6,opt,name=rbd"` // ISCSI represents an ISCSI Disk resource that is attached to a // kubelet's host machine and then exposed to the pod. Provisioned by an admin. + // +optional ISCSI *ISCSIVolumeSource `json:"iscsi,omitempty" protobuf:"bytes,7,opt,name=iscsi"` // Cinder represents a cinder volume attached and mounted on kubelets host machine // More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md + // +optional Cinder *CinderVolumeSource `json:"cinder,omitempty" protobuf:"bytes,8,opt,name=cinder"` // CephFS represents a Ceph FS mount on the host that shares a pod's lifetime + // +optional CephFS *CephFSVolumeSource `json:"cephfs,omitempty" protobuf:"bytes,9,opt,name=cephfs"` // 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" protobuf:"bytes,10,opt,name=fc"` // Flocker represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running + // +optional Flocker *FlockerVolumeSource `json:"flocker,omitempty" protobuf:"bytes,11,opt,name=flocker"` // 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" protobuf:"bytes,12,opt,name=flexVolume"` // AzureFile represents an Azure File Service mount on the host and bind mount to the pod. + // +optional AzureFile *AzureFileVolumeSource `json:"azureFile,omitempty" protobuf:"bytes,13,opt,name=azureFile"` // VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine + // +optional VsphereVolume *VsphereVirtualDiskVolumeSource `json:"vsphereVolume,omitempty" protobuf:"bytes,14,opt,name=vsphereVolume"` // Quobyte represents a Quobyte mount on the host that shares a pod's lifetime + // +optional Quobyte *QuobyteVolumeSource `json:"quobyte,omitempty" protobuf:"bytes,15,opt,name=quobyte"` // AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. + // +optional AzureDisk *AzureDiskVolumeSource `json:"azureDisk,omitempty" protobuf:"bytes,16,opt,name=azureDisk"` } @@ -360,17 +414,20 @@ type PersistentVolume struct { unversioned.TypeMeta `json:",inline"` // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // +optional ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec defines a specification of a persistent volume owned by the cluster. // Provisioned by an administrator. // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#persistent-volumes + // +optional Spec PersistentVolumeSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // Status represents the current information/status for the persistent volume. // Populated by the system. // Read-only. // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#persistent-volumes + // +optional Status PersistentVolumeStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } @@ -378,21 +435,25 @@ type PersistentVolume struct { type PersistentVolumeSpec struct { // A description of the persistent volume's resources and capacity. // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#capacity + // +optional Capacity ResourceList `json:"capacity,omitempty" protobuf:"bytes,1,rep,name=capacity,casttype=ResourceList,castkey=ResourceName"` // The actual volume backing the persistent volume. PersistentVolumeSource `json:",inline" protobuf:"bytes,2,opt,name=persistentVolumeSource"` // AccessModes contains all ways the volume can be mounted. // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#access-modes + // +optional AccessModes []PersistentVolumeAccessMode `json:"accessModes,omitempty" protobuf:"bytes,3,rep,name=accessModes,casttype=PersistentVolumeAccessMode"` // ClaimRef is part of a bi-directional binding between PersistentVolume and PersistentVolumeClaim. // Expected to be non-nil when bound. // claim.VolumeName is the authoritative bind between PV and PVC. // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#binding + // +optional ClaimRef *ObjectReference `json:"claimRef,omitempty" protobuf:"bytes,4,opt,name=claimRef"` // What happens to a persistent volume when released from its claim. // Valid options are Retain (default) and Recycle. // Recycling must be supported by the volume plugin underlying this persistent volume. // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#recycling-policy + // +optional PersistentVolumeReclaimPolicy PersistentVolumeReclaimPolicy `json:"persistentVolumeReclaimPolicy,omitempty" protobuf:"bytes,5,opt,name=persistentVolumeReclaimPolicy,casttype=PersistentVolumeReclaimPolicy"` } @@ -415,11 +476,14 @@ const ( type PersistentVolumeStatus struct { // Phase indicates if a volume is available, bound to a claim, or released by a claim. // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#phase + // +optional Phase PersistentVolumePhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase,casttype=PersistentVolumePhase"` // A human-readable message indicating details about why the volume is in this state. + // +optional Message string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"` // 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" protobuf:"bytes,3,opt,name=reason"` } @@ -428,6 +492,7 @@ type PersistentVolumeList 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 persistent volumes. // More info: http://kubernetes.io/docs/user-guide/persistent-volumes @@ -441,15 +506,18 @@ type PersistentVolumeClaim struct { unversioned.TypeMeta `json:",inline"` // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // +optional ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec defines the desired characteristics of a volume requested by a pod author. // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#persistentvolumeclaims + // +optional Spec PersistentVolumeClaimSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // Status represents the current information/status of a persistent volume claim. // Read-only. // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#persistentvolumeclaims + // +optional Status PersistentVolumeClaimStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } @@ -458,6 +526,7 @@ type PersistentVolumeClaimList 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"` // A list of persistent volume claims. // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#persistentvolumeclaims @@ -469,24 +538,31 @@ type PersistentVolumeClaimList struct { type PersistentVolumeClaimSpec struct { // AccessModes contains the desired access modes the volume should have. // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#access-modes-1 + // +optional AccessModes []PersistentVolumeAccessMode `json:"accessModes,omitempty" protobuf:"bytes,1,rep,name=accessModes,casttype=PersistentVolumeAccessMode"` // A label query over volumes to consider for binding. + // +optional Selector *unversioned.LabelSelector `json:"selector,omitempty" protobuf:"bytes,4,opt,name=selector"` // Resources represents the minimum resources the volume should have. // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#resources + // +optional Resources ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,2,opt,name=resources"` // VolumeName is the binding reference to the PersistentVolume backing this claim. + // +optional VolumeName string `json:"volumeName,omitempty" protobuf:"bytes,3,opt,name=volumeName"` } // PersistentVolumeClaimStatus is the current status of a persistent volume claim. type PersistentVolumeClaimStatus struct { // Phase represents the current phase of PersistentVolumeClaim. + // +optional Phase PersistentVolumeClaimPhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase,casttype=PersistentVolumeClaimPhase"` // AccessModes contains the actual access modes the volume backing the PVC has. // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#access-modes-1 + // +optional AccessModes []PersistentVolumeAccessMode `json:"accessModes,omitempty" protobuf:"bytes,2,rep,name=accessModes,casttype=PersistentVolumeAccessMode"` // Represents the actual resources of the underlying volume. + // +optional Capacity ResourceList `json:"capacity,omitempty" protobuf:"bytes,3,rep,name=capacity,casttype=ResourceList,castkey=ResourceName"` } @@ -547,6 +623,7 @@ type EmptyDirVolumeSource struct { // The default is "" which means to use the node's default medium. // Must be an empty string (default) or Memory. // More info: http://kubernetes.io/docs/user-guide/volumes#emptydir + // +optional Medium StorageMedium `json:"medium,omitempty" protobuf:"bytes,1,opt,name=medium,casttype=StorageMedium"` } @@ -564,6 +641,7 @@ type GlusterfsVolumeSource struct { // ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. // Defaults to false. // More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod + // +optional ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` } @@ -581,27 +659,33 @@ type RBDVolumeSource struct { // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. // More info: http://kubernetes.io/docs/user-guide/volumes#rbd // TODO: how do we prevent errors in the filesystem from compromising the machine + // +optional FSType string `json:"fsType,omitempty" protobuf:"bytes,3,opt,name=fsType"` // The rados pool name. // Default is rbd. // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it. + // +optional RBDPool string `json:"pool,omitempty" protobuf:"bytes,4,opt,name=pool"` // The rados user name. // Default is admin. // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it + // +optional RadosUser string `json:"user,omitempty" protobuf:"bytes,5,opt,name=user"` // Keyring is the path to key ring for RBDUser. // Default is /etc/ceph/keyring. // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it + // +optional Keyring string `json:"keyring,omitempty" protobuf:"bytes,6,opt,name=keyring"` // SecretRef is name of the authentication secret for RBDUser. If provided // overrides keyring. // Default is nil. // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it + // +optional SecretRef *LocalObjectReference `json:"secretRef,omitempty" protobuf:"bytes,7,opt,name=secretRef"` // ReadOnly here will force the ReadOnly setting in VolumeMounts. // Defaults to false. // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it + // +optional ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,8,opt,name=readOnly"` } @@ -617,10 +701,12 @@ type CinderVolumeSource struct { // Must be a filesystem type supported by the host operating system. // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. // More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md + // +optional FSType string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"` // Optional: Defaults to false (read/write). ReadOnly here will force // the ReadOnly setting in VolumeMounts. // More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md + // +optional ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` } @@ -631,19 +717,24 @@ type CephFSVolumeSource struct { // More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it Monitors []string `json:"monitors" protobuf:"bytes,1,rep,name=monitors"` // Optional: Used as the mounted root, rather than the full Ceph tree, default is / + // +optional Path string `json:"path,omitempty" protobuf:"bytes,2,opt,name=path"` // Optional: User is the rados user name, default is admin // More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it + // +optional User string `json:"user,omitempty" protobuf:"bytes,3,opt,name=user"` // Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret // More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it + // +optional SecretFile string `json:"secretFile,omitempty" protobuf:"bytes,4,opt,name=secretFile"` // Optional: SecretRef is reference to the authentication secret for User, default is empty. // More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it + // +optional SecretRef *LocalObjectReference `json:"secretRef,omitempty" protobuf:"bytes,5,opt,name=secretRef"` // Optional: Defaults to false (read/write). ReadOnly here will force // the ReadOnly setting in VolumeMounts. // More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it + // +optional ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,6,opt,name=readOnly"` } @@ -653,8 +744,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" protobuf:"bytes,1,opt,name=datasetName"` // UUID of the dataset. This is unique identifier of a Flocker dataset + // +optional DatasetUUID string `json:"datasetUUID,omitempty" protobuf:"bytes,2,opt,name=datasetUUID"` } @@ -691,16 +784,19 @@ type GCEPersistentDiskVolumeSource struct { // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. // More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk // TODO: how do we prevent errors in the filesystem from compromising the machine + // +optional FSType string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"` // The partition in the volume that you want to mount. // If omitted, the default is to mount by volume name. // Examples: For volume /dev/sda1, you specify the partition as "1". // Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). // More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk + // +optional Partition int32 `json:"partition,omitempty" protobuf:"varint,3,opt,name=partition"` // ReadOnly here will force the ReadOnly setting in VolumeMounts. // Defaults to false. // More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk + // +optional ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,4,opt,name=readOnly"` } @@ -717,14 +813,17 @@ type QuobyteVolumeSource struct { // ReadOnly here will force the Quobyte volume to be mounted with read-only permissions. // Defaults to false. + // +optional ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` // User to map volume access to // Defaults to serivceaccount user + // +optional User string `json:"user,omitempty" protobuf:"bytes,4,opt,name=user"` // Group to map volume access to // Default is no group + // +optional Group string `json:"group,omitempty" protobuf:"bytes,5,opt,name=group"` } @@ -736,17 +835,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" protobuf:"bytes,2,opt,name=fsType"` // 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" protobuf:"bytes,3,opt,name=secretRef"` // Optional: Defaults to false (read/write). ReadOnly here will force // the ReadOnly setting in VolumeMounts. + // +optional ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,4,opt,name=readOnly"` // Optional: Extra command options if any. + // +optional Options map[string]string `json:"options,omitempty" protobuf:"bytes,5,rep,name=options"` } @@ -765,15 +868,18 @@ type AWSElasticBlockStoreVolumeSource struct { // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. // More info: http://kubernetes.io/docs/user-guide/volumes#awselasticblockstore // TODO: how do we prevent errors in the filesystem from compromising the machine + // +optional FSType string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"` // The partition in the volume that you want to mount. // If omitted, the default is to mount by volume name. // Examples: For volume /dev/sda1, you specify the partition as "1". // Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). + // +optional Partition int32 `json:"partition,omitempty" protobuf:"varint,3,opt,name=partition"` // Specify "true" to force and set the ReadOnly property in VolumeMounts to "true". // If omitted, the default is "false". // More info: http://kubernetes.io/docs/user-guide/volumes#awselasticblockstore + // +optional ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,4,opt,name=readOnly"` } @@ -784,11 +890,13 @@ type GitRepoVolumeSource struct { // Repository URL Repository string `json:"repository" protobuf:"bytes,1,opt,name=repository"` // Commit hash for the specified revision. + // +optional Revision string `json:"revision,omitempty" protobuf:"bytes,2,opt,name=revision"` // Target directory name. // 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" protobuf:"bytes,3,opt,name=directory"` } @@ -800,6 +908,7 @@ type GitRepoVolumeSource struct { type SecretVolumeSource struct { // Name of the secret in the pod's namespace to use. // More info: http://kubernetes.io/docs/user-guide/volumes#secrets + // +optional SecretName string `json:"secretName,omitempty" protobuf:"bytes,1,opt,name=secretName"` // 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 @@ -808,12 +917,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" protobuf:"bytes,2,rep,name=items"` // Optional: mode bits to use on created files by default. Must be a // value between 0 and 0777. Defaults to 0644. // 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" protobuf:"bytes,3,opt,name=defaultMode"` } @@ -836,6 +947,7 @@ type NFSVolumeSource struct { // the NFS export to be mounted with read-only permissions. // Defaults to false. // More info: http://kubernetes.io/docs/user-guide/volumes#nfs + // +optional ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` } @@ -851,15 +963,18 @@ type ISCSIVolumeSource struct { // iSCSI target lun number. Lun int32 `json:"lun" protobuf:"varint,3,opt,name=lun"` // Optional: Defaults to 'default' (tcp). iSCSI interface name that uses an iSCSI transport. + // +optional ISCSIInterface string `json:"iscsiInterface,omitempty" protobuf:"bytes,4,opt,name=iscsiInterface"` // Filesystem type of the volume that you want to mount. // Tip: Ensure that the filesystem type is supported by the host operating system. // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. // More info: http://kubernetes.io/docs/user-guide/volumes#iscsi // TODO: how do we prevent errors in the filesystem from compromising the machine + // +optional FSType string `json:"fsType,omitempty" protobuf:"bytes,5,opt,name=fsType"` // ReadOnly here will force the ReadOnly setting in VolumeMounts. // Defaults to false. + // +optional ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,6,opt,name=readOnly"` } @@ -875,9 +990,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" protobuf:"bytes,3,opt,name=fsType"` // Optional: Defaults to false (read/write). ReadOnly here will force // the ReadOnly setting in VolumeMounts. + // +optional ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,4,opt,name=readOnly"` } @@ -889,6 +1006,7 @@ type AzureFileVolumeSource struct { ShareName string `json:"shareName" protobuf:"bytes,2,opt,name=shareName"` // Defaults to false (read/write). ReadOnly here will force // the ReadOnly setting in VolumeMounts. + // +optional ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` } @@ -899,6 +1017,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" protobuf:"bytes,2,opt,name=fsType"` } type AzureDataDiskCachingMode string @@ -916,13 +1035,16 @@ type AzureDiskVolumeSource struct { // The URI the data disk in the blob storage DataDiskURI string `json:"diskURI" protobuf:"bytes,2,opt,name=diskURI"` // Host Caching mode: None, Read Only, Read Write. + // +optional CachingMode *AzureDataDiskCachingMode `json:"cachingMode,omitempty" protobuf:"bytes,3,opt,name=cachingMode,casttype=AzureDataDiskCachingMode"` // 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" protobuf:"bytes,4,opt,name=fsType"` // Defaults to false (read/write). ReadOnly here will force // the ReadOnly setting in VolumeMounts. + // +optional ReadOnly *bool `json:"readOnly,omitempty" protobuf:"varint,5,opt,name=readOnly"` } @@ -941,12 +1063,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" protobuf:"bytes,2,rep,name=items"` // Optional: mode bits to use on created files by default. Must be a // value between 0 and 0777. Defaults to 0644. // 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" protobuf:"varint,3,opt,name=defaultMode"` } @@ -968,6 +1092,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" protobuf:"varint,3,opt,name=mode"` } @@ -976,19 +1101,23 @@ type ContainerPort struct { // If specified, this must be an IANA_SVC_NAME and unique within the pod. Each // named port in a pod must have a unique name. Name for the port that can be // referred to by services. + // +optional Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` // Number of port to expose on the host. // If specified, this must be a valid port number, 0 < x < 65536. // If HostNetwork is specified, this must match ContainerPort. // Most containers do not need this. + // +optional HostPort int32 `json:"hostPort,omitempty" protobuf:"varint,2,opt,name=hostPort"` // Number of port to expose on the pod's IP address. // This must be a valid port number, 0 < x < 65536. ContainerPort int32 `json:"containerPort" protobuf:"varint,3,opt,name=containerPort"` // Protocol for port. Must be UDP or TCP. // Defaults to "TCP". + // +optional Protocol Protocol `json:"protocol,omitempty" protobuf:"bytes,4,opt,name=protocol,casttype=Protocol"` // What host IP to bind the external port to. + // +optional HostIP string `json:"hostIP,omitempty" protobuf:"bytes,5,opt,name=hostIP"` } @@ -998,12 +1127,14 @@ type VolumeMount struct { Name string `json:"name" protobuf:"bytes,1,opt,name=name"` // Mounted read-only if true, read-write otherwise (false or unspecified). // Defaults to false. + // +optional ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,2,opt,name=readOnly"` // Path within the container at which the volume should be mounted. Must // not contain ':'. MountPath string `json:"mountPath" protobuf:"bytes,3,opt,name=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" protobuf:"bytes,4,opt,name=subPath"` } @@ -1022,8 +1153,10 @@ type EnvVar struct { // references will never be expanded, regardless of whether the variable // exists or not. // Defaults to "". + // +optional Value string `json:"value,omitempty" protobuf:"bytes,2,opt,name=value"` // Source for the environment variable's value. Cannot be used if value is not empty. + // +optional ValueFrom *EnvVarSource `json:"valueFrom,omitempty" protobuf:"bytes,3,opt,name=valueFrom"` } @@ -1031,19 +1164,24 @@ 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" protobuf:"bytes,1,opt,name=fieldRef"` // 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" protobuf:"bytes,2,opt,name=resourceFieldRef"` // Selects a key of a ConfigMap. + // +optional ConfigMapKeyRef *ConfigMapKeySelector `json:"configMapKeyRef,omitempty" protobuf:"bytes,3,opt,name=configMapKeyRef"` // Selects a key of a secret in the pod's namespace + // +optional SecretKeyRef *SecretKeySelector `json:"secretKeyRef,omitempty" protobuf:"bytes,4,opt,name=secretKeyRef"` } // ObjectFieldSelector selects an APIVersioned field of an object. type ObjectFieldSelector struct { // Version of the schema the FieldPath is written in terms of, defaults to "v1". + // +optional APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,1,opt,name=apiVersion"` // Path of the field to select in the specified API version. FieldPath string `json:"fieldPath" protobuf:"bytes,2,opt,name=fieldPath"` @@ -1052,10 +1190,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" protobuf:"bytes,1,opt,name=containerName"` // Required: resource to select Resource string `json:"resource" protobuf:"bytes,2,opt,name=resource"` // Specifies the output format of the exposed resources, defaults to "1" + // +optional Divisor resource.Quantity `json:"divisor,omitempty" protobuf:"bytes,3,opt,name=divisor"` } @@ -1086,6 +1226,7 @@ type HTTPHeader struct { // HTTPGetAction describes an action based on HTTP Get requests. type HTTPGetAction struct { // Path to access on the HTTP server. + // +optional Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"` // Name or number of the port to access on the container. // Number must be in the range 1 to 65535. @@ -1093,11 +1234,14 @@ type HTTPGetAction struct { Port intstr.IntOrString `json:"port" protobuf:"bytes,2,opt,name=port"` // 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" protobuf:"bytes,3,opt,name=host"` // Scheme to use for connecting to the host. // Defaults to HTTP. + // +optional Scheme URIScheme `json:"scheme,omitempty" protobuf:"bytes,4,opt,name=scheme,casttype=URIScheme"` // Custom headers to set in the request. HTTP allows repeated headers. + // +optional HTTPHeaders []HTTPHeader `json:"httpHeaders,omitempty" protobuf:"bytes,5,rep,name=httpHeaders"` } @@ -1126,6 +1270,7 @@ type ExecAction struct { // 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. // Exit status of 0 is treated as live/healthy and non-zero is unhealthy. + // +optional Command []string `json:"command,omitempty" protobuf:"bytes,1,rep,name=command"` } @@ -1136,19 +1281,24 @@ type Probe struct { Handler `json:",inline" protobuf:"bytes,1,opt,name=handler"` // Number of seconds after the container has started before liveness probes are initiated. // More info: http://kubernetes.io/docs/user-guide/pod-states#container-probes + // +optional InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty" protobuf:"varint,2,opt,name=initialDelaySeconds"` // Number of seconds after which the probe times out. // Defaults to 1 second. Minimum value is 1. // More info: http://kubernetes.io/docs/user-guide/pod-states#container-probes + // +optional TimeoutSeconds int32 `json:"timeoutSeconds,omitempty" protobuf:"varint,3,opt,name=timeoutSeconds"` // How often (in seconds) to perform the probe. // Default to 10 seconds. Minimum value is 1. + // +optional PeriodSeconds int32 `json:"periodSeconds,omitempty" protobuf:"varint,4,opt,name=periodSeconds"` // Minimum consecutive successes for the probe to be considered successful after having failed. // Defaults to 1. Must be 1 for liveness. Minimum value is 1. + // +optional SuccessThreshold int32 `json:"successThreshold,omitempty" protobuf:"varint,5,opt,name=successThreshold"` // Minimum consecutive failures for the probe to be considered failed after having succeeded. // Defaults to 3. Minimum value is 1. + // +optional FailureThreshold int32 `json:"failureThreshold,omitempty" protobuf:"varint,6,opt,name=failureThreshold"` } @@ -1170,8 +1320,10 @@ type Capability string // Adds and removes POSIX capabilities from running containers. type Capabilities struct { // Added capabilities + // +optional Add []Capability `json:"add,omitempty" protobuf:"bytes,1,rep,name=add,casttype=Capability"` // Removed capabilities + // +optional Drop []Capability `json:"drop,omitempty" protobuf:"bytes,2,rep,name=drop,casttype=Capability"` } @@ -1179,11 +1331,13 @@ type Capabilities struct { type ResourceRequirements struct { // Limits describes the maximum amount of compute resources allowed. // More info: http://kubernetes.io/docs/user-guide/compute-resources/ + // +optional Limits ResourceList `json:"limits,omitempty" protobuf:"bytes,1,rep,name=limits,casttype=ResourceList,castkey=ResourceName"` // Requests describes the minimum amount of compute resources required. // If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, // otherwise to an implementation-defined value. // More info: http://kubernetes.io/docs/user-guide/compute-resources/ + // +optional Requests ResourceList `json:"requests,omitempty" protobuf:"bytes,2,rep,name=requests,casttype=ResourceList,castkey=ResourceName"` } @@ -1200,6 +1354,7 @@ type Container struct { Name string `json:"name" protobuf:"bytes,1,opt,name=name"` // Docker image name. // More info: http://kubernetes.io/docs/user-guide/images + // +optional Image string `json:"image,omitempty" protobuf:"bytes,2,opt,name=image"` // Entrypoint array. Not executed within a shell. // The docker image's ENTRYPOINT is used if this is not provided. @@ -1209,6 +1364,7 @@ type Container struct { // regardless of whether the variable exists or not. // Cannot be updated. // More info: http://kubernetes.io/docs/user-guide/containers#containers-and-commands + // +optional Command []string `json:"command,omitempty" protobuf:"bytes,3,rep,name=command"` // Arguments to the entrypoint. // The docker image's CMD is used if this is not provided. @@ -1218,11 +1374,13 @@ type Container struct { // regardless of whether the variable exists or not. // Cannot be updated. // More info: http://kubernetes.io/docs/user-guide/containers#containers-and-commands + // +optional Args []string `json:"args,omitempty" protobuf:"bytes,4,rep,name=args"` // Container's working directory. // If not specified, the container runtime's default will be used, which // might be configured in the container image. // Cannot be updated. + // +optional WorkingDir string `json:"workingDir,omitempty" protobuf:"bytes,5,opt,name=workingDir"` // List of ports to expose from the container. Exposing a port here gives // the system additional information about the network connections a @@ -1231,44 +1389,54 @@ type Container struct { // listening on the default "0.0.0.0" address inside a container will be // accessible from the network. // Cannot be updated. + // +optional Ports []ContainerPort `json:"ports,omitempty" patchStrategy:"merge" patchMergeKey:"containerPort" protobuf:"bytes,6,rep,name=ports"` // List of environment variables to set in the container. // Cannot be updated. + // +optional Env []EnvVar `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,7,rep,name=env"` // Compute Resources required by this container. // Cannot be updated. // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#resources + // +optional Resources ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,8,opt,name=resources"` // Pod volumes to mount into the container's filesystem. // Cannot be updated. + // +optional VolumeMounts []VolumeMount `json:"volumeMounts,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,9,rep,name=volumeMounts"` // Periodic probe of container liveness. // Container will be restarted if the probe fails. // Cannot be updated. // More info: http://kubernetes.io/docs/user-guide/pod-states#container-probes + // +optional LivenessProbe *Probe `json:"livenessProbe,omitempty" protobuf:"bytes,10,opt,name=livenessProbe"` // Periodic probe of container service readiness. // Container will be removed from service endpoints if the probe fails. // Cannot be updated. // More info: http://kubernetes.io/docs/user-guide/pod-states#container-probes + // +optional ReadinessProbe *Probe `json:"readinessProbe,omitempty" protobuf:"bytes,11,opt,name=readinessProbe"` // Actions that the management system should take in response to container lifecycle events. // Cannot be updated. + // +optional Lifecycle *Lifecycle `json:"lifecycle,omitempty" protobuf:"bytes,12,opt,name=lifecycle"` // Optional: Path at which the file to which the container's termination message // will be written is mounted into the container's filesystem. // Message written is intended to be brief final status, such as an assertion failure message. // Defaults to /dev/termination-log. // Cannot be updated. + // +optional TerminationMessagePath string `json:"terminationMessagePath,omitempty" protobuf:"bytes,13,opt,name=terminationMessagePath"` // Image pull policy. // One of Always, Never, IfNotPresent. // Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. // Cannot be updated. // More info: http://kubernetes.io/docs/user-guide/images#updating-images + // +optional ImagePullPolicy PullPolicy `json:"imagePullPolicy,omitempty" protobuf:"bytes,14,opt,name=imagePullPolicy,casttype=PullPolicy"` // Security options the pod should run with. // More info: http://releases.k8s.io/HEAD/docs/design/security_context.md + // +optional SecurityContext *SecurityContext `json:"securityContext,omitempty" protobuf:"bytes,15,opt,name=securityContext"` // Variables for interactive containers, these have very specialized use-cases (e.g. debugging) @@ -1277,6 +1445,7 @@ type Container struct { // Whether this container should allocate a buffer for stdin in the container runtime. If this // is not set, reads from stdin in the container will always result in EOF. // Default is false. + // +optional Stdin bool `json:"stdin,omitempty" protobuf:"varint,16,opt,name=stdin"` // Whether the container runtime should close the stdin channel after it has been opened by // a single attach. When stdin is true the stdin stream will remain open across multiple attach @@ -1285,9 +1454,11 @@ type Container struct { // at which time stdin is closed and remains closed until the container is restarted. If this // flag is false, a container processes that reads from stdin will never receive an EOF. // Default is false + // +optional StdinOnce bool `json:"stdinOnce,omitempty" protobuf:"varint,17,opt,name=stdinOnce"` // Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. // Default is false. + // +optional TTY bool `json:"tty,omitempty" protobuf:"varint,18,opt,name=tty"` } @@ -1296,12 +1467,15 @@ 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" protobuf:"bytes,1,opt,name=exec"` // HTTPGet specifies the http request to perform. + // +optional HTTPGet *HTTPGetAction `json:"httpGet,omitempty" protobuf:"bytes,2,opt,name=httpGet"` // TCPSocket specifies an action involving a TCP port. // TCP hooks not yet supported // TODO: implement a realistic TCP lifecycle hook + // +optional TCPSocket *TCPSocketAction `json:"tcpSocket,omitempty" protobuf:"bytes,3,opt,name=tcpSocket"` } @@ -1313,6 +1487,7 @@ type Lifecycle struct { // the container is terminated and restarted according to its restart policy. // Other management of the container blocks until the hook completes. // More info: http://kubernetes.io/docs/user-guide/container-environment#hook-details + // +optional PostStart *Handler `json:"postStart,omitempty" protobuf:"bytes,1,opt,name=postStart"` // PreStop is called immediately before a container is terminated. // The container is terminated after the handler completes. @@ -1320,6 +1495,7 @@ type Lifecycle struct { // Regardless of the outcome of the handler, the container is eventually terminated. // Other management of the container blocks until the hook completes. // More info: http://kubernetes.io/docs/user-guide/container-environment#hook-details + // +optional PreStop *Handler `json:"preStop,omitempty" protobuf:"bytes,2,opt,name=preStop"` } @@ -1338,14 +1514,17 @@ const ( // ContainerStateWaiting is a waiting state of a container. type ContainerStateWaiting struct { // (brief) reason the container is not yet running. + // +optional Reason string `json:"reason,omitempty" protobuf:"bytes,1,opt,name=reason"` // Message regarding why the container is not yet running. + // +optional Message string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"` } // ContainerStateRunning is a running state of a container. type ContainerStateRunning struct { // Time at which the container was last (re-)started + // +optional StartedAt unversioned.Time `json:"startedAt,omitempty" protobuf:"bytes,1,opt,name=startedAt"` } @@ -1354,16 +1533,22 @@ type ContainerStateTerminated struct { // Exit status from the last termination of the container ExitCode int32 `json:"exitCode" protobuf:"varint,1,opt,name=exitCode"` // Signal from the last termination of the container + // +optional Signal int32 `json:"signal,omitempty" protobuf:"varint,2,opt,name=signal"` // (brief) reason from the last termination of the container + // +optional Reason string `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason"` // Message regarding the last termination of the container + // +optional Message string `json:"message,omitempty" protobuf:"bytes,4,opt,name=message"` // Time at which previous execution of the container started + // +optional StartedAt unversioned.Time `json:"startedAt,omitempty" protobuf:"bytes,5,opt,name=startedAt"` // Time at which the container last terminated + // +optional FinishedAt unversioned.Time `json:"finishedAt,omitempty" protobuf:"bytes,6,opt,name=finishedAt"` // Container's ID in the format 'docker://' + // +optional ContainerID string `json:"containerID,omitempty" protobuf:"bytes,7,opt,name=containerID"` } @@ -1372,10 +1557,13 @@ type ContainerStateTerminated struct { // If none of them is specified, the default one is ContainerStateWaiting. type ContainerState struct { // Details about a waiting container + // +optional Waiting *ContainerStateWaiting `json:"waiting,omitempty" protobuf:"bytes,1,opt,name=waiting"` // Details about a running container + // +optional Running *ContainerStateRunning `json:"running,omitempty" protobuf:"bytes,2,opt,name=running"` // Details about a terminated container + // +optional Terminated *ContainerStateTerminated `json:"terminated,omitempty" protobuf:"bytes,3,opt,name=terminated"` } @@ -1385,8 +1573,10 @@ type ContainerStatus struct { // Cannot be updated. Name string `json:"name" protobuf:"bytes,1,opt,name=name"` // Details about the container's current condition. + // +optional State ContainerState `json:"state,omitempty" protobuf:"bytes,2,opt,name=state"` // Details about the container's last termination condition. + // +optional LastTerminationState ContainerState `json:"lastState,omitempty" protobuf:"bytes,3,opt,name=lastState"` // Specifies whether the container has passed its readiness probe. Ready bool `json:"ready" protobuf:"varint,4,opt,name=ready"` @@ -1403,6 +1593,7 @@ type ContainerStatus struct { ImageID string `json:"imageID" protobuf:"bytes,7,opt,name=imageID"` // Container's ID in the format 'docker://'. // More info: http://kubernetes.io/docs/user-guide/container-environment#container-information + // +optional ContainerID string `json:"containerID,omitempty" protobuf:"bytes,8,opt,name=containerID"` } @@ -1452,12 +1643,16 @@ type PodCondition struct { // More info: http://kubernetes.io/docs/user-guide/pod-states#pod-conditions Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=ConditionStatus"` // Last time we probed the condition. + // +optional LastProbeTime unversioned.Time `json:"lastProbeTime,omitempty" protobuf:"bytes,3,opt,name=lastProbeTime"` // Last time the condition transitioned from one status to another. + // +optional LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"` // Unique, one-word, CamelCase 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"` } @@ -1516,6 +1711,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" protobuf:"bytes,3,rep,name=values"` } @@ -1535,10 +1731,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" protobuf:"bytes,1,opt,name=nodeAffinity"` // 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" protobuf:"bytes,2,opt,name=podAffinity"` // 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" protobuf:"bytes,3,opt,name=podAntiAffinity"` } @@ -1552,6 +1751,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. @@ -1560,6 +1760,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" protobuf:"bytes,1,rep,name=requiredDuringSchedulingIgnoredDuringExecution"` // The scheduler will prefer to schedule pods to nodes that satisfy // the affinity expressions specified by this field, but it may choose @@ -1570,6 +1771,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" protobuf:"bytes,2,rep,name=preferredDuringSchedulingIgnoredDuringExecution"` } @@ -1583,6 +1785,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. @@ -1591,6 +1794,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" protobuf:"bytes,1,rep,name=requiredDuringSchedulingIgnoredDuringExecution"` // The scheduler will prefer to schedule pods to nodes that satisfy // the anti-affinity expressions specified by this field, but it may choose @@ -1601,6 +1805,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" protobuf:"bytes,2,rep,name=preferredDuringSchedulingIgnoredDuringExecution"` } @@ -1621,6 +1826,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" protobuf:"bytes,1,opt,name=labelSelector"` // namespaces specifies which namespaces the labelSelector applies to (matches against); // nil list means "this pod's namespace," empty list means "all namespaces" @@ -1634,6 +1840,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" protobuf:"bytes,3,opt,name=topologyKey"` } @@ -1645,6 +1852,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 @@ -1652,6 +1860,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" protobuf:"bytes,1,opt,name=requiredDuringSchedulingIgnoredDuringExecution"` // The scheduler will prefer to schedule pods to nodes that satisfy // the affinity expressions specified by this field, but it may choose @@ -1662,6 +1871,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" protobuf:"bytes,2,rep,name=preferredDuringSchedulingIgnoredDuringExecution"` } @@ -1680,6 +1890,7 @@ type Taint struct { // Required. The taint key to be applied to a node. Key string `json:"key" patchStrategy:"merge" patchMergeKey:"key" protobuf:"bytes,1,opt,name=key"` // Required. The taint value corresponding to the taint key. + // +optional Value string `json:"value,omitempty" protobuf:"bytes,2,opt,name=value"` // Required. The effect of the taint on pods // that do not tolerate the taint. @@ -1717,17 +1928,21 @@ const ( // the triple using the matching 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" protobuf:"bytes,1,opt,name=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" protobuf:"bytes,2,opt,name=operator,casttype=TolerationOperator"` // 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" protobuf:"bytes,3,opt,name=value"` // 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" protobuf:"bytes,4,opt,name=effect,casttype=TaintEffect"` // TODO: For forgiveness (#1574), we'd eventually add at least a grace period // here, and possibly an occurrence threshold and period. @@ -1766,6 +1981,7 @@ const ( type PodSpec struct { // List of volumes that can be mounted by containers belonging to the pod. // More info: http://kubernetes.io/docs/user-guide/volumes + // +optional Volumes []Volume `json:"volumes,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,1,rep,name=volumes"` // List of initialization containers belonging to the pod. // Init containers are executed in order prior to containers being started. If any @@ -1792,6 +2008,7 @@ type PodSpec struct { // One of Always, OnFailure, Never. // Default to Always. // More info: http://kubernetes.io/docs/user-guide/pod-states#restartpolicy + // +optional RestartPolicy RestartPolicy `json:"restartPolicy,omitempty" protobuf:"bytes,3,opt,name=restartPolicy,casttype=RestartPolicy"` // 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. @@ -1800,58 +2017,72 @@ type PodSpec struct { // 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. // Defaults to 30 seconds. + // +optional TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty" protobuf:"varint,4,opt,name=terminationGracePeriodSeconds"` // Optional duration in seconds the pod may be active on the node relative to // StartTime before the system will actively try to mark it failed and kill associated containers. // Value must be a positive integer. + // +optional ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty" protobuf:"varint,5,opt,name=activeDeadlineSeconds"` // Set DNS policy for containers within the pod. // One of 'ClusterFirst' or 'Default'. // Defaults to "ClusterFirst". + // +optional DNSPolicy DNSPolicy `json:"dnsPolicy,omitempty" protobuf:"bytes,6,opt,name=dnsPolicy,casttype=DNSPolicy"` // NodeSelector is a selector which must be true for the pod to fit on a node. // Selector which must match a node's labels for the pod to be scheduled on that node. // More info: http://kubernetes.io/docs/user-guide/node-selection/README + // +optional NodeSelector map[string]string `json:"nodeSelector,omitempty" protobuf:"bytes,7,rep,name=nodeSelector"` // ServiceAccountName is the name of the ServiceAccount to use to run this pod. // More info: http://releases.k8s.io/HEAD/docs/design/service_accounts.md + // +optional ServiceAccountName string `json:"serviceAccountName,omitempty" protobuf:"bytes,8,opt,name=serviceAccountName"` // DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. // Deprecated: Use serviceAccountName instead. // +k8s:conversion-gen=false + // +optional DeprecatedServiceAccount string `json:"serviceAccount,omitempty" protobuf:"bytes,9,opt,name=serviceAccount"` // 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" protobuf:"bytes,10,opt,name=nodeName"` // Host networking requested for this pod. Use the host's network namespace. // If this option is set, the ports that will be used must be specified. // Default to false. // +k8s:conversion-gen=false + // +optional HostNetwork bool `json:"hostNetwork,omitempty" protobuf:"varint,11,opt,name=hostNetwork"` // Use the host's pid namespace. // Optional: Default to false. // +k8s:conversion-gen=false + // +optional HostPID bool `json:"hostPID,omitempty" protobuf:"varint,12,opt,name=hostPID"` // Use the host's ipc namespace. // Optional: Default to false. // +k8s:conversion-gen=false + // +optional HostIPC bool `json:"hostIPC,omitempty" protobuf:"varint,13,opt,name=hostIPC"` // 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" protobuf:"bytes,14,opt,name=securityContext"` // 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. // More info: http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod + // +optional ImagePullSecrets []LocalObjectReference `json:"imagePullSecrets,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,15,rep,name=imagePullSecrets"` // 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" protobuf:"bytes,16,opt,name=hostname"` // If specified, the fully qualified Pod hostname will be "...svc.". // If not specified, the pod will not have a domainname at all. + // +optional Subdomain string `json:"subdomain,omitempty" protobuf:"bytes,17,opt,name=subdomain"` } @@ -1864,12 +2095,14 @@ type PodSecurityContext struct { // 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" protobuf:"bytes,1,opt,name=seLinuxOptions"` // 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" protobuf:"varint,2,opt,name=runAsUser"` // 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 @@ -1877,10 +2110,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" protobuf:"varint,3,opt,name=runAsNonRoot"` // 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" protobuf:"varint,4,rep,name=supplementalGroups"` // 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 @@ -1891,6 +2126,7 @@ 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" protobuf:"varint,5,opt,name=fsGroup"` } @@ -1899,24 +2135,31 @@ type PodSecurityContext struct { type PodStatus struct { // Current condition of the pod. // More info: http://kubernetes.io/docs/user-guide/pod-states#pod-phase + // +optional Phase PodPhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase,casttype=PodPhase"` // Current service state of pod. // More info: http://kubernetes.io/docs/user-guide/pod-states#pod-conditions + // +optional Conditions []PodCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,2,rep,name=conditions"` // A human readable message indicating details about why the pod is in this condition. + // +optional Message string `json:"message,omitempty" protobuf:"bytes,3,opt,name=message"` // A brief CamelCase message indicating details about why the pod is in this state. // e.g. 'OutOfDisk' + // +optional Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` // IP address of the host to which the pod is assigned. Empty if not yet scheduled. + // +optional HostIP string `json:"hostIP,omitempty" protobuf:"bytes,5,opt,name=hostIP"` // IP address allocated to the pod. Routable at least within the cluster. // Empty if not yet allocated. + // +optional PodIP string `json:"podIP,omitempty" protobuf:"bytes,6,opt,name=podIP"` // RFC 3339 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" protobuf:"bytes,7,opt,name=startTime"` // The list has one entry per init container in the manifest. The most recent successful @@ -1928,6 +2171,7 @@ type PodStatus struct { // The list has one entry per container in the manifest. Each entry is currently the output // of `docker inspect`. // More info: http://kubernetes.io/docs/user-guide/pod-states#container-statuses + // +optional ContainerStatuses []ContainerStatus `json:"containerStatuses,omitempty" protobuf:"bytes,8,rep,name=containerStatuses"` } @@ -1936,12 +2180,14 @@ type PodStatusResult struct { unversioned.TypeMeta `json:",inline"` // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // +optional ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Most recently observed status of the pod. // This data may not be up to date. // Populated by the system. // Read-only. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status + // +optional Status PodStatus `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"` } @@ -1953,10 +2199,12 @@ type Pod struct { unversioned.TypeMeta `json:",inline"` // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // +optional ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Specification of the desired behavior of the pod. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status + // +optional Spec PodSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // Most recently observed status of the pod. @@ -1964,6 +2212,7 @@ type Pod struct { // Populated by the system. // Read-only. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status + // +optional Status PodStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } @@ -1972,6 +2221,7 @@ type PodList 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 pods. @@ -1983,10 +2233,12 @@ type PodList struct { type PodTemplateSpec struct { // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // +optional ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Specification of the desired behavior of the pod. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status + // +optional Spec PodSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` } @@ -1997,10 +2249,12 @@ type PodTemplate struct { unversioned.TypeMeta `json:",inline"` // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // +optional ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Template defines the pods that will be created from this pod template. // http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status + // +optional Template PodTemplateSpec `json:"template,omitempty" protobuf:"bytes,2,opt,name=template"` } @@ -2009,6 +2263,7 @@ type PodTemplateList 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 pod templates @@ -2021,11 +2276,13 @@ type ReplicationControllerSpec 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 Replicas count. @@ -2033,16 +2290,19 @@ type ReplicationControllerSpec struct { // Label keys and values that must match in order to be controlled by this replication // controller, if empty defaulted to labels on Pod template. // 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"` // TemplateRef is a reference to an object that describes the pod that will be created if // insufficient replicas are detected. // Reference to an object that describes the pod that will be created if insufficient replicas are detected. + // +optional // TemplateRef *ObjectReference `json:"templateRef,omitempty"` // Template is the object that describes the pod that will be created if // insufficient replicas are detected. This takes precedence over a TemplateRef. // More info: http://kubernetes.io/docs/user-guide/replication-controller#pod-template + // +optional Template *PodTemplateSpec `json:"template,omitempty" protobuf:"bytes,3,opt,name=template"` } @@ -2054,18 +2314,23 @@ type ReplicationControllerStatus 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 replication controller. + // +optional FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty" protobuf:"varint,2,opt,name=fullyLabeledReplicas"` // The number of ready replicas for this replication controller. + // +optional ReadyReplicas int32 `json:"readyReplicas,omitempty" protobuf:"varint,4,opt,name=readyReplicas"` // The number of available replicas (ready for at least minReadySeconds) for this replication controller. + // +optional AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,5,opt,name=availableReplicas"` // ObservedGeneration reflects the generation of the most recently observed replication controller. + // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,3,opt,name=observedGeneration"` // Represents the latest available observations of a replication controller's current state. + // +optional Conditions []ReplicationControllerCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` } @@ -2086,12 +2351,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"` } @@ -2104,10 +2373,12 @@ type ReplicationController struct { // If the Labels of a ReplicationController are empty, they are defaulted to // be the same as the Pod(s) that the replication controller manages. // Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // +optional ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec defines the specification of the desired behavior of the replication controller. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status + // +optional Spec ReplicationControllerSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // Status is the most recently observed status of the replication controller. @@ -2115,6 +2386,7 @@ type ReplicationController struct { // Populated by the system. // Read-only. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status + // +optional Status ReplicationControllerStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } @@ -2123,6 +2395,7 @@ type ReplicationControllerList 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 replication controllers. @@ -2168,6 +2441,7 @@ const ( type ServiceStatus struct { // LoadBalancer contains the current status of the load-balancer, // if one is present. + // +optional LoadBalancer LoadBalancerStatus `json:"loadBalancer,omitempty" protobuf:"bytes,1,opt,name=loadBalancer"` } @@ -2175,6 +2449,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" protobuf:"bytes,1,rep,name=ingress"` } @@ -2183,10 +2458,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" protobuf:"bytes,1,opt,name=ip"` // Hostname is set for load-balancer ingress points that are DNS based // (typically AWS load-balancers) + // +optional Hostname string `json:"hostname,omitempty" protobuf:"bytes,2,opt,name=hostname"` } @@ -2202,6 +2479,7 @@ type ServiceSpec struct { // modify. Only applies to types ClusterIP, NodePort, and LoadBalancer. // Ignored if type is ExternalName. // More info: http://kubernetes.io/docs/user-guide/services#overview + // +optional Selector map[string]string `json:"selector,omitempty" protobuf:"bytes,2,rep,name=selector"` // clusterIP is the IP address of the service and is usually assigned @@ -2213,6 +2491,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" protobuf:"bytes,3,opt,name=clusterIP"` // type determines how the Service is exposed. Defaults to ClusterIP. Valid @@ -2229,6 +2508,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" protobuf:"bytes,4,opt,name=type,casttype=ServiceType"` // externalIPs is a list of IP addresses for which nodes in the cluster @@ -2238,6 +2518,7 @@ type ServiceSpec struct { // that are not part of the Kubernetes system. A previous form of this // functionality exists as the deprecatedPublicIPs field. When using this // field, callers should also clear the deprecatedPublicIPs field. + // +optional ExternalIPs []string `json:"externalIPs,omitempty" protobuf:"bytes,5,rep,name=externalIPs"` // deprecatedPublicIPs is deprecated and replaced by the externalIPs field @@ -2246,6 +2527,7 @@ type ServiceSpec struct { // any new API revisions. If both deprecatedPublicIPs *and* externalIPs are // set, deprecatedPublicIPs is used. // +k8s:conversion-gen=false + // +optional DeprecatedPublicIPs []string `json:"deprecatedPublicIPs,omitempty" protobuf:"bytes,6,rep,name=deprecatedPublicIPs"` // Supports "ClientIP" and "None". Used to maintain session affinity. @@ -2253,6 +2535,7 @@ type ServiceSpec struct { // Must be ClientIP or None. // Defaults to None. // More info: http://kubernetes.io/docs/user-guide/services#virtual-ips-and-service-proxies + // +optional SessionAffinity ServiceAffinity `json:"sessionAffinity,omitempty" protobuf:"bytes,7,opt,name=sessionAffinity,casttype=ServiceAffinity"` // Only applies to Service Type: LoadBalancer @@ -2260,17 +2543,20 @@ 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" protobuf:"bytes,8,opt,name=loadBalancerIP"` // 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." // More info: http://kubernetes.io/docs/user-guide/services-firewalls + // +optional LoadBalancerSourceRanges []string `json:"loadBalancerSourceRanges,omitempty" protobuf:"bytes,9,opt,name=loadBalancerSourceRanges"` // externalName is the external reference that kubedns or equivalent will // return as a CNAME record for this service. No proxying will be involved. // Must be a valid DNS name and requires Type to be ExternalName. + // +optional ExternalName string `json:"externalName,omitempty" protobuf:"bytes,10,opt,name=externalName"` } @@ -2280,10 +2566,12 @@ type ServicePort struct { // All ports within a ServiceSpec must have unique names. This maps to // the 'Name' field in EndpointPort objects. // Optional if only one ServicePort is defined on this service. + // +optional Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` // The IP protocol for this port. Supports "TCP" and "UDP". // Default is TCP. + // +optional Protocol Protocol `json:"protocol,omitempty" protobuf:"bytes,2,opt,name=protocol,casttype=Protocol"` // The port that will be exposed by this service. @@ -2297,6 +2585,7 @@ type ServicePort struct { // This field is ignored for services with clusterIP=None, and should be // omitted or set equal to the 'port' field. // More info: http://kubernetes.io/docs/user-guide/services#defining-a-service + // +optional TargetPort intstr.IntOrString `json:"targetPort,omitempty" protobuf:"bytes,4,opt,name=targetPort"` // The port on each node on which this service is exposed when type=NodePort or LoadBalancer. @@ -2304,6 +2593,7 @@ type ServicePort struct { // if unused or else creation of the service will fail. // Default is to auto-allocate a port if the ServiceType of this Service requires one. // More info: http://kubernetes.io/docs/user-guide/services#type--nodeport + // +optional NodePort int32 `json:"nodePort,omitempty" protobuf:"varint,5,opt,name=nodePort"` } @@ -2316,16 +2606,19 @@ type Service struct { unversioned.TypeMeta `json:",inline"` // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // +optional ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec defines the behavior of a service. // http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status + // +optional Spec ServiceSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // Most recently observed status of the service. // Populated by the system. // Read-only. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status + // +optional Status ServiceStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } @@ -2340,6 +2633,7 @@ type ServiceList 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 services @@ -2356,16 +2650,19 @@ type ServiceAccount struct { unversioned.TypeMeta `json:",inline"` // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // +optional ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Secrets is the list of secrets allowed to be used by pods running using this ServiceAccount. // More info: http://kubernetes.io/docs/user-guide/secrets + // +optional Secrets []ObjectReference `json:"secrets,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,2,rep,name=secrets"` // 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. // More info: http://kubernetes.io/docs/user-guide/secrets#manually-specifying-an-imagepullsecret + // +optional ImagePullSecrets []LocalObjectReference `json:"imagePullSecrets,omitempty" protobuf:"bytes,3,rep,name=imagePullSecrets"` } @@ -2374,6 +2671,7 @@ type ServiceAccountList 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 ServiceAccounts. @@ -2399,6 +2697,7 @@ type Endpoints struct { unversioned.TypeMeta `json:",inline"` // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // +optional ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // The set of all endpoints is the union of all subsets. Addresses are placed into @@ -2424,12 +2723,15 @@ type Endpoints struct { type EndpointSubset struct { // IP addresses which offer the related ports that are marked as ready. These endpoints // should be considered safe for load balancers and clients to utilize. + // +optional Addresses []EndpointAddress `json:"addresses,omitempty" protobuf:"bytes,1,rep,name=addresses"` // IP addresses which offer the related ports but are not currently marked as ready // because they have not yet finished starting, have recently failed a readiness check, // or have recently failed a liveness check. + // +optional NotReadyAddresses []EndpointAddress `json:"notReadyAddresses,omitempty" protobuf:"bytes,2,rep,name=notReadyAddresses"` // Port numbers available on the related IP addresses. + // +optional Ports []EndpointPort `json:"ports,omitempty" protobuf:"bytes,3,rep,name=ports"` } @@ -2443,10 +2745,13 @@ type EndpointAddress struct { // TODO: This should allow hostname or IP, See #4447. IP string `json:"ip" protobuf:"bytes,1,opt,name=ip"` // The Hostname of this endpoint + // +optional Hostname string `json:"hostname,omitempty" protobuf:"bytes,3,opt,name=hostname"` // Optional: Node hosting this endpoint. This can be used to determine endpoints local to a node. + // +optional NodeName *string `json:"nodeName,omitempty" protobuf:"bytes,4,opt,name=nodeName"` // Reference to object providing the endpoint. + // +optional TargetRef *ObjectReference `json:"targetRef,omitempty" protobuf:"bytes,2,opt,name=targetRef"` } @@ -2455,6 +2760,7 @@ type EndpointPort struct { // The name of this port (corresponds to ServicePort.Name). // Must be a DNS_LABEL. // Optional only if one port is defined. + // +optional Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` // The port number of the endpoint. @@ -2463,6 +2769,7 @@ type EndpointPort struct { // The IP protocol for this port. // Must be UDP or TCP. // Default is TCP. + // +optional Protocol Protocol `json:"protocol,omitempty" protobuf:"bytes,3,opt,name=protocol,casttype=Protocol"` } @@ -2471,6 +2778,7 @@ type EndpointsList 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 endpoints. @@ -2480,14 +2788,18 @@ type EndpointsList struct { // NodeSpec describes the attributes that a node is created with. type NodeSpec struct { // PodCIDR represents the pod IP range assigned to the node. + // +optional PodCIDR string `json:"podCIDR,omitempty" protobuf:"bytes,1,opt,name=podCIDR"` // External ID of the node assigned by some machine database (e.g. a cloud provider). // Deprecated. + // +optional ExternalID string `json:"externalID,omitempty" protobuf:"bytes,2,opt,name=externalID"` // ID of the node assigned by the cloud provider in the format: :// + // +optional ProviderID string `json:"providerID,omitempty" protobuf:"bytes,3,opt,name=providerID"` // Unschedulable controls node schedulability of new pods. By default, node is schedulable. // More info: http://releases.k8s.io/HEAD/docs/admin/node.md#manual-node-administration"` + // +optional Unschedulable bool `json:"unschedulable,omitempty" protobuf:"varint,4,opt,name=unschedulable"` } @@ -2506,6 +2818,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" protobuf:"bytes,1,opt,name=kubeletEndpoint"` } @@ -2541,31 +2854,41 @@ type NodeSystemInfo struct { type NodeStatus struct { // Capacity represents the total resources of a node. // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#capacity for more details. + // +optional Capacity ResourceList `json:"capacity,omitempty" protobuf:"bytes,1,rep,name=capacity,casttype=ResourceList,castkey=ResourceName"` // Allocatable represents the resources of a node that are available for scheduling. // Defaults to Capacity. + // +optional Allocatable ResourceList `json:"allocatable,omitempty" protobuf:"bytes,2,rep,name=allocatable,casttype=ResourceList,castkey=ResourceName"` // NodePhase is the recently observed lifecycle phase of the node. // More info: http://releases.k8s.io/HEAD/docs/admin/node.md#node-phase // The field is never populated, and now is deprecated. + // +optional Phase NodePhase `json:"phase,omitempty" protobuf:"bytes,3,opt,name=phase,casttype=NodePhase"` // Conditions is an array of current observed node conditions. // More info: http://releases.k8s.io/HEAD/docs/admin/node.md#node-condition + // +optional Conditions []NodeCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,4,rep,name=conditions"` // List of addresses reachable to the node. // Queried from cloud provider, if available. // More info: http://releases.k8s.io/HEAD/docs/admin/node.md#node-addresses + // +optional Addresses []NodeAddress `json:"addresses,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,5,rep,name=addresses"` // Endpoints of daemons running on the Node. + // +optional DaemonEndpoints NodeDaemonEndpoints `json:"daemonEndpoints,omitempty" protobuf:"bytes,6,opt,name=daemonEndpoints"` // Set of ids/uuids to uniquely identify the node. // More info: http://releases.k8s.io/HEAD/docs/admin/node.md#node-info + // +optional NodeInfo NodeSystemInfo `json:"nodeInfo,omitempty" protobuf:"bytes,7,opt,name=nodeInfo"` // List of container images on this node + // +optional Images []ContainerImage `json:"images,omitempty" protobuf:"bytes,8,rep,name=images"` // List of attachable volumes in use (mounted) by the node. + // +optional VolumesInUse []UniqueVolumeName `json:"volumesInUse,omitempty" protobuf:"bytes,9,rep,name=volumesInUse"` // List of volumes that are attached to the node. + // +optional VolumesAttached []AttachedVolume `json:"volumesAttached,omitempty" protobuf:"bytes,10,rep,name=volumesAttached"` } @@ -2586,6 +2909,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" protobuf:"bytes,1,rep,name=preferAvoidPods"` } @@ -2594,10 +2918,13 @@ type PreferAvoidPodsEntry struct { // The class of pods. PodSignature PodSignature `json:"podSignature" protobuf:"bytes,1,opt,name=podSignature"` // Time at which this entry was added to the list. + // +optional EvictionTime unversioned.Time `json:"evictionTime,omitempty" protobuf:"bytes,2,opt,name=evictionTime"` // (brief) reason why this entry was added to the list. + // +optional Reason string `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason"` // Human readable message indicating why this entry was added to the list. + // +optional Message string `json:"message,omitempty" protobuf:"bytes,4,opt,name=message"` } @@ -2605,6 +2932,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" protobuf:"bytes,1,opt,name=podController"` } @@ -2614,6 +2942,7 @@ type ContainerImage struct { // e.g. ["gcr.io/google_containers/hyperkube:v1.0.7", "dockerhub.io/google_containers/hyperkube:v1.0.7"] Names []string `json:"names" protobuf:"bytes,1,rep,name=names"` // The size of the image in bytes. + // +optional SizeBytes int64 `json:"sizeBytes,omitempty" protobuf:"varint,2,opt,name=sizeBytes"` } @@ -2655,12 +2984,16 @@ type NodeCondition struct { // Status of the condition, one of True, False, Unknown. Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=ConditionStatus"` // Last time we got an update on a given condition. + // +optional LastHeartbeatTime unversioned.Time `json:"lastHeartbeatTime,omitempty" protobuf:"bytes,3,opt,name=lastHeartbeatTime"` // 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"` } @@ -2713,16 +3046,19 @@ type Node struct { unversioned.TypeMeta `json:",inline"` // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // +optional ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec defines the behavior of a node. // http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status + // +optional Spec NodeSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // Most recently observed status of the node. // Populated by the system. // Read-only. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status + // +optional Status NodeStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } @@ -2731,6 +3067,7 @@ type NodeList 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 nodes @@ -2748,6 +3085,7 @@ const ( type NamespaceSpec struct { // Finalizers is an opaque list of values that must be empty to permanently remove object from storage. // More info: http://releases.k8s.io/HEAD/docs/design/namespaces.md#finalizers + // +optional Finalizers []FinalizerName `json:"finalizers,omitempty" protobuf:"bytes,1,rep,name=finalizers,casttype=FinalizerName"` } @@ -2755,6 +3093,7 @@ type NamespaceSpec struct { type NamespaceStatus struct { // Phase is the current lifecycle phase of the namespace. // More info: http://releases.k8s.io/HEAD/docs/design/namespaces.md#phases + // +optional Phase NamespacePhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase,casttype=NamespacePhase"` } @@ -2777,14 +3116,17 @@ type Namespace struct { unversioned.TypeMeta `json:",inline"` // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // +optional ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec defines the behavior of the Namespace. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status + // +optional Spec NamespaceSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // Status describes the current status of a Namespace. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status + // +optional Status NamespaceStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } @@ -2793,6 +3135,7 @@ type NamespaceList 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"` // Items is the list of Namespace objects in the list. @@ -2806,6 +3149,7 @@ type Binding struct { unversioned.TypeMeta `json:",inline"` // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // +optional ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // The target object that you want to bind to the standard object. @@ -2815,6 +3159,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" protobuf:"bytes,1,opt,name=uid,casttype=k8s.io/kubernetes/pkg/types.UID"` } @@ -2826,14 +3171,17 @@ type DeleteOptions struct { // The value zero indicates delete immediately. If this value is nil, the default grace period for the // specified type will be used. // Defaults to a per object value if not specified. zero means delete immediately. + // +optional GracePeriodSeconds *int64 `json:"gracePeriodSeconds,omitempty" protobuf:"varint,1,opt,name=gracePeriodSeconds"` // 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" protobuf:"bytes,2,opt,name=preconditions"` // 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" protobuf:"varint,3,opt,name=orphanDependents"` } @@ -2853,17 +3201,22 @@ type ListOptions struct { // A selector to restrict the list of returned objects by their labels. // Defaults to everything. + // +optional LabelSelector string `json:"labelSelector,omitempty" protobuf:"bytes,1,opt,name=labelSelector"` // A selector to restrict the list of returned objects by their fields. // Defaults to everything. + // +optional FieldSelector string `json:"fieldSelector,omitempty" protobuf:"bytes,2,opt,name=fieldSelector"` // Watch for changes to the described resources and return them as a stream of // add, update, and remove notifications. Specify resourceVersion. + // +optional Watch bool `json:"watch,omitempty" protobuf:"varint,3,opt,name=watch"` // When specified with a watch call, shows changes that occur after that particular version of a resource. // Defaults to changes from the beginning of history. + // +optional ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,4,opt,name=resourceVersion"` // Timeout for the list/watch call. + // +optional TimeoutSeconds *int64 `json:"timeoutSeconds,omitempty" protobuf:"varint,5,opt,name=timeoutSeconds"` } @@ -2872,30 +3225,38 @@ type PodLogOptions struct { unversioned.TypeMeta `json:",inline"` // The container for which to stream logs. Defaults to only container if there is one container in the pod. + // +optional Container string `json:"container,omitempty" protobuf:"bytes,1,opt,name=container"` // Follow the log stream of the pod. Defaults to false. + // +optional Follow bool `json:"follow,omitempty" protobuf:"varint,2,opt,name=follow"` // Return previous terminated container logs. Defaults to false. + // +optional Previous bool `json:"previous,omitempty" protobuf:"varint,3,opt,name=previous"` // A relative time in seconds before the current time from which to show logs. If this value // precedes the time a pod was started, only logs since the pod start will be returned. // If this value is in the future, no logs will be returned. // Only one of sinceSeconds or sinceTime may be specified. + // +optional SinceSeconds *int64 `json:"sinceSeconds,omitempty" protobuf:"varint,4,opt,name=sinceSeconds"` // An RFC3339 timestamp from which to show logs. If this value // precedes the time a pod was started, only logs since the pod start will be returned. // If this value is in the future, no logs will be returned. // Only one of sinceSeconds or sinceTime may be specified. + // +optional SinceTime *unversioned.Time `json:"sinceTime,omitempty" protobuf:"bytes,5,opt,name=sinceTime"` // If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line // of log output. Defaults to false. + // +optional Timestamps bool `json:"timestamps,omitempty" protobuf:"varint,6,opt,name=timestamps"` // If set, the number of lines from the end of the logs to show. If not specified, // logs are shown from the creation of the container or sinceSeconds or sinceTime + // +optional TailLines *int64 `json:"tailLines,omitempty" protobuf:"varint,7,opt,name=tailLines"` // If set, the number of bytes to read from the server before terminating the // log output. This may not display a complete final line of logging, and may return // slightly more or slightly less than the specified limit. + // +optional LimitBytes *int64 `json:"limitBytes,omitempty" protobuf:"varint,8,opt,name=limitBytes"` } @@ -2908,24 +3269,29 @@ type PodAttachOptions struct { // Stdin if true, redirects the standard input stream of the pod for this call. // Defaults to false. + // +optional Stdin bool `json:"stdin,omitempty" protobuf:"varint,1,opt,name=stdin"` // Stdout if true indicates that stdout is to be redirected for the attach call. // Defaults to true. + // +optional Stdout bool `json:"stdout,omitempty" protobuf:"varint,2,opt,name=stdout"` // Stderr if true indicates that stderr is to be redirected for the attach call. // Defaults to true. + // +optional Stderr bool `json:"stderr,omitempty" protobuf:"varint,3,opt,name=stderr"` // TTY if true indicates that a tty will be allocated for the attach call. // This is passed through the container runtime so the tty // is allocated on the worker node by the container runtime. // Defaults to false. + // +optional TTY bool `json:"tty,omitempty" protobuf:"varint,4,opt,name=tty"` // The container in which to execute the command. // Defaults to only container if there is only one container in the pod. + // +optional Container string `json:"container,omitempty" protobuf:"bytes,5,opt,name=container"` } @@ -2938,22 +3304,27 @@ type PodExecOptions struct { // Redirect the standard input stream of the pod for this call. // Defaults to false. + // +optional Stdin bool `json:"stdin,omitempty" protobuf:"varint,1,opt,name=stdin"` // Redirect the standard output stream of the pod for this call. // Defaults to true. + // +optional Stdout bool `json:"stdout,omitempty" protobuf:"varint,2,opt,name=stdout"` // Redirect the standard error stream of the pod for this call. // Defaults to true. + // +optional Stderr bool `json:"stderr,omitempty" protobuf:"varint,3,opt,name=stderr"` // TTY if true indicates that a tty will be allocated for the exec call. // Defaults to false. + // +optional TTY bool `json:"tty,omitempty" protobuf:"varint,4,opt,name=tty"` // Container in which to execute the command. // Defaults to only container if there is only one container in the pod. + // +optional Container string `json:"container,omitempty" protobuf:"bytes,5,opt,name=container"` // Command is the remote command to execute. argv array. Not executed within a shell. @@ -2965,6 +3336,7 @@ type PodProxyOptions struct { unversioned.TypeMeta `json:",inline"` // Path is the URL path to use for the current proxy request to pod. + // +optional Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"` } @@ -2973,6 +3345,7 @@ type NodeProxyOptions struct { unversioned.TypeMeta `json:",inline"` // Path is the URL path to use for the current proxy request to node. + // +optional Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"` } @@ -2985,6 +3358,7 @@ type ServiceProxyOptions struct { // For example, the whole request URL is // http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. // Path is _search?q=user:kimchy. + // +optional Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"` } @@ -3004,6 +3378,7 @@ type OwnerReference struct { // More info: http://kubernetes.io/docs/user-guide/identifiers#uids UID types.UID `json:"uid" protobuf:"bytes,4,opt,name=uid,casttype=k8s.io/kubernetes/pkg/types.UID"` // If true, this reference points to the managing controller. + // +optional Controller *bool `json:"controller,omitempty" protobuf:"varint,6,opt,name=controller"` } @@ -3011,20 +3386,26 @@ type OwnerReference struct { type ObjectReference 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"` // Namespace of the referent. // More info: http://kubernetes.io/docs/user-guide/namespaces + // +optional Namespace string `json:"namespace,omitempty" protobuf:"bytes,2,opt,name=namespace"` // Name of the referent. // More info: http://kubernetes.io/docs/user-guide/identifiers#names + // +optional Name string `json:"name,omitempty" protobuf:"bytes,3,opt,name=name"` // UID of the referent. // More info: http://kubernetes.io/docs/user-guide/identifiers#uids + // +optional UID types.UID `json:"uid,omitempty" protobuf:"bytes,4,opt,name=uid,casttype=k8s.io/kubernetes/pkg/types.UID"` // API version of the referent. + // +optional APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,5,opt,name=apiVersion"` // Specific resourceVersion to which this reference is made, if any. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#concurrency-control-and-consistency + // +optional ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,6,opt,name=resourceVersion"` // If referring to a piece of an object instead of an entire object, this string @@ -3035,6 +3416,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" protobuf:"bytes,7,opt,name=fieldPath"` } @@ -3044,6 +3426,7 @@ type LocalObjectReference struct { // Name of the referent. // More info: http://kubernetes.io/docs/user-guide/identifiers#names // TODO: Add other useful fields. apiVersion, kind, uid? + // +optional Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` } @@ -3051,14 +3434,17 @@ type LocalObjectReference struct { type SerializedReference struct { unversioned.TypeMeta `json:",inline"` // The reference to an object in the system. + // +optional Reference ObjectReference `json:"reference,omitempty" protobuf:"bytes,1,opt,name=reference"` } // EventSource contains information for an event. type EventSource struct { // Component from which the event is generated. + // +optional Component string `json:"component,omitempty" protobuf:"bytes,1,opt,name=component"` // Node name on which the event is generated. + // +optional Host string `json:"host,omitempty" protobuf:"bytes,2,opt,name=host"` } @@ -3086,25 +3472,32 @@ type Event struct { // This should be a short, machine understandable string that gives the reason // for the transition into the object's current status. // TODO: provide exact specification for format. + // +optional Reason string `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason"` // A human-readable description of the status of this operation. // TODO: decide on maximum length. + // +optional Message string `json:"message,omitempty" protobuf:"bytes,4,opt,name=message"` // The component reporting this event. Should be a short machine understandable string. + // +optional Source EventSource `json:"source,omitempty" protobuf:"bytes,5,opt,name=source"` // The time at which the event was first recorded. (Time of server receipt is in TypeMeta.) + // +optional FirstTimestamp unversioned.Time `json:"firstTimestamp,omitempty" protobuf:"bytes,6,opt,name=firstTimestamp"` // The time at which the most recent occurrence of this event was recorded. + // +optional LastTimestamp unversioned.Time `json:"lastTimestamp,omitempty" protobuf:"bytes,7,opt,name=lastTimestamp"` // The number of times this event has occurred. + // +optional Count int32 `json:"count,omitempty" protobuf:"varint,8,opt,name=count"` // Type of this event (Normal, Warning), new types could be added in the future + // +optional Type string `json:"type,omitempty" protobuf:"bytes,9,opt,name=type"` } @@ -3113,6 +3506,7 @@ type EventList 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 events @@ -3124,6 +3518,7 @@ type List 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 objects @@ -3145,16 +3540,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" protobuf:"bytes,1,opt,name=type,casttype=LimitType"` // Max usage constraints on this kind by resource name. + // +optional Max ResourceList `json:"max,omitempty" protobuf:"bytes,2,rep,name=max,casttype=ResourceList,castkey=ResourceName"` // Min usage constraints on this kind by resource name. + // +optional Min ResourceList `json:"min,omitempty" protobuf:"bytes,3,rep,name=min,casttype=ResourceList,castkey=ResourceName"` // Default resource requirement limit value by resource name if resource limit is omitted. + // +optional Default ResourceList `json:"default,omitempty" protobuf:"bytes,4,rep,name=default,casttype=ResourceList,castkey=ResourceName"` // DefaultRequest is the default resource requirement request value by resource name if resource request is omitted. + // +optional DefaultRequest ResourceList `json:"defaultRequest,omitempty" protobuf:"bytes,5,rep,name=defaultRequest,casttype=ResourceList,castkey=ResourceName"` // MaxLimitRequestRatio if specified, the named resource must have a request and limit that are both non-zero where limit divided by request is less than or equal to the enumerated value; this represents the max burst for the named resource. + // +optional MaxLimitRequestRatio ResourceList `json:"maxLimitRequestRatio,omitempty" protobuf:"bytes,6,rep,name=maxLimitRequestRatio,casttype=ResourceList,castkey=ResourceName"` } @@ -3171,10 +3572,12 @@ type LimitRange struct { unversioned.TypeMeta `json:",inline"` // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // +optional ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec defines the limits enforced. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status + // +optional Spec LimitRangeSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` } @@ -3183,6 +3586,7 @@ type LimitRangeList 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"` // Items is a list of LimitRange objects. @@ -3240,9 +3644,11 @@ const ( type ResourceQuotaSpec struct { // Hard is the set of desired hard limits for each named resource. // More info: http://releases.k8s.io/HEAD/docs/design/admission_control_resource_quota.md#admissioncontrol-plugin-resourcequota + // +optional Hard ResourceList `json:"hard,omitempty" protobuf:"bytes,1,rep,name=hard,casttype=ResourceList,castkey=ResourceName"` // 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" protobuf:"bytes,2,rep,name=scopes,casttype=ResourceQuotaScope"` } @@ -3250,8 +3656,10 @@ type ResourceQuotaSpec struct { type ResourceQuotaStatus struct { // Hard is the set of enforced hard limits for each named resource. // More info: http://releases.k8s.io/HEAD/docs/design/admission_control_resource_quota.md#admissioncontrol-plugin-resourcequota + // +optional Hard ResourceList `json:"hard,omitempty" protobuf:"bytes,1,rep,name=hard,casttype=ResourceList,castkey=ResourceName"` // Used is the current observed total usage of the resource in the namespace. + // +optional Used ResourceList `json:"used,omitempty" protobuf:"bytes,2,rep,name=used,casttype=ResourceList,castkey=ResourceName"` } @@ -3262,14 +3670,17 @@ type ResourceQuota struct { unversioned.TypeMeta `json:",inline"` // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // +optional ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec defines the desired quota. // http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status + // +optional Spec ResourceQuotaSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // Status defines the actual enforced quota and its current usage. // http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status + // +optional Status ResourceQuotaStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } @@ -3278,6 +3689,7 @@ type ResourceQuotaList 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"` // Items is a list of ResourceQuota objects. @@ -3293,6 +3705,7 @@ type Secret struct { unversioned.TypeMeta `json:",inline"` // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // +optional ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Data contains the secret data. Each key must be a valid DNS_SUBDOMAIN @@ -3300,6 +3713,7 @@ type Secret struct { // The serialized form of the secret data is a base64 encoded string, // representing the arbitrary (possibly non-string) data value here. // Described in https://tools.ietf.org/html/rfc4648#section-4 + // +optional Data map[string][]byte `json:"data,omitempty" protobuf:"bytes,2,rep,name=data"` // stringData allows specifying non-binary secret data in string form. @@ -3307,9 +3721,11 @@ type Secret struct { // All keys and values are merged into the data field on write, overwriting any existing values. // It is never output when reading from the API. // +k8s:conversion-gen=false + // +optional StringData map[string]string `json:"stringData,omitempty" protobuf:"bytes,4,rep,name=stringData"` // Used to facilitate programmatic handling of secret data. + // +optional Type SecretType `json:"type,omitempty" protobuf:"bytes,3,opt,name=type,casttype=SecretType"` } @@ -3372,6 +3788,7 @@ type SecretList 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"` // Items is a list of secret objects. @@ -3386,10 +3803,12 @@ type ConfigMap struct { unversioned.TypeMeta `json:",inline"` // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // +optional ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // 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" protobuf:"bytes,2,rep,name=data"` } @@ -3398,6 +3817,7 @@ type ConfigMapList struct { unversioned.TypeMeta `json:",inline"` // 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 ConfigMaps. @@ -3422,9 +3842,11 @@ type ComponentCondition struct { Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=ConditionStatus"` // Message about the condition for a component. // For example, information about a health check. + // +optional Message string `json:"message,omitempty" protobuf:"bytes,3,opt,name=message"` // Condition error code for a component. // For example, a health check error code. + // +optional Error string `json:"error,omitempty" protobuf:"bytes,4,opt,name=error"` } @@ -3436,9 +3858,11 @@ type ComponentStatus struct { unversioned.TypeMeta `json:",inline"` // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // +optional ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // List of component conditions observed + // +optional Conditions []ComponentCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,2,rep,name=conditions"` } @@ -3447,6 +3871,7 @@ type ComponentStatusList 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 ComponentStatus objects. @@ -3457,12 +3882,14 @@ type ComponentStatusList struct { // Downward API volumes support ownership management and SELinux relabeling. type DownwardAPIVolumeSource struct { // Items is a list of downward API volume file + // +optional Items []DownwardAPIVolumeFile `json:"items,omitempty" protobuf:"bytes,1,rep,name=items"` // Optional: mode bits to use on created files by default. Must be a // value between 0 and 0777. Defaults to 0644. // 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" protobuf:"varint,2,opt,name=defaultMode"` } @@ -3475,14 +3902,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" protobuf:"bytes,1,opt,name=path"` // Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. + // +optional FieldRef *ObjectFieldSelector `json:"fieldRef,omitempty" protobuf:"bytes,2,opt,name=fieldRef"` // 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" protobuf:"bytes,3,opt,name=resourceFieldRef"` // 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" protobuf:"varint,4,opt,name=mode"` } @@ -3492,20 +3922,24 @@ type DownwardAPIVolumeFile 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" protobuf:"bytes,1,opt,name=capabilities"` // 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" protobuf:"varint,2,opt,name=privileged"` // 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" protobuf:"bytes,3,opt,name=seLinuxOptions"` // 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" protobuf:"varint,4,opt,name=runAsUser"` // 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 @@ -3513,21 +3947,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" protobuf:"varint,5,opt,name=runAsNonRoot"` // Whether this container has a read-only root filesystem. // Default is false. + // +optional ReadOnlyRootFilesystem *bool `json:"readOnlyRootFilesystem,omitempty" protobuf:"varint,6,opt,name=readOnlyRootFilesystem"` } // SELinuxOptions are the labels to be applied to the container type SELinuxOptions struct { // User is a SELinux user label that applies to the container. + // +optional User string `json:"user,omitempty" protobuf:"bytes,1,opt,name=user"` // Role is a SELinux role label that applies to the container. + // +optional Role string `json:"role,omitempty" protobuf:"bytes,2,opt,name=role"` // Type is a SELinux type label that applies to the container. + // +optional Type string `json:"type,omitempty" protobuf:"bytes,3,opt,name=type"` // Level is SELinux level label that applies to the container. + // +optional Level string `json:"level,omitempty" protobuf:"bytes,4,opt,name=level"` } @@ -3536,6 +3976,7 @@ type RangeAllocation struct { unversioned.TypeMeta `json:",inline"` // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // +optional ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Range is string that identifies the range represented by 'data'. diff --git a/pkg/apis/abac/v0/types.go b/pkg/apis/abac/v0/types.go index d4ebe085eb7..d56ac3d9955 100644 --- a/pkg/apis/abac/v0/types.go +++ b/pkg/apis/abac/v0/types.go @@ -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"` } diff --git a/pkg/apis/abac/v1beta1/types.go b/pkg/apis/abac/v1beta1/types.go index c589bf4d604..93cb8cd049f 100644 --- a/pkg/apis/abac/v1beta1/types.go +++ b/pkg/apis/abac/v1beta1/types.go @@ -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"` } diff --git a/pkg/apis/apps/types.go b/pkg/apis/apps/types.go index 466273bf7fd..223d480cd2b 100644 --- a/pkg/apis/apps/types.go +++ b/pkg/apis/apps/types.go @@ -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"` } diff --git a/pkg/apis/apps/v1alpha1/types.go b/pkg/apis/apps/v1alpha1/types.go index 6c6d42faa33..d4bd62ce75a 100644 --- a/pkg/apis/apps/v1alpha1/types.go +++ b/pkg/apis/apps/v1alpha1/types.go @@ -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"` } diff --git a/pkg/apis/authentication/v1beta1/types.go b/pkg/apis/authentication/v1beta1/types.go index fadd637abfd..3cab98f7a8e 100644 --- a/pkg/apis/authentication/v1beta1/types.go +++ b/pkg/apis/authentication/v1beta1/types.go @@ -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"` } diff --git a/pkg/apis/authorization/v1beta1/types.go b/pkg/apis/authorization/v1beta1/types.go index 67a23eec554..dccc6cc5aa5 100644 --- a/pkg/apis/authorization/v1beta1/types.go +++ b/pkg/apis/authorization/v1beta1/types.go @@ -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"` } diff --git a/pkg/apis/autoscaling/types.go b/pkg/apis/autoscaling/types.go index 0ec8a482925..94cd54cb1a0 100644 --- a/pkg/apis/autoscaling/types.go +++ b/pkg/apis/autoscaling/types.go @@ -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. diff --git a/pkg/apis/autoscaling/v1/types.go b/pkg/apis/autoscaling/v1/types.go index 6b50395761b..a47891c1b0c 100644 --- a/pkg/apis/autoscaling/v1/types.go +++ b/pkg/apis/autoscaling/v1/types.go @@ -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"` } diff --git a/pkg/apis/batch/types.go b/pkg/apis/batch/types.go index 7db3057bebc..79ac71960d4 100644 --- a/pkg/apis/batch/types.go +++ b/pkg/apis/batch/types.go @@ -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"` } diff --git a/pkg/apis/batch/v1/types.go b/pkg/apis/batch/v1/types.go index 34b8c3d7b41..9049c7ffd2e 100644 --- a/pkg/apis/batch/v1/types.go +++ b/pkg/apis/batch/v1/types.go @@ -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"` } diff --git a/pkg/apis/batch/v2alpha1/types.go b/pkg/apis/batch/v2alpha1/types.go index d5f5583a4cf..83032deb3c6 100644 --- a/pkg/apis/batch/v2alpha1/types.go +++ b/pkg/apis/batch/v2alpha1/types.go @@ -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"` } diff --git a/pkg/apis/certificates/types.go b/pkg/apis/certificates/types.go index 562725f9989..e589ce74d74 100644 --- a/pkg/apis/certificates/types.go +++ b/pkg/apis/certificates/types.go @@ -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"` } diff --git a/pkg/apis/certificates/v1alpha1/types.go b/pkg/apis/certificates/v1alpha1/types.go index 859053da2f9..54de065ae5c 100644 --- a/pkg/apis/certificates/v1alpha1/types.go +++ b/pkg/apis/certificates/v1alpha1/types.go @@ -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"` diff --git a/pkg/apis/componentconfig/types.go b/pkg/apis/componentconfig/types.go index 7f640499e8b..83fd27ac897 100644 --- a/pkg/apis/componentconfig/types.go +++ b/pkg/apis/componentconfig/types.go @@ -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"` } diff --git a/pkg/apis/componentconfig/v1alpha1/types.go b/pkg/apis/componentconfig/v1alpha1/types.go index 4538fdf427f..c2353de6f56 100644 --- a/pkg/apis/componentconfig/v1alpha1/types.go +++ b/pkg/apis/componentconfig/v1alpha1/types.go @@ -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"` } diff --git a/pkg/apis/extensions/types.go b/pkg/apis/extensions/types.go index 403331c10ba..9b2e211d651 100644 --- a/pkg/apis/extensions/types.go +++ b/pkg/apis/extensions/types.go @@ -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"` + // 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. - UniqueLabelKey string `json:"uniqueLabelKey,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"` diff --git a/pkg/apis/extensions/v1beta1/types.go b/pkg/apis/extensions/v1beta1/types.go index da649032b69..608d3efbf21 100644 --- a/pkg/apis/extensions/v1beta1/types.go +++ b/pkg/apis/extensions/v1beta1/types.go @@ -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"` + // 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. - UniqueLabelKey *string `json:"uniqueLabelKey,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. diff --git a/pkg/apis/imagepolicy/v1alpha1/types.go b/pkg/apis/imagepolicy/v1alpha1/types.go index ef9fc544d34..e62d874e5d6 100644 --- a/pkg/apis/imagepolicy/v1alpha1/types.go +++ b/pkg/apis/imagepolicy/v1alpha1/types.go @@ -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"` } diff --git a/pkg/apis/policy/types.go b/pkg/apis/policy/types.go index 5b76f7ef603..78372436995 100644 --- a/pkg/apis/policy/types.go +++ b/pkg/apis/policy/types.go @@ -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"` } diff --git a/pkg/apis/policy/v1alpha1/types.go b/pkg/apis/policy/v1alpha1/types.go index 8a3bd7d60c9..0076f1feedc 100644 --- a/pkg/apis/policy/v1alpha1/types.go +++ b/pkg/apis/policy/v1alpha1/types.go @@ -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"` } diff --git a/pkg/apis/rbac/v1alpha1/types.go b/pkg/apis/rbac/v1alpha1/types.go index 7223d885534..42617aca61f 100644 --- a/pkg/apis/rbac/v1alpha1/types.go +++ b/pkg/apis/rbac/v1alpha1/types.go @@ -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 diff --git a/pkg/apis/storage/types.go b/pkg/apis/storage/types.go index be0831a6bf7..1e4baae59e3 100644 --- a/pkg/apis/storage/types.go +++ b/pkg/apis/storage/types.go @@ -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 diff --git a/pkg/apis/storage/v1beta1/types.go b/pkg/apis/storage/v1beta1/types.go index a0c4a6d6edf..f36d9319e56 100644 --- a/pkg/apis/storage/v1beta1/types.go +++ b/pkg/apis/storage/v1beta1/types.go @@ -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 diff --git a/pkg/apiserver/testing/types.go b/pkg/apiserver/testing/types.go index 096846c3ab4..2c7ccd8f271 100644 --- a/pkg/apiserver/testing/types.go +++ b/pkg/apiserver/testing/types.go @@ -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 } diff --git a/pkg/apiserver/validator.go b/pkg/apiserver/validator.go index fb5c8e4592b..d5f3cdb113e 100644 --- a/pkg/apiserver/validator.go +++ b/pkg/apiserver/validator.go @@ -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) { diff --git a/pkg/client/unversioned/clientcmd/api/types.go b/pkg/client/unversioned/clientcmd/api/types.go index 9fd52e44c86..c7ddec88739 100644 --- a/pkg/client/unversioned/clientcmd/api/types.go +++ b/pkg/client/unversioned/clientcmd/api/types.go @@ -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"` } diff --git a/pkg/client/unversioned/clientcmd/api/v1/types.go b/pkg/client/unversioned/clientcmd/api/v1/types.go index bcb82aa9829..035fbdf76c5 100644 --- a/pkg/client/unversioned/clientcmd/api/v1/types.go +++ b/pkg/client/unversioned/clientcmd/api/v1/types.go @@ -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"` } diff --git a/pkg/controller/garbagecollector/metaonly/types.go b/pkg/controller/garbagecollector/metaonly/types.go index a07f389f2cf..6b42e2e058e 100644 --- a/pkg/controller/garbagecollector/metaonly/types.go +++ b/pkg/controller/garbagecollector/metaonly/types.go @@ -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"` diff --git a/pkg/credentialprovider/config.go b/pkg/credentialprovider/config.go index ca0d8b13220..40bf0ce8447 100644 --- a/pkg/credentialprovider/config.go +++ b/pkg/credentialprovider/config.go @@ -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 { diff --git a/pkg/kubectl/testing/types.go b/pkg/kubectl/testing/types.go index 740b777ebb9..6a59e7b30c9 100644 --- a/pkg/kubectl/testing/types.go +++ b/pkg/kubectl/testing/types.go @@ -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 } diff --git a/pkg/kubelet/api/v1alpha1/stats/types.go b/pkg/kubelet/api/v1alpha1/stats/types.go index aa283666463..b65c36928c6 100644 --- a/pkg/kubelet/api/v1alpha1/stats/types.go +++ b/pkg/kubelet/api/v1alpha1/stats/types.go @@ -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"` } diff --git a/pkg/kubelet/server/stats/handler.go b/pkg/kubelet/server/stats/handler.go index 3102d03d455..8a32da664c5 100644 --- a/pkg/kubelet/server/stats/handler.go +++ b/pkg/kubelet/server/stats/handler.go @@ -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"` } diff --git a/pkg/registry/extensions/thirdpartyresourcedata/codec.go b/pkg/registry/extensions/thirdpartyresourcedata/codec.go index 29b416b9ab8..061e350250d 100644 --- a/pkg/registry/extensions/thirdpartyresourcedata/codec.go +++ b/pkg/registry/extensions/thirdpartyresourcedata/codec.go @@ -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, diff --git a/pkg/runtime/serializer/json/meta.go b/pkg/runtime/serializer/json/meta.go index b9bea21eb9e..08193541213 100644 --- a/pkg/runtime/serializer/json/meta.go +++ b/pkg/runtime/serializer/json/meta.go @@ -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) diff --git a/pkg/runtime/types.go b/pkg/runtime/types.go index 2ac265ccd70..ceffdd9f774 100644 --- a/pkg/runtime/types.go +++ b/pkg/runtime/types.go @@ -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 ( diff --git a/pkg/storage/interfaces.go b/pkg/storage/interfaces.go index 71c4bcf94ff..b540574d517 100644 --- a/pkg/storage/interfaces.go +++ b/pkg/storage/interfaces.go @@ -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"` } diff --git a/pkg/watch/json/types.go b/pkg/watch/json/types.go index b1e966b02ca..bccdb426937 100644 --- a/pkg/watch/json/types.go +++ b/pkg/watch/json/types.go @@ -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"` }