From d5afb71cf45b21ff7a9bd8faf325870b54510e64 Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Thu, 8 Dec 2016 21:42:37 -0500 Subject: [PATCH] Remove json serialization annotations from internal types --- cmd/kubeadm/app/apis/kubeadm/types.go | 4 +- .../client-gen/test_apis/testgroup/types.go | 12 +- federation/apis/federation/types.go | 48 +- pkg/api/types.go | 1156 ++++++++--------- pkg/apis/apps/types.go | 28 +- pkg/apis/autoscaling/types.go | 52 +- pkg/apis/batch/types.go | 88 +- pkg/apis/certificates/types.go | 34 +- pkg/apis/componentconfig/types.go | 466 +++---- pkg/apis/extensions/types.go | 346 ++--- pkg/apis/policy/types.go | 36 +- pkg/apis/storage/types.go | 14 +- plugin/pkg/scheduler/api/types.go | 66 +- 13 files changed, 1175 insertions(+), 1175 deletions(-) diff --git a/cmd/kubeadm/app/apis/kubeadm/types.go b/cmd/kubeadm/app/apis/kubeadm/types.go index eeef3a4e625..14586a82146 100644 --- a/cmd/kubeadm/app/apis/kubeadm/types.go +++ b/cmd/kubeadm/app/apis/kubeadm/types.go @@ -86,6 +86,6 @@ type NodeConfiguration struct { type ClusterInfo struct { metav1.TypeMeta // TODO(phase1+) this may become simply `api.Config` - CertificateAuthorities []string `json:"certificateAuthorities"` - Endpoints []string `json:"endpoints"` + CertificateAuthorities []string + Endpoints []string } diff --git a/cmd/libs/go2idl/client-gen/test_apis/testgroup/types.go b/cmd/libs/go2idl/client-gen/test_apis/testgroup/types.go index 9b1fe41b7c6..7df04bbff4d 100644 --- a/cmd/libs/go2idl/client-gen/test_apis/testgroup/types.go +++ b/cmd/libs/go2idl/client-gen/test_apis/testgroup/types.go @@ -24,16 +24,16 @@ import ( // +genclient=true type TestType struct { - metav1.TypeMeta `json:",inline"` - api.ObjectMeta `json:"metadata,omitempty"` - Status TestTypeStatus `json:"status,omitempty"` + metav1.TypeMeta + api.ObjectMeta + Status TestTypeStatus } type TestTypeList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` + metav1.TypeMeta + metav1.ListMeta - Items []TestType `json:"items"` + Items []TestType } type TestTypeStatus struct { diff --git a/federation/apis/federation/types.go b/federation/apis/federation/types.go index 799a39f4617..218f8e60b91 100644 --- a/federation/apis/federation/types.go +++ b/federation/apis/federation/types.go @@ -24,10 +24,10 @@ import ( // ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match. type ServerAddressByClientCIDR struct { // The CIDR with which clients can match their IP to figure out the server address that they should use. - ClientCIDR string `json:"clientCIDR" protobuf:"bytes,1,opt,name=clientCIDR"` + ClientCIDR string // Address of this server, suitable for a client that matches the above CIDR. // This can be a hostname, hostname:port, IP or IP:port. - ServerAddress string `json:"serverAddress" protobuf:"bytes,2,opt,name=serverAddress"` + ServerAddress string } // ClusterSpec describes the attributes of a kubernetes cluster. @@ -36,14 +36,14 @@ type ClusterSpec struct { // This is to help clients reach servers in the most network-efficient way possible. // Clients can use the appropriate server address as per the CIDR that they match. // In case of multiple matches, clients should use the longest matching CIDR. - ServerAddressByClientCIDRs []ServerAddressByClientCIDR `json:"serverAddressByClientCIDRs" patchStrategy:"merge" patchMergeKey:"clientCIDR"` + ServerAddressByClientCIDRs []ServerAddressByClientCIDR // Name of the secret containing kubeconfig to access this cluster. // The secret is read from the kubernetes cluster that is hosting federation control plane. // 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"` + SecretRef *api.LocalObjectReference } type ClusterConditionType string @@ -59,35 +59,35 @@ const ( // ClusterCondition describes current state of a cluster. type ClusterCondition struct { // Type of cluster condition, Complete or Failed. - Type ClusterConditionType `json:"type"` + Type ClusterConditionType // Status of the condition, one of True, False, Unknown. - Status api.ConditionStatus `json:"status"` + Status api.ConditionStatus // Last time the condition was checked. // +optional - LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"` + LastProbeTime metav1.Time // Last time the condition transit from one status to another. // +optional - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` + LastTransitionTime metav1.Time // (brief) reason for the condition's last transition. // +optional - Reason string `json:"reason,omitempty"` + Reason string // Human readable message indicating details about last transition. // +optional - Message string `json:"message,omitempty"` + Message string } // 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"` + Conditions []ClusterCondition // 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"` + Zones []string // 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"` + Region string } // +genclient=true @@ -95,30 +95,30 @@ type ClusterStatus struct { // Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation. type Cluster struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // +optional - api.ObjectMeta `json:"metadata,omitempty"` + api.ObjectMeta // Spec defines the behavior of the Cluster. // +optional - Spec ClusterSpec `json:"spec,omitempty"` + Spec ClusterSpec // Status describes the current status of a Cluster // +optional - Status ClusterStatus `json:"status,omitempty"` + Status ClusterStatus } // A list of all the kubernetes clusters registered to the federation type ClusterList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // Standard list metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta // List of Cluster objects. - Items []Cluster `json:"items"` + Items []Cluster } // Temporary/alpha structures to support custom replica assignments within FederatedReplicaSet. @@ -131,24 +131,24 @@ type FederatedReplicaSetPreferences struct { // 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"` + Rebalance bool // A mapping between cluster names and preferences regarding local ReplicaSet 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"` + Clusters map[string]ClusterReplicaSetPreferences } // 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"` + MinReplicas int64 // Maximum number of replicas that should be assigned to this Local ReplicaSet. Unbounded if no value provided (default). // +optional - MaxReplicas *int64 `json:"maxReplicas,omitempty"` + MaxReplicas *int64 // A number expressing the preference to put an additional replica to this LocalReplicaSet. 0 by default. Weight int64 diff --git a/pkg/api/types.go b/pkg/api/types.go index b826e0cc7e2..04419d1dc77 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -63,7 +63,7 @@ type ObjectMeta struct { // automatically. Name is primarily intended for creation idempotence and configuration // definition. // +optional - Name string `json:"name,omitempty"` + Name string // GenerateName indicates that the name should be made unique by the server prior to persisting // it. A non-empty value for the field indicates the name will be made unique (and the name @@ -77,42 +77,42 @@ type ObjectMeta struct { // 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"` + GenerateName string // 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"` + Namespace string // SelfLink is a URL representing this object. // +optional - SelfLink string `json:"selfLink,omitempty"` + SelfLink string // 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"` + UID types.UID // 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"` + ResourceVersion string // A sequence number representing a specific generation of the desired state. // Populated by the system. Read-only. // +optional - Generation int64 `json:"generation,omitempty"` + Generation int64 // 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 metav1.Time `json:"creationTimestamp,omitempty"` + CreationTimestamp metav1.Time // DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This // field is set by the server when a graceful deletion is requested by the user, and is not @@ -132,12 +132,12 @@ type ObjectMeta struct { // Read-only. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // +optional - DeletionTimestamp *metav1.Time `json:"deletionTimestamp,omitempty"` + DeletionTimestamp *metav1.Time // 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"` + DeletionGracePeriodSeconds *int64 // Labels are key value pairs that may be used to scope and select individual resources. // Label keys are of the form: @@ -149,34 +149,34 @@ type ObjectMeta struct { // 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"` + Labels map[string]string // 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"` + Annotations map[string]string // 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"` + OwnerReferences []OwnerReference // 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"` + Finalizers []string // 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"` + ClusterName string } const ( @@ -196,12 +196,12 @@ const ( type Volume struct { // Required: This must be a DNS_LABEL. Each volume in a pod must have // a unique name. - Name string `json:"name"` + Name string // 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"` + VolumeSource } // VolumeSource represents the source location of a volume to mount. @@ -215,82 +215,82 @@ 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"` + HostPath *HostPathVolumeSource // EmptyDir represents a temporary directory that shares a pod's lifetime. // +optional - EmptyDir *EmptyDirVolumeSource `json:"emptyDir,omitempty"` + EmptyDir *EmptyDirVolumeSource // 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"` + GCEPersistentDisk *GCEPersistentDiskVolumeSource // 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"` + AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource // GitRepo represents a git repository at a particular revision. // +optional - GitRepo *GitRepoVolumeSource `json:"gitRepo,omitempty"` + GitRepo *GitRepoVolumeSource // Secret represents a secret that should populate this volume. // +optional - Secret *SecretVolumeSource `json:"secret,omitempty"` + Secret *SecretVolumeSource // NFS represents an NFS mount on the host that shares a pod's lifetime // +optional - NFS *NFSVolumeSource `json:"nfs,omitempty"` + NFS *NFSVolumeSource // 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"` + ISCSI *ISCSIVolumeSource // Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime // +optional - Glusterfs *GlusterfsVolumeSource `json:"glusterfs,omitempty"` + Glusterfs *GlusterfsVolumeSource // PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace // +optional - PersistentVolumeClaim *PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty"` + PersistentVolumeClaim *PersistentVolumeClaimVolumeSource // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime // +optional - RBD *RBDVolumeSource `json:"rbd,omitempty"` + RBD *RBDVolumeSource // Quobyte represents a Quobyte mount on the host that shares a pod's lifetime // +optional - Quobyte *QuobyteVolumeSource `json:"quobyte,omitempty"` + Quobyte *QuobyteVolumeSource // 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"` + FlexVolume *FlexVolumeSource // Cinder represents a cinder volume attached and mounted on kubelets host machine // +optional - Cinder *CinderVolumeSource `json:"cinder,omitempty"` + Cinder *CinderVolumeSource // CephFS represents a Cephfs mount on the host that shares a pod's lifetime // +optional - CephFS *CephFSVolumeSource `json:"cephfs,omitempty"` + CephFS *CephFSVolumeSource // 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"` + Flocker *FlockerVolumeSource // DownwardAPI represents metadata about the pod that should populate this volume // +optional - DownwardAPI *DownwardAPIVolumeSource `json:"downwardAPI,omitempty"` + DownwardAPI *DownwardAPIVolumeSource // 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"` + FC *FCVolumeSource // AzureFile represents an Azure File Service mount on the host and bind mount to the pod. // +optional - AzureFile *AzureFileVolumeSource `json:"azureFile,omitempty"` + AzureFile *AzureFileVolumeSource // ConfigMap represents a configMap that should populate this volume // +optional - ConfigMap *ConfigMapVolumeSource `json:"configMap,omitempty"` + ConfigMap *ConfigMapVolumeSource // VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine // +optional - VsphereVolume *VsphereVirtualDiskVolumeSource `json:"vsphereVolume,omitempty"` + VsphereVolume *VsphereVirtualDiskVolumeSource // AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. // +optional - AzureDisk *AzureDiskVolumeSource `json:"azureDisk,omitempty"` + AzureDisk *AzureDiskVolumeSource // PhotonPersistentDisk represents a Photon Controller persistent disk attached and mounted on kubelets host machine - PhotonPersistentDisk *PhotonPersistentDiskVolumeSource `json:"photonPersistentDisk,omitempty"` + PhotonPersistentDisk *PhotonPersistentDiskVolumeSource } // Similar to VolumeSource but meant for the administrator who creates PVs. @@ -299,106 +299,106 @@ 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"` + GCEPersistentDisk *GCEPersistentDiskVolumeSource // 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"` + AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource // 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"` + HostPath *HostPathVolumeSource // Glusterfs represents a Glusterfs volume that is attached to a host and exposed to the pod // +optional - Glusterfs *GlusterfsVolumeSource `json:"glusterfs,omitempty"` + Glusterfs *GlusterfsVolumeSource // NFS represents an NFS mount on the host that shares a pod's lifetime // +optional - NFS *NFSVolumeSource `json:"nfs,omitempty"` + NFS *NFSVolumeSource // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime // +optional - RBD *RBDVolumeSource `json:"rbd,omitempty"` + RBD *RBDVolumeSource // Quobyte represents a Quobyte mount on the host that shares a pod's lifetime // +optional - Quobyte *QuobyteVolumeSource `json:"quobyte,omitempty"` + Quobyte *QuobyteVolumeSource // 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"` + ISCSI *ISCSIVolumeSource // 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"` + FlexVolume *FlexVolumeSource // Cinder represents a cinder volume attached and mounted on kubelets host machine // +optional - Cinder *CinderVolumeSource `json:"cinder,omitempty"` + Cinder *CinderVolumeSource // CephFS represents a Ceph FS mount on the host that shares a pod's lifetime // +optional - CephFS *CephFSVolumeSource `json:"cephfs,omitempty"` + CephFS *CephFSVolumeSource // 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"` + FC *FCVolumeSource // 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"` + Flocker *FlockerVolumeSource // AzureFile represents an Azure File Service mount on the host and bind mount to the pod. // +optional - AzureFile *AzureFileVolumeSource `json:"azureFile,omitempty"` + AzureFile *AzureFileVolumeSource // VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine // +optional - VsphereVolume *VsphereVirtualDiskVolumeSource `json:"vsphereVolume,omitempty"` + VsphereVolume *VsphereVirtualDiskVolumeSource // AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. // +optional - AzureDisk *AzureDiskVolumeSource `json:"azureDisk,omitempty"` + AzureDisk *AzureDiskVolumeSource // PhotonPersistentDisk represents a Photon Controller persistent disk attached and mounted on kubelets host machine - PhotonPersistentDisk *PhotonPersistentDiskVolumeSource `json:"photonPersistentDisk,omitempty"` + PhotonPersistentDisk *PhotonPersistentDiskVolumeSource } type PersistentVolumeClaimVolumeSource struct { // ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume - ClaimName string `json:"claimName"` + ClaimName string // Optional: Defaults to false (read/write). ReadOnly here // will force the ReadOnly setting in VolumeMounts // +optional - ReadOnly bool `json:"readOnly,omitempty"` + ReadOnly bool } // +genclient=true // +nonNamespaced=true type PersistentVolume struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - ObjectMeta `json:"metadata,omitempty"` + ObjectMeta //Spec defines a persistent volume owned by the cluster // +optional - Spec PersistentVolumeSpec `json:"spec,omitempty"` + Spec PersistentVolumeSpec // Status represents the current information about persistent volume. // +optional - Status PersistentVolumeStatus `json:"status,omitempty"` + Status PersistentVolumeStatus } type PersistentVolumeSpec struct { // Resources represents the actual resources of the volume - Capacity ResourceList `json:"capacity"` + Capacity ResourceList // Source represents the location and type of a volume to mount. - PersistentVolumeSource `json:",inline"` + PersistentVolumeSource // AccessModes contains all ways the volume can be mounted // +optional - AccessModes []PersistentVolumeAccessMode `json:"accessModes,omitempty"` + AccessModes []PersistentVolumeAccessMode // 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"` + ClaimRef *ObjectReference // Optional: what happens to a persistent volume when released from its claim. // +optional - PersistentVolumeReclaimPolicy PersistentVolumeReclaimPolicy `json:"persistentVolumeReclaimPolicy,omitempty"` + PersistentVolumeReclaimPolicy PersistentVolumeReclaimPolicy } // PersistentVolumeReclaimPolicy describes a policy for end-of-life maintenance of persistent volumes @@ -419,44 +419,44 @@ 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"` + Phase PersistentVolumePhase // A human-readable message indicating details about why the volume is in this state. // +optional - Message string `json:"message,omitempty"` + Message string // 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"` + Reason string } type PersistentVolumeList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` - Items []PersistentVolume `json:"items"` + metav1.ListMeta + Items []PersistentVolume } // +genclient=true // PersistentVolumeClaim is a user's request for and claim to a persistent volume type PersistentVolumeClaim struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - ObjectMeta `json:"metadata,omitempty"` + ObjectMeta // Spec defines the volume requested by a pod author // +optional - Spec PersistentVolumeClaimSpec `json:"spec,omitempty"` + Spec PersistentVolumeClaimSpec // Status represents the current information about a claim // +optional - Status PersistentVolumeClaimStatus `json:"status,omitempty"` + Status PersistentVolumeClaimStatus } type PersistentVolumeClaimList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` - Items []PersistentVolumeClaim `json:"items"` + metav1.ListMeta + Items []PersistentVolumeClaim } // PersistentVolumeClaimSpec describes the common attributes of storage devices @@ -464,30 +464,30 @@ type PersistentVolumeClaimList struct { type PersistentVolumeClaimSpec struct { // Contains the types of access modes required // +optional - AccessModes []PersistentVolumeAccessMode `json:"accessModes,omitempty"` + AccessModes []PersistentVolumeAccessMode // A label query over volumes to consider for binding. This selector is // ignored when VolumeName is set // +optional - Selector *metav1.LabelSelector `json:"selector,omitempty"` + Selector *metav1.LabelSelector // Resources represents the minimum resources required // +optional - Resources ResourceRequirements `json:"resources,omitempty"` + Resources ResourceRequirements // 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"` + VolumeName string } type PersistentVolumeClaimStatus struct { // Phase represents the current phase of PersistentVolumeClaim // +optional - Phase PersistentVolumeClaimPhase `json:"phase,omitempty"` + Phase PersistentVolumeClaimPhase // AccessModes contains all ways the volume backing the PVC can be mounted // +optional - AccessModes []PersistentVolumeAccessMode `json:"accessModes,omitempty"` + AccessModes []PersistentVolumeAccessMode // Represents the actual resources of the underlying volume // +optional - Capacity ResourceList `json:"capacity,omitempty"` + Capacity ResourceList } type PersistentVolumeAccessMode string @@ -535,7 +535,7 @@ const ( // Represents a host path mapped into a pod. // Host path volumes do not support ownership management or SELinux relabeling. type HostPathVolumeSource struct { - Path string `json:"path"` + Path string } // Represents an empty directory for a pod. @@ -548,7 +548,7 @@ type EmptyDirVolumeSource struct { // 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"` + Medium StorageMedium } // StorageMedium defines ways that storage can be allocated to a volume. @@ -577,22 +577,22 @@ const ( // PDs support ownership management and SELinux relabeling. type GCEPersistentDiskVolumeSource struct { // Unique name of the PD resource. Used to identify the disk in GCE - PDName string `json:"pdName"` + PDName string // 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"` + FSType string // 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"` + Partition int32 // Optional: Defaults to false (read/write). ReadOnly here will force // the ReadOnly setting in VolumeMounts. // +optional - ReadOnly bool `json:"readOnly,omitempty"` + ReadOnly bool } // Represents an ISCSI disk. @@ -602,26 +602,26 @@ 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"` + TargetPortal string // Required: target iSCSI Qualified Name // +optional - IQN string `json:"iqn,omitempty"` + IQN string // Required: iSCSI target lun number // +optional - Lun int32 `json:"lun,omitempty"` + Lun int32 // Optional: Defaults to 'default' (tcp). iSCSI interface name that uses an iSCSI transport. // +optional - ISCSIInterface string `json:"iscsiInterface,omitempty"` + ISCSIInterface string // 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"` + FSType string // Optional: Defaults to false (read/write). ReadOnly here will force // the ReadOnly setting in VolumeMounts. // +optional - ReadOnly bool `json:"readOnly,omitempty"` + ReadOnly bool } // Represents a Fibre Channel volume. @@ -629,45 +629,45 @@ type ISCSIVolumeSource struct { // Fibre Channel volumes support ownership management and SELinux relabeling. type FCVolumeSource struct { // Required: FC target worldwide names (WWNs) - TargetWWNs []string `json:"targetWWNs"` + TargetWWNs []string // Required: FC target lun number - Lun *int32 `json:"lun"` + Lun *int32 // 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"` + FSType string // Optional: Defaults to false (read/write). ReadOnly here will force // the ReadOnly setting in VolumeMounts. // +optional - ReadOnly bool `json:"readOnly,omitempty"` + ReadOnly bool } // 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. type FlexVolumeSource struct { // Driver is the name of the driver to use for this volume. - Driver string `json:"driver"` + Driver string // 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"` + FSType string // 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"` + SecretRef *LocalObjectReference // Optional: Defaults to false (read/write). ReadOnly here will force // the ReadOnly setting in VolumeMounts. // +optional - ReadOnly bool `json:"readOnly,omitempty"` + ReadOnly bool // Optional: Extra driver options if any. // +optional - Options map[string]string `json:"options,omitempty"` + Options map[string]string } // Represents a Persistent Disk resource in AWS. @@ -678,22 +678,22 @@ type FlexVolumeSource struct { // ownership management and SELinux relabeling. type AWSElasticBlockStoreVolumeSource struct { // Unique id of the persistent disk resource. Used to identify the disk in AWS - VolumeID string `json:"volumeID"` + VolumeID string // 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"` + FSType string // 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"` + Partition int32 // Optional: Defaults to false (read/write). ReadOnly here will force // the ReadOnly setting in VolumeMounts. // +optional - ReadOnly bool `json:"readOnly,omitempty"` + ReadOnly bool } // Represents a volume that is populated with the contents of a git repository. @@ -701,16 +701,16 @@ type AWSElasticBlockStoreVolumeSource struct { // Git repo volumes support SELinux relabeling. type GitRepoVolumeSource struct { // Repository URL - Repository string `json:"repository"` + Repository string // Commit hash, this is optional // +optional - Revision string `json:"revision,omitempty"` + Revision string // 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"` + Directory string // TODO: Consider credentials here. } @@ -722,7 +722,7 @@ type GitRepoVolumeSource struct { type SecretVolumeSource struct { // Name of the secret in the pod's namespace to use. // +optional - SecretName string `json:"secretName,omitempty"` + SecretName string // 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 // key and content is the value. If specified, the listed keys will be @@ -731,29 +731,29 @@ type SecretVolumeSource struct { // the volume setup will error. Paths must be relative and may not contain // the '..' path or start with '..'. // +optional - Items []KeyToPath `json:"items,omitempty"` + Items []KeyToPath // 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"` + DefaultMode *int32 } // Represents an NFS mount that lasts the lifetime of a pod. // NFS volumes do not support ownership management or SELinux relabeling. type NFSVolumeSource struct { // Server is the hostname or IP address of the NFS server - Server string `json:"server"` + Server string // Path is the exported NFS share - Path string `json:"path"` + Path string // 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"` + ReadOnly bool } // Represents a Quobyte mount that lasts the lifetime of a pod. @@ -762,71 +762,71 @@ type QuobyteVolumeSource struct { // Registry represents a single or multiple Quobyte Registry services // specified as a string as host:port pair (multiple entries are separated with commas) // which acts as the central registry for volumes - Registry string `json:"registry"` + Registry string // Volume is a string that references an already created Quobyte volume by name. - Volume string `json:"volume"` + Volume string // Defaults to false (read/write). ReadOnly here will force // the Quobyte to be mounted with read-only permissions // +optional - ReadOnly bool `json:"readOnly,omitempty"` + ReadOnly bool // User to map volume access to // Defaults to the root user // +optional - User string `json:"user,omitempty"` + User string // Group to map volume access to // Default is no group // +optional - Group string `json:"group,omitempty"` + Group string } // Represents a Glusterfs mount that lasts the lifetime of a pod. // Glusterfs volumes do not support ownership management or SELinux relabeling. type GlusterfsVolumeSource struct { // Required: EndpointsName is the endpoint name that details Glusterfs topology - EndpointsName string `json:"endpoints"` + EndpointsName string // Required: Path is the Glusterfs volume path - Path string `json:"path"` + Path string // 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"` + ReadOnly bool } // Represents a Rados Block Device mount that lasts the lifetime of a pod. // RBD volumes support ownership management and SELinux relabeling. type RBDVolumeSource struct { // Required: CephMonitors is a collection of Ceph monitors - CephMonitors []string `json:"monitors"` + CephMonitors []string // Required: RBDImage is the rados image name - RBDImage string `json:"image"` + RBDImage string // 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"` + FSType string // Optional: RadosPool is the rados pool name,default is rbd // +optional - RBDPool string `json:"pool,omitempty"` + RBDPool string // Optional: RBDUser is the rados user name, default is admin // +optional - RadosUser string `json:"user,omitempty"` + RadosUser string // Optional: Keyring is the path to key ring for RBDUser, default is /etc/ceph/keyring // +optional - Keyring string `json:"keyring,omitempty"` + Keyring string // Optional: SecretRef is name of the authentication secret for RBDUser, default is nil. // +optional - SecretRef *LocalObjectReference `json:"secretRef,omitempty"` + SecretRef *LocalObjectReference // Optional: Defaults to false (read/write). ReadOnly here will force // the ReadOnly setting in VolumeMounts. // +optional - ReadOnly bool `json:"readOnly,omitempty"` + ReadOnly bool } // Represents a cinder volume resource in Openstack. A Cinder volume @@ -835,39 +835,39 @@ type RBDVolumeSource struct { // management and SELinux relabeling. type CinderVolumeSource struct { // Unique id of the volume used to identify the cinder volume - VolumeID string `json:"volumeID"` + VolumeID string // 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"` + FSType string // Optional: Defaults to false (read/write). ReadOnly here will force // the ReadOnly setting in VolumeMounts. // +optional - ReadOnly bool `json:"readOnly,omitempty"` + ReadOnly bool } // Represents a Ceph Filesystem mount that lasts the lifetime of a pod // Cephfs volumes do not support ownership management or SELinux relabeling. type CephFSVolumeSource struct { // Required: Monitors is a collection of Ceph monitors - Monitors []string `json:"monitors"` + Monitors []string // Optional: Used as the mounted root, rather than the full Ceph tree, default is / // +optional - Path string `json:"path,omitempty"` + Path string // Optional: User is the rados user name, default is admin // +optional - User string `json:"user,omitempty"` + User string // Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret // +optional - SecretFile string `json:"secretFile,omitempty"` + SecretFile string // Optional: SecretRef is reference to the authentication secret for User, default is empty. // +optional - SecretRef *LocalObjectReference `json:"secretRef,omitempty"` + SecretRef *LocalObjectReference // Optional: Defaults to false (read/write). ReadOnly here will force // the ReadOnly setting in VolumeMounts. // +optional - ReadOnly bool `json:"readOnly,omitempty"` + ReadOnly bool } // Represents a Flocker volume mounted by the Flocker agent. @@ -877,10 +877,10 @@ 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"` + DatasetName string // UUID of the dataset. This is unique identifier of a Flocker dataset // +optional - DatasetUUID string `json:"datasetUUID,omitempty"` + DatasetUUID string } // Represents a volume containing downward API info. @@ -888,66 +888,66 @@ type FlockerVolumeSource struct { type DownwardAPIVolumeSource struct { // Items is a list of DownwardAPIVolume file // +optional - Items []DownwardAPIVolumeFile `json:"items,omitempty"` + Items []DownwardAPIVolumeFile // 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"` + DefaultMode *int32 } // Represents a single file containing information from the downward API 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"` + Path string // Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. // +optional - FieldRef *ObjectFieldSelector `json:"fieldRef,omitempty"` + FieldRef *ObjectFieldSelector // 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"` + ResourceFieldRef *ResourceFieldSelector // 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"` + Mode *int32 } // AzureFile represents an Azure File Service mount on the host and bind mount to the pod. type AzureFileVolumeSource struct { // the name of secret that contains Azure Storage Account Name and Key - SecretName string `json:"secretName"` + SecretName string // Share Name - ShareName string `json:"shareName"` + ShareName string // Defaults to false (read/write). ReadOnly here will force // the ReadOnly setting in VolumeMounts. // +optional - ReadOnly bool `json:"readOnly,omitempty"` + ReadOnly bool } // Represents a vSphere volume resource. type VsphereVirtualDiskVolumeSource struct { // Path that identifies vSphere volume vmdk - VolumePath string `json:"volumePath"` + VolumePath string // 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"` + FSType string } // Represents a Photon Controller persistent disk resource. type PhotonPersistentDiskVolumeSource struct { // ID that identifies Photon Controller persistent disk - PdID string `json:"pdID"` + PdID string // 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. - FSType string `json:"fsType,omitempty"` + FSType string } type AzureDataDiskCachingMode string @@ -961,21 +961,21 @@ const ( // AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. type AzureDiskVolumeSource struct { // The Name of the data disk in the blob storage - DiskName string `json:"diskName"` + DiskName string // The URI the the data disk in the blob storage - DataDiskURI string `json:"diskURI"` + DataDiskURI string // Host Caching mode: None, Read Only, Read Write. // +optional - CachingMode *AzureDataDiskCachingMode `json:"cachingMode,omitempty"` + CachingMode *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"` + FSType *string // Defaults to false (read/write). ReadOnly here will force // the ReadOnly setting in VolumeMounts. // +optional - ReadOnly *bool `json:"readOnly,omitempty"` + ReadOnly *bool } // Adapts a ConfigMap into a volume. @@ -985,7 +985,7 @@ type AzureDiskVolumeSource struct { // the items element is populated with specific mappings of keys to paths. // ConfigMap volumes support ownership management and SELinux relabeling. type ConfigMapVolumeSource struct { - LocalObjectReference `json:",inline"` + LocalObjectReference // If unspecified, each key-value pair in the Data field of the referenced // ConfigMap will be projected into the volume as a file whose name is the // key and content is the value. If specified, the listed keys will be @@ -994,32 +994,32 @@ type ConfigMapVolumeSource struct { // the volume setup will error. Paths must be relative and may not contain // the '..' path or start with '..'. // +optional - Items []KeyToPath `json:"items,omitempty"` + Items []KeyToPath // 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"` + DefaultMode *int32 } // Maps a string key to a path within a volume. type KeyToPath struct { // The key to project. - Key string `json:"key"` + Key string // The relative path of the file to map the key to. // May not be an absolute path. // May not contain the path element '..'. // May not start with the string '..'. - Path string `json:"path"` + Path string // Optional: mode bits to use on this file, should 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"` + Mode *int32 } // ContainerPort represents a network port in a single container @@ -1027,40 +1027,40 @@ 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"` + Name string // 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"` + HostPort int32 // Required: This must be a valid port number, 0 < x < 65536. - ContainerPort int32 `json:"containerPort"` + ContainerPort int32 // Required: Supports "TCP" and "UDP". // +optional - Protocol Protocol `json:"protocol,omitempty"` + Protocol Protocol // Optional: What host IP to bind the external port to. // +optional - HostIP string `json:"hostIP,omitempty"` + HostIP string } // VolumeMount describes a mounting of a Volume within a container. type VolumeMount struct { // Required: This must match the Name of a Volume [above]. - Name string `json:"name"` + Name string // Optional: Defaults to false (read-write). // +optional - ReadOnly bool `json:"readOnly,omitempty"` + ReadOnly bool // Required. Must not contain ':'. - MountPath string `json:"mountPath"` + MountPath string // Path within the volume from which the container's volume should be mounted. // Defaults to "" (volume's root). // +optional - SubPath string `json:"subPath,omitempty"` + SubPath string } // EnvVar represents an environment variable present in a Container. type EnvVar struct { // Required: This must be a C_IDENTIFIER. - Name string `json:"name"` + Name string // Optional: no more than one of the following may be specified. // Optional: Defaults to ""; variable references $(VAR_NAME) are expanded // using the previous defined environment variables in the container and @@ -1070,10 +1070,10 @@ type EnvVar struct { // references will never be expanded, regardless of whether the variable // exists or not. // +optional - Value string `json:"value,omitempty"` + Value string // Optional: Specifies a source the value of this var should come from. // +optional - ValueFrom *EnvVarSource `json:"valueFrom,omitempty"` + ValueFrom *EnvVarSource } // EnvVarSource represents a source for the value of an EnvVar. @@ -1082,17 +1082,17 @@ 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"` + FieldRef *ObjectFieldSelector // 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"` + ResourceFieldRef *ResourceFieldSelector // Selects a key of a ConfigMap. // +optional - ConfigMapKeyRef *ConfigMapKeySelector `json:"configMapKeyRef,omitempty"` + ConfigMapKeyRef *ConfigMapKeySelector // Selects a key of a secret in the pod's namespace. // +optional - SecretKeyRef *SecretKeySelector `json:"secretKeyRef,omitempty"` + SecretKeyRef *SecretKeySelector } // ObjectFieldSelector selects an APIVersioned field of an object. @@ -1100,65 +1100,65 @@ type ObjectFieldSelector struct { // Required: Version of the schema the FieldPath is written in terms of. // If no value is specified, it will be defaulted to the APIVersion of the // enclosing object. - APIVersion string `json:"apiVersion"` + APIVersion string // Required: Path of the field to select in the specified API version - FieldPath string `json:"fieldPath"` + FieldPath string } // 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"` + ContainerName string // Required: resource to select - Resource string `json:"resource"` + Resource string // Specifies the output format of the exposed resources, defaults to "1" // +optional - Divisor resource.Quantity `json:"divisor,omitempty"` + Divisor resource.Quantity } // Selects a key from a ConfigMap. type ConfigMapKeySelector struct { // The ConfigMap to select from. - LocalObjectReference `json:",inline"` + LocalObjectReference // The key to select. - Key string `json:"key"` + Key string } // SecretKeySelector selects a key of a Secret. type SecretKeySelector struct { // The name of the secret in the pod's namespace to select from. - LocalObjectReference `json:",inline"` + LocalObjectReference // The key of the secret to select from. Must be a valid secret key. - Key string `json:"key"` + Key string } // HTTPHeader describes a custom header to be used in HTTP probes type HTTPHeader struct { // The header field name - Name string `json:"name"` + Name string // The header field value - Value string `json:"value"` + Value string } // 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"` + Path string // Required: Name or number of the port to access on the container. // +optional - Port intstr.IntOrString `json:"port,omitempty"` + Port intstr.IntOrString // 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"` + Host string // Optional: Scheme to use for connecting to the host, defaults to HTTP. // +optional - Scheme URIScheme `json:"scheme,omitempty"` + Scheme URIScheme // Optional: Custom headers to set in the request. HTTP allows repeated headers. // +optional - HTTPHeaders []HTTPHeader `json:"httpHeaders,omitempty"` + HTTPHeaders []HTTPHeader } // URIScheme identifies the scheme used for connection to a host for Get actions @@ -1175,7 +1175,7 @@ const ( type TCPSocketAction struct { // Required: Port to connect to. // +optional - Port intstr.IntOrString `json:"port,omitempty"` + Port intstr.IntOrString } // ExecAction describes a "run in container" action. @@ -1185,30 +1185,30 @@ 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. // +optional - Command []string `json:"command,omitempty"` + Command []string } // Probe describes a health check to be performed against a container to determine whether it is // alive or ready to receive traffic. type Probe struct { // The action taken to determine the health of a container - Handler `json:",inline"` + Handler // Length of time before health checking is activated. In seconds. // +optional - InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty"` + InitialDelaySeconds int32 // Length of time before health checking times out. In seconds. // +optional - TimeoutSeconds int32 `json:"timeoutSeconds,omitempty"` + TimeoutSeconds int32 // How often (in seconds) to perform the probe. // +optional - PeriodSeconds int32 `json:"periodSeconds,omitempty"` + PeriodSeconds int32 // Minimum consecutive successes for the probe to be considered successful after having failed. // Must be 1 for liveness. // +optional - SuccessThreshold int32 `json:"successThreshold,omitempty"` + SuccessThreshold int32 // Minimum consecutive failures for the probe to be considered failed after having succeeded. // +optional - FailureThreshold int32 `json:"failureThreshold,omitempty"` + FailureThreshold int32 } // PullPolicy describes a policy for if/when to pull a container image @@ -1230,81 +1230,81 @@ type Capability string type Capabilities struct { // Added capabilities // +optional - Add []Capability `json:"add,omitempty"` + Add []Capability // Removed capabilities // +optional - Drop []Capability `json:"drop,omitempty"` + Drop []Capability } // ResourceRequirements describes the compute resource requirements. type ResourceRequirements struct { // Limits describes the maximum amount of compute resources allowed. // +optional - Limits ResourceList `json:"limits,omitempty"` + Limits ResourceList // 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"` + Requests ResourceList } // Container represents a single container that is expected to be run on the host. type Container struct { // Required: This must be a DNS_LABEL. Each container in a pod must // have a unique name. - Name string `json:"name"` + Name string // Required. - Image string `json:"image"` + Image string // Optional: The docker image's entrypoint 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 - Command []string `json:"command,omitempty"` + Command []string // 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"` + Args []string // Optional: Defaults to Docker's default. // +optional - WorkingDir string `json:"workingDir,omitempty"` + WorkingDir string // +optional - Ports []ContainerPort `json:"ports,omitempty"` + Ports []ContainerPort // +optional - Env []EnvVar `json:"env,omitempty"` + Env []EnvVar // Compute resource requirements. // +optional - Resources ResourceRequirements `json:"resources,omitempty"` + Resources ResourceRequirements // +optional - VolumeMounts []VolumeMount `json:"volumeMounts,omitempty"` + VolumeMounts []VolumeMount // +optional - LivenessProbe *Probe `json:"livenessProbe,omitempty"` + LivenessProbe *Probe // +optional - ReadinessProbe *Probe `json:"readinessProbe,omitempty"` + ReadinessProbe *Probe // +optional - Lifecycle *Lifecycle `json:"lifecycle,omitempty"` + Lifecycle *Lifecycle // Required. // +optional - TerminationMessagePath string `json:"terminationMessagePath,omitempty"` + TerminationMessagePath string // Required: Policy for pulling images for this container - ImagePullPolicy PullPolicy `json:"imagePullPolicy"` + ImagePullPolicy PullPolicy // 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"` + SecurityContext *SecurityContext // Variables for interactive containers, these have very specialized use-cases (e.g. debugging) // and shouldn't be used for general purpose containers. // +optional - Stdin bool `json:"stdin,omitempty"` + Stdin bool // +optional - StdinOnce bool `json:"stdinOnce,omitempty"` + StdinOnce bool // +optional - TTY bool `json:"tty,omitempty"` + TTY bool } // Handler defines a specific action that should be taken @@ -1313,14 +1313,14 @@ 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"` + Exec *ExecAction // HTTPGet specifies the http request to perform. // +optional - HTTPGet *HTTPGetAction `json:"httpGet,omitempty"` + HTTPGet *HTTPGetAction // TCPSocket specifies an action involving a TCP port. // TODO: implement a realistic TCP lifecycle hook // +optional - TCPSocket *TCPSocketAction `json:"tcpSocket,omitempty"` + TCPSocket *TCPSocketAction } // Lifecycle describes actions that the management system should take in response to container lifecycle @@ -1330,11 +1330,11 @@ 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"` + PostStart *Handler // 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"` + PreStop *Handler } // The below types are used by kube_client and api_server. @@ -1354,31 +1354,31 @@ const ( type ContainerStateWaiting struct { // A brief CamelCase string indicating details about why the container is in waiting state. // +optional - Reason string `json:"reason,omitempty"` + Reason string // A human-readable message indicating details about why the container is in waiting state. // +optional - Message string `json:"message,omitempty"` + Message string } type ContainerStateRunning struct { // +optional - StartedAt metav1.Time `json:"startedAt,omitempty"` + StartedAt metav1.Time } type ContainerStateTerminated struct { - ExitCode int32 `json:"exitCode"` + ExitCode int32 // +optional - Signal int32 `json:"signal,omitempty"` + Signal int32 // +optional - Reason string `json:"reason,omitempty"` + Reason string // +optional - Message string `json:"message,omitempty"` + Message string // +optional - StartedAt metav1.Time `json:"startedAt,omitempty"` + StartedAt metav1.Time // +optional - FinishedAt metav1.Time `json:"finishedAt,omitempty"` + FinishedAt metav1.Time // +optional - ContainerID string `json:"containerID,omitempty"` + ContainerID string } // ContainerState holds a possible state of container. @@ -1386,29 +1386,29 @@ type ContainerStateTerminated struct { // If none of them is specified, the default one is ContainerStateWaiting. type ContainerState struct { // +optional - Waiting *ContainerStateWaiting `json:"waiting,omitempty"` + Waiting *ContainerStateWaiting // +optional - Running *ContainerStateRunning `json:"running,omitempty"` + Running *ContainerStateRunning // +optional - Terminated *ContainerStateTerminated `json:"terminated,omitempty"` + Terminated *ContainerStateTerminated } type ContainerStatus struct { // Each container in a pod must have a unique name. - Name string `json:"name"` + Name string // +optional - State ContainerState `json:"state,omitempty"` + State ContainerState // +optional - LastTerminationState ContainerState `json:"lastState,omitempty"` + LastTerminationState ContainerState // Ready specifies whether the container has passed its readiness check. - Ready bool `json:"ready"` + Ready bool // Note that this is calculated from dead containers. But those containers are subject to // garbage collection. This value will get capped at 5 by GC. - RestartCount int32 `json:"restartCount"` - Image string `json:"image"` - ImageID string `json:"imageID"` + RestartCount int32 + Image string + ImageID string // +optional - ContainerID string `json:"containerID,omitempty"` + ContainerID string } // PodPhase is a label for the condition of a pod at the current time. @@ -1451,16 +1451,16 @@ const ( ) type PodCondition struct { - Type PodConditionType `json:"type"` - Status ConditionStatus `json:"status"` + Type PodConditionType + Status ConditionStatus // +optional - LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"` + LastProbeTime metav1.Time // +optional - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` + LastTransitionTime metav1.Time // +optional - Reason string `json:"reason,omitempty"` + Reason string // +optional - Message string `json:"message,omitempty"` + Message string } // RestartPolicy describes how the container should be restarted. @@ -1477,11 +1477,11 @@ const ( // PodList is a list of Pods. type PodList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta - Items []Pod `json:"items"` + Items []Pod } // DNSPolicy defines how a pod's DNS will be configured. @@ -1503,30 +1503,30 @@ const ( // by the node selector terms. type NodeSelector struct { //Required. A list of node selector terms. The terms are ORed. - NodeSelectorTerms []NodeSelectorTerm `json:"nodeSelectorTerms"` + NodeSelectorTerms []NodeSelectorTerm } // A null or empty node selector term matches no objects. type NodeSelectorTerm struct { //Required. A list of node selector requirements. The requirements are ANDed. - MatchExpressions []NodeSelectorRequirement `json:"matchExpressions"` + MatchExpressions []NodeSelectorRequirement } // A node selector requirement is a selector that contains values, a key, and an operator // that relates the key and values. type NodeSelectorRequirement struct { // The label key that the selector applies to. - Key string `json:"key" patchStrategy:"merge" patchMergeKey:"key"` + Key string // Represents a key's relationship to a set of values. // Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - Operator NodeSelectorOperator `json:"operator"` + Operator NodeSelectorOperator // An array of string values. If the operator is In or NotIn, // the values array must be non-empty. If the operator is Exists or DoesNotExist, // 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"` + Values []string } // A node selector operator is the set of operators that can be used in @@ -1546,13 +1546,13 @@ const ( type Affinity struct { // Describes node affinity scheduling rules for the pod. // +optional - NodeAffinity *NodeAffinity `json:"nodeAffinity,omitempty"` + NodeAffinity *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"` + PodAffinity *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"` + PodAntiAffinity *PodAntiAffinity } // Pod affinity is a group of inter pod affinity scheduling rules. @@ -1566,7 +1566,7 @@ type PodAffinity struct { // 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"` + // RequiredDuringSchedulingRequiredDuringExecution []PodAffinityTerm // If the affinity requirements specified by this field are not met at // scheduling time, the pod will not be scheduled onto the node. // If the affinity requirements specified by this field cease to be met @@ -1575,7 +1575,7 @@ type PodAffinity struct { // 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"` + RequiredDuringSchedulingIgnoredDuringExecution []PodAffinityTerm // The scheduler will prefer to schedule pods to nodes that satisfy // the affinity expressions specified by this field, but it may choose // a node that violates one or more of the expressions. The node that is @@ -1586,7 +1586,7 @@ type PodAffinity struct { // "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"` + PreferredDuringSchedulingIgnoredDuringExecution []WeightedPodAffinityTerm } // Pod anti affinity is a group of inter pod anti affinity scheduling rules. @@ -1600,7 +1600,7 @@ type PodAntiAffinity struct { // 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"` + // RequiredDuringSchedulingRequiredDuringExecution []PodAffinityTerm // If the anti-affinity requirements specified by this field are not met at // scheduling time, the pod will not be scheduled onto the node. // If the anti-affinity requirements specified by this field cease to be met @@ -1609,7 +1609,7 @@ type PodAntiAffinity struct { // 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"` + RequiredDuringSchedulingIgnoredDuringExecution []PodAffinityTerm // The scheduler will prefer to schedule pods to nodes that satisfy // the anti-affinity expressions specified by this field, but it may choose // a node that violates one or more of the expressions. The node that is @@ -1620,16 +1620,16 @@ type PodAntiAffinity struct { // "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"` + PreferredDuringSchedulingIgnoredDuringExecution []WeightedPodAffinityTerm } // The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) type WeightedPodAffinityTerm struct { // weight associated with matching the corresponding podAffinityTerm, // in the range 1-100. - Weight int32 `json:"weight"` + Weight int32 // Required. A pod affinity term, associated with the corresponding weight. - PodAffinityTerm PodAffinityTerm `json:"podAffinityTerm"` + PodAffinityTerm PodAffinityTerm } // Defines a set of pods (namely those matching the labelSelector @@ -1641,12 +1641,12 @@ type WeightedPodAffinityTerm struct { type PodAffinityTerm struct { // A label query over a set of resources, in this case pods. // +optional - LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"` + LabelSelector *metav1.LabelSelector // namespaces specifies which namespaces the labelSelector applies to (matches against); // nil list means "this pod's namespace," empty list means "all namespaces" // The json tag here is not "omitempty" since we need to distinguish nil and empty. // See https://golang.org/pkg/encoding/json/#Marshal for more details. - Namespaces []string `json:"namespaces"` + Namespaces []string // This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching // the labelSelector in the specified namespaces, where co-located is defined as running on a node // whose value of the label with key topologyKey matches that of any node on which any of the @@ -1655,7 +1655,7 @@ type PodAffinityTerm struct { // ("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"` + TopologyKey string } // Node affinity is a group of node affinity scheduling rules. @@ -1667,7 +1667,7 @@ type NodeAffinity struct { // 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"` + // RequiredDuringSchedulingRequiredDuringExecution *NodeSelector // If the affinity requirements specified by this field are not met at // scheduling time, the pod will not be scheduled onto the node. @@ -1675,7 +1675,7 @@ type NodeAffinity struct { // 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"` + RequiredDuringSchedulingIgnoredDuringExecution *NodeSelector // The scheduler will prefer to schedule pods to nodes that satisfy // the affinity expressions specified by this field, but it may choose // a node that violates one or more of the expressions. The node that is @@ -1686,30 +1686,30 @@ type NodeAffinity struct { // "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"` + PreferredDuringSchedulingIgnoredDuringExecution []PreferredSchedulingTerm } // An empty preferred scheduling term matches all objects with implicit weight 0 // (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op). type PreferredSchedulingTerm struct { // Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. - Weight int32 `json:"weight"` + Weight int32 // A node selector term, associated with the corresponding weight. - Preference NodeSelectorTerm `json:"preference"` + Preference NodeSelectorTerm } // The node this Taint is attached to has the effect "effect" on // any pod that that does not tolerate the Taint. type Taint struct { // Required. The taint key to be applied to a node. - Key string `json:"key" patchStrategy:"merge" patchMergeKey:"key"` + Key string // Required. The taint value corresponding to the taint key. // +optional - Value string `json:"value,omitempty"` + Value string // Required. The effect of the taint on pods // that do not tolerate the taint. // Valid effects are NoSchedule and PreferNoSchedule. - Effect TaintEffect `json:"effect"` + Effect TaintEffect } type TaintEffect string @@ -1743,21 +1743,21 @@ const ( type Toleration struct { // Required. Key is the taint key that the toleration applies to. // +optional - Key string `json:"key,omitempty" patchStrategy:"merge" patchMergeKey:"key"` + Key string // 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"` + Operator 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"` + Value string // 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"` + Effect TaintEffect // TODO: For forgiveness (#1574), we'd eventually add at least a grace period // here, and possibly an occurrence threshold and period. } @@ -1772,13 +1772,13 @@ const ( // PodSpec is a description of a pod type PodSpec struct { - Volumes []Volume `json:"volumes"` + Volumes []Volume // List of initialization containers belonging to the pod. - InitContainers []Container `json:"-"` + InitContainers []Container // List of containers belonging to the pod. - Containers []Container `json:"containers"` + Containers []Container // +optional - RestartPolicy RestartPolicy `json:"restartPolicy,omitempty"` + RestartPolicy 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. // If this value is nil, the default grace period will be used instead. @@ -1786,52 +1786,52 @@ 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. // +optional - TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"` + TerminationGracePeriodSeconds *int64 // 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"` + ActiveDeadlineSeconds *int64 // Required: Set DNS policy. // +optional - DNSPolicy DNSPolicy `json:"dnsPolicy,omitempty"` + DNSPolicy DNSPolicy // NodeSelector is a selector which must be true for the pod to fit on a node // +optional - NodeSelector map[string]string `json:"nodeSelector,omitempty"` + NodeSelector map[string]string // ServiceAccountName is the name of the ServiceAccount to use to run this pod // The pod will be allowed to use secrets referenced by the ServiceAccount - ServiceAccountName string `json:"serviceAccountName"` + ServiceAccountName string // 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"` + NodeName string // 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"` + SecurityContext *PodSecurityContext // 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"` + ImagePullSecrets []LocalObjectReference // 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"` + Hostname string // 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"` + Subdomain string } // Sysctl defines a kernel parameter to be set type Sysctl struct { // Name of a property to set - Name string `json:"name"` + Name string // Value of a property to set - Value string `json:"value"` + Value string } // PodSecurityContext holds pod-level security attributes and common container settings. @@ -1843,31 +1843,31 @@ type PodSecurityContext struct { // Optional: Default to false // +k8s:conversion-gen=false // +optional - HostNetwork bool `json:"hostNetwork,omitempty"` + HostNetwork bool // Use the host's pid namespace. // Optional: Default to false. // +k8s:conversion-gen=false // +optional - HostPID bool `json:"hostPID,omitempty"` + HostPID bool // Use the host's ipc namespace. // Optional: Default to false. // +k8s:conversion-gen=false // +optional - HostIPC bool `json:"hostIPC,omitempty"` + HostIPC bool // 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"` + SELinuxOptions *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"` + RunAsUser *int64 // 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 // does not run as UID 0 (root) and fail to start the container if it does. @@ -1875,12 +1875,12 @@ type PodSecurityContext struct { // 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"` + RunAsNonRoot *bool // 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"` + SupplementalGroups []int64 // 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 // to be owned by the pod: @@ -1891,107 +1891,107 @@ type PodSecurityContext struct { // // If unset, the Kubelet will not modify the ownership and permissions of any volume. // +optional - FSGroup *int64 `json:"fsGroup,omitempty"` + FSGroup *int64 } // PodStatus represents information about the status of a pod. Status may trail the actual // state of a system. type PodStatus struct { // +optional - Phase PodPhase `json:"phase,omitempty"` + Phase PodPhase // +optional - Conditions []PodCondition `json:"conditions,omitempty"` + Conditions []PodCondition // A human readable message indicating details about why the pod is in this state. // +optional - Message string `json:"message,omitempty"` + Message string // A brief CamelCase message indicating details about why the pod is in this state. e.g. 'OutOfDisk' // +optional - Reason string `json:"reason,omitempty"` + Reason string // +optional - HostIP string `json:"hostIP,omitempty"` + HostIP string // +optional - PodIP string `json:"podIP,omitempty"` + PodIP string // 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 *metav1.Time `json:"startTime,omitempty"` + StartTime *metav1.Time // The list has one entry per init container in the manifest. The most recent successful // init container will have ready = true, the most recently started container will have // startTime set. // More info: http://kubernetes.io/docs/user-guide/pod-states#container-statuses - InitContainerStatuses []ContainerStatus `json:"-"` + InitContainerStatuses []ContainerStatus // The list has one entry per container in the manifest. Each entry is // currently the output of `docker inspect`. This output format is *not* // 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"` + ContainerStatuses []ContainerStatus } // PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded type PodStatusResult struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - ObjectMeta `json:"metadata,omitempty"` + ObjectMeta // Status represents the current information about a pod. This data may not be up // to date. // +optional - Status PodStatus `json:"status,omitempty"` + Status PodStatus } // +genclient=true // Pod is a collection of containers, used as either input (create, update) or as output (list, get). type Pod struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - ObjectMeta `json:"metadata,omitempty"` + ObjectMeta // Spec defines the behavior of a pod. // +optional - Spec PodSpec `json:"spec,omitempty"` + Spec PodSpec // Status represents the current information about a pod. This data may not be up // to date. // +optional - Status PodStatus `json:"status,omitempty"` + Status PodStatus } // 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"` + ObjectMeta // Spec defines the behavior of a pod. // +optional - Spec PodSpec `json:"spec,omitempty"` + Spec PodSpec } // +genclient=true // PodTemplate describes a template for creating copies of a predefined pod. type PodTemplate struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - ObjectMeta `json:"metadata,omitempty"` + ObjectMeta // Template defines the pods that will be created from this pod template // +optional - Template PodTemplateSpec `json:"template,omitempty"` + Template PodTemplateSpec } // PodTemplateList is a list of PodTemplates. type PodTemplateList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta - Items []PodTemplate `json:"items"` + Items []PodTemplate } // ReplicationControllerSpec is the specification of a replication controller. @@ -1999,55 +1999,55 @@ type PodTemplateList struct { // a TemplateRef or a Template set. type ReplicationControllerSpec struct { // Replicas is the number of desired replicas. - Replicas int32 `json:"replicas"` + Replicas int32 // 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"` + MinReadySeconds int32 // Selector is a label query over pods that should match the Replicas count. - Selector map[string]string `json:"selector"` + Selector map[string]string // 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"` + //TemplateRef *ObjectReference // 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"` + Template *PodTemplateSpec } // ReplicationControllerStatus represents the current status of a replication // controller. type ReplicationControllerStatus struct { // Replicas is the number of actual replicas. - Replicas int32 `json:"replicas"` + Replicas int32 // The number of pods that have labels matching the labels of the pod template of the replication controller. // +optional - FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty"` + FullyLabeledReplicas int32 // The number of ready replicas for this replication controller. // +optional - ReadyReplicas int32 `json:"readyReplicas,omitempty"` + ReadyReplicas int32 // The number of available replicas (ready for at least minReadySeconds) for this replication controller. // +optional - AvailableReplicas int32 `json:"availableReplicas,omitempty"` + AvailableReplicas int32 // ObservedGeneration is the most recent generation observed by the controller. // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` + ObservedGeneration int64 // Represents the latest available observations of a replication controller's current state. // +optional - Conditions []ReplicationControllerCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` + Conditions []ReplicationControllerCondition } type ReplicationControllerConditionType string @@ -2063,45 +2063,45 @@ const ( // ReplicationControllerCondition describes the state of a replication controller at a certain point. type ReplicationControllerCondition struct { // Type of replication controller condition. - Type ReplicationControllerConditionType `json:"type"` + Type ReplicationControllerConditionType // Status of the condition, one of True, False, Unknown. - Status ConditionStatus `json:"status"` + Status ConditionStatus // The last time the condition transitioned from one status to another. // +optional - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` + LastTransitionTime metav1.Time // The reason for the condition's last transition. // +optional - Reason string `json:"reason,omitempty"` + Reason string // A human readable message indicating details about the transition. // +optional - Message string `json:"message,omitempty"` + Message string } // +genclient=true // ReplicationController represents the configuration of a replication controller. type ReplicationController struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - ObjectMeta `json:"metadata,omitempty"` + ObjectMeta // Spec defines the desired behavior of this replication controller. // +optional - Spec ReplicationControllerSpec `json:"spec,omitempty"` + Spec ReplicationControllerSpec // 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"` + Status ReplicationControllerStatus } // ReplicationControllerList is a collection of replication controllers. type ReplicationControllerList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta - Items []ReplicationController `json:"items"` + Items []ReplicationController } const ( @@ -2112,11 +2112,11 @@ const ( // ServiceList holds a list of services. type ServiceList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta - Items []Service `json:"items"` + Items []Service } // Session Affinity Type string @@ -2158,7 +2158,7 @@ type ServiceStatus struct { // LoadBalancer contains the current status of the load-balancer, // if one is present. // +optional - LoadBalancer LoadBalancerStatus `json:"loadBalancer,omitempty"` + LoadBalancer LoadBalancerStatus } // LoadBalancerStatus represents the status of a load-balancer @@ -2166,7 +2166,7 @@ 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"` + Ingress []LoadBalancerIngress } // LoadBalancerIngress represents the status of a load-balancer ingress point: @@ -2175,12 +2175,12 @@ 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"` + IP string // Hostname is set for load-balancer ingress points that are DNS based // (typically AWS load-balancers) // +optional - Hostname string `json:"hostname,omitempty"` + Hostname string } // ServiceSpec describes the attributes that a user creates on a service @@ -2200,10 +2200,10 @@ type ServiceSpec struct { // to the clusterIP. // More info: http://kubernetes.io/docs/user-guide/services#overview // +optional - Type ServiceType `json:"type,omitempty"` + Type ServiceType // Required: The list of ports that are exposed by this service. - Ports []ServicePort `json:"ports"` + Ports []ServicePort // Route service traffic to pods with label keys and values matching this // selector. If empty or not present, the service is assumed to have an @@ -2211,7 +2211,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 - Selector map[string]string `json:"selector"` + Selector map[string]string // ClusterIP is the IP address of the service and is usually assigned // randomly by the master. If an address is specified manually and is not in @@ -2223,7 +2223,7 @@ type ServiceSpec struct { // type is ExternalName. // More info: http://kubernetes.io/docs/user-guide/services#virtual-ips-and-service-proxies // +optional - ClusterIP string `json:"clusterIP,omitempty"` + ClusterIP string // ExternalName is the external reference that kubedns or equivalent will // return as a CNAME record for this service. No proxying will be involved. @@ -2233,7 +2233,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"` + ExternalIPs []string // Only applies to Service Type: LoadBalancer // LoadBalancer will get created with the IP specified in this field. @@ -2241,17 +2241,17 @@ type ServiceSpec struct { // 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"` + LoadBalancerIP string // Optional: Supports "ClientIP" and "None". Used to maintain session affinity. // +optional - SessionAffinity ServiceAffinity `json:"sessionAffinity,omitempty"` + SessionAffinity ServiceAffinity // 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"` + LoadBalancerSourceRanges []string } type ServicePort struct { @@ -2259,13 +2259,13 @@ type ServicePort struct { // name of this port within the service. This must be a DNS_LABEL. // All ports within a ServiceSpec must have unique names. This maps to // the 'Name' field in EndpointPort objects. - Name string `json:"name"` + Name string // The IP protocol for this port. Supports "TCP" and "UDP". - Protocol Protocol `json:"protocol"` + Protocol Protocol // The port that will be exposed on the service. - Port int32 `json:"port"` + Port int32 // Optional: The target port on pods selected by this service. If this // is a string, it will be looked up as a named port in the target @@ -2273,11 +2273,11 @@ type ServicePort struct { // of the 'port' field is used (an identity map). // This field is ignored for services with clusterIP=None, and should be // omitted or set equal to the 'port' field. - TargetPort intstr.IntOrString `json:"targetPort"` + TargetPort intstr.IntOrString // The port on each node on which this service is exposed. // Default is to auto-allocate a port if the ServiceType of this Service requires one. - NodePort int32 `json:"nodePort"` + NodePort int32 } // +genclient=true @@ -2286,17 +2286,17 @@ type ServicePort struct { // (for example 3306) that the proxy listens on, and the selector that determines which pods // will answer requests sent through the proxy. type Service struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - ObjectMeta `json:"metadata,omitempty"` + ObjectMeta // Spec defines the behavior of a service. // +optional - Spec ServiceSpec `json:"spec,omitempty"` + Spec ServiceSpec // Status represents the current status of a service. // +optional - Status ServiceStatus `json:"status,omitempty"` + Status ServiceStatus } // +genclient=true @@ -2306,27 +2306,27 @@ type Service struct { // * a principal that can be authenticated and authorized // * a set of secrets type ServiceAccount struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - ObjectMeta `json:"metadata,omitempty"` + ObjectMeta // Secrets is the list of secrets allowed to be used by pods running using this ServiceAccount - Secrets []ObjectReference `json:"secrets"` + Secrets []ObjectReference // 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"` + ImagePullSecrets []LocalObjectReference } // ServiceAccountList is a list of ServiceAccount objects type ServiceAccountList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta - Items []ServiceAccount `json:"items"` + Items []ServiceAccount } // +genclient=true @@ -2344,9 +2344,9 @@ type ServiceAccountList struct { // }, // ] type Endpoints struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - ObjectMeta `json:"metadata,omitempty"` + ObjectMeta // The set of all endpoints is the union of all subsets. Subsets []EndpointSubset @@ -2378,10 +2378,10 @@ type EndpointAddress struct { // Optional: Hostname of this endpoint // Meant to be used by DNS servers etc. // +optional - Hostname string `json:"hostname,omitempty"` + Hostname string // Optional: Node hosting this endpoint. This can be used to determine endpoints local to a node. // +optional - NodeName *string `json:"nodeName,omitempty"` + NodeName *string // Optional: The kubernetes object related to the entry point. TargetRef *ObjectReference } @@ -2401,11 +2401,11 @@ type EndpointPort struct { // EndpointsList is a list of endpoints. type EndpointsList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta - Items []Endpoints `json:"items"` + Items []Endpoints } // NodeSpec describes the attributes that a node is created with. @@ -2413,20 +2413,20 @@ 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"` + PodCIDR string // External ID of the node assigned by some machine database (e.g. a cloud provider) // +optional - ExternalID string `json:"externalID,omitempty"` + ExternalID string // ID of the node assigned by the cloud provider // Note: format is "://" // +optional - ProviderID string `json:"providerID,omitempty"` + ProviderID string // Unschedulable controls node schedulability of new pods. By default node is schedulable. // +optional - Unschedulable bool `json:"unschedulable,omitempty"` + Unschedulable bool } // DaemonEndpoint contains information about a single Daemon endpoint. @@ -2438,14 +2438,14 @@ type DaemonEndpoint struct { */ // Port number of the given endpoint. - Port int32 `json:"Port"` + Port int32 } // 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"` + KubeletEndpoint DaemonEndpoint } // NodeSystemInfo is a set of ids/uuids to uniquely identify the node. @@ -2453,61 +2453,61 @@ type NodeSystemInfo struct { // MachineID reported by the node. For unique machine identification // in the cluster this field is prefered. Learn more from man(5) // machine-id: http://man7.org/linux/man-pages/man5/machine-id.5.html - MachineID string `json:"machineID"` + MachineID string // SystemUUID reported by the node. For unique machine identification // MachineID is prefered. This field is specific to Red Hat hosts // https://access.redhat.com/documentation/en-US/Red_Hat_Subscription_Management/1/html/RHSM/getting-system-uuid.html - SystemUUID string `json:"systemUUID"` + SystemUUID string // Boot ID reported by the node. - BootID string `json:"bootID"` + BootID string // Kernel Version reported by the node. - KernelVersion string `json:"kernelVersion"` + KernelVersion string // OS Image reported by the node. - OSImage string `json:"osImage"` + OSImage string // ContainerRuntime Version reported by the node. - ContainerRuntimeVersion string `json:"containerRuntimeVersion"` + ContainerRuntimeVersion string // Kubelet Version reported by the node. - KubeletVersion string `json:"kubeletVersion"` + KubeletVersion string // KubeProxy Version reported by the node. - KubeProxyVersion string `json:"kubeProxyVersion"` + KubeProxyVersion string // The Operating System reported by the node - OperatingSystem string `json:"operatingSystem"` + OperatingSystem string // The Architecture reported by the node - Architecture string `json:"architecture"` + Architecture string } // 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"` + Capacity ResourceList // Allocatable represents the resources of a node that are available for scheduling. // +optional - Allocatable ResourceList `json:"allocatable,omitempty"` + Allocatable ResourceList // NodePhase is the current lifecycle phase of the node. // +optional - Phase NodePhase `json:"phase,omitempty"` + Phase NodePhase // Conditions is an array of current node conditions. // +optional - Conditions []NodeCondition `json:"conditions,omitempty"` + Conditions []NodeCondition // Queried from cloud provider, if available. // +optional - Addresses []NodeAddress `json:"addresses,omitempty"` + Addresses []NodeAddress // Endpoints of daemons running on the Node. // +optional - DaemonEndpoints NodeDaemonEndpoints `json:"daemonEndpoints,omitempty"` + DaemonEndpoints NodeDaemonEndpoints // Set of ids/uuids to uniquely identify the node. // +optional - NodeInfo NodeSystemInfo `json:"nodeInfo,omitempty"` + NodeInfo NodeSystemInfo // List of container images on this node // +optional - Images []ContainerImage `json:"images,omitempty"` + Images []ContainerImage // List of attachable volumes in use (mounted) by the node. // +optional - VolumesInUse []UniqueVolumeName `json:"volumesInUse,omitempty"` + VolumesInUse []UniqueVolumeName // List of volumes that are attached to the node. // +optional - VolumesAttached []AttachedVolume `json:"volumesAttached,omitempty"` + VolumesAttached []AttachedVolume } type UniqueVolumeName string @@ -2515,10 +2515,10 @@ type UniqueVolumeName string // AttachedVolume describes a volume attached to a node type AttachedVolume struct { // Name of the attached volume - Name UniqueVolumeName `json:"name"` + Name UniqueVolumeName // DevicePath represents the device path where the volume should be available - DevicePath string `json:"devicePath"` + DevicePath string } // AvoidPods describes pods that should avoid this node. This is the value for a @@ -2528,22 +2528,22 @@ 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"` + PreferAvoidPods []PreferAvoidPodsEntry } // Describes a class of pods that should avoid this node. type PreferAvoidPodsEntry struct { // The class of pods. - PodSignature PodSignature `json:"podSignature"` + PodSignature PodSignature // Time at which this entry was added to the list. // +optional - EvictionTime metav1.Time `json:"evictionTime,omitempty"` + EvictionTime metav1.Time // (brief) reason why this entry was added to the list. // +optional - Reason string `json:"reason,omitempty"` + Reason string // Human readable message indicating why this entry was added to the list. // +optional - Message string `json:"message,omitempty"` + Message string } // Describes the class of pods that should avoid this node. @@ -2551,16 +2551,16 @@ type PreferAvoidPodsEntry struct { type PodSignature struct { // Reference to controller whose pods should avoid this node. // +optional - PodController *OwnerReference `json:"podController,omitempty"` + PodController *OwnerReference } // Describe a container image type ContainerImage struct { // Names by which this image is known. - Names []string `json:"names"` + Names []string // The size of the image in bytes. // +optional - SizeBytes int64 `json:"sizeBytes,omitempty"` + SizeBytes int64 } type NodePhase string @@ -2595,16 +2595,16 @@ const ( ) type NodeCondition struct { - Type NodeConditionType `json:"type"` - Status ConditionStatus `json:"status"` + Type NodeConditionType + Status ConditionStatus // +optional - LastHeartbeatTime metav1.Time `json:"lastHeartbeatTime,omitempty"` + LastHeartbeatTime metav1.Time // +optional - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` + LastTransitionTime metav1.Time // +optional - Reason string `json:"reason,omitempty"` + Reason string // +optional - Message string `json:"message,omitempty"` + Message string } type NodeAddressType string @@ -2620,8 +2620,8 @@ const ( ) type NodeAddress struct { - Type NodeAddressType `json:"type"` - Address string `json:"address"` + Type NodeAddressType + Address string } // NodeResources is an object for conveying resource information about a node. @@ -2629,7 +2629,7 @@ type NodeAddress struct { type NodeResources struct { // Capacity represents the available resources of a node // +optional - Capacity ResourceList `json:"capacity,omitempty"` + Capacity ResourceList } // ResourceName is the name identifying various resources in a ResourceList. @@ -2666,26 +2666,26 @@ type ResourceList map[ResourceName]resource.Quantity // Node is a worker node in Kubernetes // The name of the node according to etcd is in ObjectMeta.Name. type Node struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - ObjectMeta `json:"metadata,omitempty"` + ObjectMeta // Spec defines the behavior of a node. // +optional - Spec NodeSpec `json:"spec,omitempty"` + Spec NodeSpec // Status describes the current status of a Node // +optional - Status NodeStatus `json:"status,omitempty"` + Status NodeStatus } // NodeList is a list of nodes. type NodeList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta - Items []Node `json:"items"` + Items []Node } // NamespaceSpec describes the attributes on a Namespace @@ -2707,7 +2707,7 @@ const ( type NamespaceStatus struct { // Phase is the current lifecycle phase of the namespace. // +optional - Phase NamespacePhase `json:"phase,omitempty"` + Phase NamespacePhase } type NamespacePhase string @@ -2726,71 +2726,71 @@ const ( // A namespace provides a scope for Names. // Use of multiple namespaces is optional type Namespace struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - ObjectMeta `json:"metadata,omitempty"` + ObjectMeta // Spec defines the behavior of the Namespace. // +optional - Spec NamespaceSpec `json:"spec,omitempty"` + Spec NamespaceSpec // Status describes the current status of a Namespace // +optional - Status NamespaceStatus `json:"status,omitempty"` + Status NamespaceStatus } // NamespaceList is a list of Namespaces. type NamespaceList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta - Items []Namespace `json:"items"` + Items []Namespace } // Binding ties one object to another - for example, a pod is bound to a node by a scheduler. type Binding struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // ObjectMeta describes the object that is being bound. // +optional - ObjectMeta `json:"metadata,omitempty"` + ObjectMeta // Target is the object to bind to. - Target ObjectReference `json:"target"` + Target ObjectReference } // 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"` + UID *types.UID } // DeleteOptions may be provided when deleting an API object type DeleteOptions struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // 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"` + GracePeriodSeconds *int64 // 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"` + Preconditions *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"` + OrphanDependents *bool } // ListOptions is the query options to a standard REST list call, and has future support for // watch calls. type ListOptions struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // A selector based on labels LabelSelector labels.Selector @@ -2844,27 +2844,27 @@ type PodLogOptions struct { // PodAttachOptions is the query options to a Pod's remote attach call // TODO: merge w/ PodExecOptions below for stdin, stdout, etc type PodAttachOptions struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // Stdin if true indicates that stdin is to be redirected for the attach call // +optional - Stdin bool `json:"stdin,omitempty"` + Stdin bool // Stdout if true indicates that stdout is to be redirected for the attach call // +optional - Stdout bool `json:"stdout,omitempty"` + Stdout bool // Stderr if true indicates that stderr is to be redirected for the attach call // +optional - Stderr bool `json:"stderr,omitempty"` + Stderr bool // TTY if true indicates that a tty will be allocated for the attach call // +optional - TTY bool `json:"tty,omitempty"` + TTY bool // Container to attach to. // +optional - Container string `json:"container,omitempty"` + Container string } // PodExecOptions is the query options to a Pod's remote exec call @@ -2923,35 +2923,35 @@ type ServiceProxyOptions struct { // is no namespace field. type OwnerReference struct { // API version of the referent. - APIVersion string `json:"apiVersion"` + APIVersion string // Kind of the referent. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds - Kind string `json:"kind"` + Kind string // Name of the referent. // More info: http://kubernetes.io/docs/user-guide/identifiers#names - Name string `json:"name"` + Name string // UID of the referent. // More info: http://kubernetes.io/docs/user-guide/identifiers#uids - UID types.UID `json:"uid"` + UID types.UID // If true, this reference points to the managing controller. // +optional - Controller *bool `json:"controller,omitempty"` + Controller *bool } // ObjectReference contains enough information to let you inspect or modify the referred object. type ObjectReference struct { // +optional - Kind string `json:"kind,omitempty"` + Kind string // +optional - Namespace string `json:"namespace,omitempty"` + Namespace string // +optional - Name string `json:"name,omitempty"` + Name string // +optional - UID types.UID `json:"uid,omitempty"` + UID types.UID // +optional - APIVersion string `json:"apiVersion,omitempty"` + APIVersion string // +optional - ResourceVersion string `json:"resourceVersion,omitempty"` + ResourceVersion string // 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 @@ -2962,7 +2962,7 @@ type ObjectReference struct { // 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"` + FieldPath string } // LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace. @@ -2972,18 +2972,18 @@ type LocalObjectReference struct { } type SerializedReference struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - Reference ObjectReference `json:"reference,omitempty"` + Reference ObjectReference } type EventSource struct { // Component from which the event is generated. // +optional - Component string `json:"component,omitempty"` + Component string // Node name on which the event is generated. // +optional - Host string `json:"host,omitempty"` + Host string } // Valid values for event types (new types could be added in future) @@ -2999,63 +2999,63 @@ const ( // Event is a report of an event somewhere in the cluster. // TODO: Decide whether to store these separately or with the object they apply to. type Event struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - ObjectMeta `json:"metadata,omitempty"` + ObjectMeta // Required. The object that this event is about. // +optional - InvolvedObject ObjectReference `json:"involvedObject,omitempty"` + InvolvedObject ObjectReference // 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"` + Reason string // Optional. A human-readable description of the status of this operation. // TODO: decide on maximum length. // +optional - Message string `json:"message,omitempty"` + Message string // Optional. The component reporting this event. Should be a short machine understandable string. // +optional - Source EventSource `json:"source,omitempty"` + Source EventSource // The time at which the event was first recorded. (Time of server receipt is in TypeMeta.) // +optional - FirstTimestamp metav1.Time `json:"firstTimestamp,omitempty"` + FirstTimestamp metav1.Time // The time at which the most recent occurrence of this event was recorded. // +optional - LastTimestamp metav1.Time `json:"lastTimestamp,omitempty"` + LastTimestamp metav1.Time // The number of times this event has occurred. // +optional - Count int32 `json:"count,omitempty"` + Count int32 // Type of this event (Normal, Warning), new types could be added in the future. // +optional - Type string `json:"type,omitempty"` + Type string } // EventList is a list of events. type EventList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta - Items []Event `json:"items"` + Items []Event } // List holds a list of objects, which may not be known by the server. type List struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta - Items []runtime.Object `json:"items"` + Items []runtime.Object } // A type of object that is limited @@ -3074,51 +3074,51 @@ const ( type LimitRangeItem struct { // Type of resource that this limit applies to // +optional - Type LimitType `json:"type,omitempty"` + Type LimitType // Max usage constraints on this kind by resource name // +optional - Max ResourceList `json:"max,omitempty"` + Max ResourceList // Min usage constraints on this kind by resource name // +optional - Min ResourceList `json:"min,omitempty"` + Min ResourceList // Default resource requirement limit value by resource name. // +optional - Default ResourceList `json:"default,omitempty"` + Default ResourceList // DefaultRequest resource requirement request value by resource name. // +optional - DefaultRequest ResourceList `json:"defaultRequest,omitempty"` + DefaultRequest ResourceList // MaxLimitRequestRatio represents the max burst value for the named resource // +optional - MaxLimitRequestRatio ResourceList `json:"maxLimitRequestRatio,omitempty"` + MaxLimitRequestRatio ResourceList } // LimitRangeSpec defines a min/max usage limit for resources that match on kind type LimitRangeSpec struct { // Limits is the list of LimitRangeItem objects that are enforced - Limits []LimitRangeItem `json:"limits"` + Limits []LimitRangeItem } // +genclient=true // LimitRange sets resource usage limits for each kind of resource in a Namespace type LimitRange struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - ObjectMeta `json:"metadata,omitempty"` + ObjectMeta // Spec defines the limits enforced // +optional - Spec LimitRangeSpec `json:"spec,omitempty"` + Spec LimitRangeSpec } // LimitRangeList is a list of LimitRange items. type LimitRangeList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta // Items is a list of LimitRange objects - Items []LimitRange `json:"items"` + Items []LimitRange } // The following identify resource constants for Kubernetes object types @@ -3171,48 +3171,48 @@ const ( type ResourceQuotaSpec struct { // Hard is the set of desired hard limits for each named resource // +optional - Hard ResourceList `json:"hard,omitempty"` + Hard ResourceList // 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"` + Scopes []ResourceQuotaScope } // 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"` + Hard ResourceList // Used is the current observed total usage of the resource in the namespace // +optional - Used ResourceList `json:"used,omitempty"` + Used ResourceList } // +genclient=true // ResourceQuota sets aggregate quota restrictions enforced per namespace type ResourceQuota struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - ObjectMeta `json:"metadata,omitempty"` + ObjectMeta // Spec defines the desired quota // +optional - Spec ResourceQuotaSpec `json:"spec,omitempty"` + Spec ResourceQuotaSpec // Status defines the actual enforced quota and its current usage // +optional - Status ResourceQuotaStatus `json:"status,omitempty"` + Status ResourceQuotaStatus } // ResourceQuotaList is a list of ResourceQuota items type ResourceQuotaList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta // Items is a list of ResourceQuota objects - Items []ResourceQuota `json:"items"` + Items []ResourceQuota } // +genclient=true @@ -3220,20 +3220,20 @@ type ResourceQuotaList struct { // Secret holds secret data of a certain type. The total bytes of the values in // the Data field must be less than MaxSecretSize bytes. type Secret struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - ObjectMeta `json:"metadata,omitempty"` + ObjectMeta // 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"` + Data map[string][]byte // Used to facilitate programmatic handling of secret data. // +optional - Type SecretType `json:"type,omitempty"` + Type SecretType } const MaxSecretSize = 1 * 1024 * 1024 @@ -3321,35 +3321,35 @@ const ( ) type SecretList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta - Items []Secret `json:"items"` + Items []Secret } // +genclient=true // ConfigMap holds configuration data for components or applications to consume. type ConfigMap struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - ObjectMeta `json:"metadata,omitempty"` + ObjectMeta // 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"` + Data map[string]string } // ConfigMapList is a resource containing a list of ConfigMap objects. type ConfigMapList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta // Items is the list of ConfigMaps. - Items []ConfigMap `json:"items"` + Items []ConfigMap } // These constants are for remote command execution and port forwarding and are @@ -3413,12 +3413,12 @@ const ( ) type ComponentCondition struct { - Type ComponentConditionType `json:"type"` - Status ConditionStatus `json:"status"` + Type ComponentConditionType + Status ConditionStatus // +optional - Message string `json:"message,omitempty"` + Message string // +optional - Error string `json:"error,omitempty"` + Error string } // +genclient=true @@ -3426,20 +3426,20 @@ type ComponentCondition struct { // ComponentStatus (and ComponentStatusList) holds the cluster validation info. type ComponentStatus struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - ObjectMeta `json:"metadata,omitempty"` + ObjectMeta // +optional - Conditions []ComponentCondition `json:"conditions,omitempty"` + Conditions []ComponentCondition } type ComponentStatusList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta - Items []ComponentStatus `json:"items"` + Items []ComponentStatus } // SecurityContext holds security configuration that will be applied to a container. @@ -3449,24 +3449,24 @@ 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"` + Capabilities *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"` + Privileged *bool // 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"` + SELinuxOptions *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"` + RunAsUser *int64 // 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 // does not run as UID 0 (root) and fail to start the container if it does. @@ -3474,27 +3474,27 @@ type SecurityContext struct { // 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"` + RunAsNonRoot *bool // 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"` + ReadOnlyRootFilesystem *bool } // SELinuxOptions are the labels to be applied to the container. type SELinuxOptions struct { // SELinux user label // +optional - User string `json:"user,omitempty"` + User string // SELinux role label // +optional - Role string `json:"role,omitempty"` + Role string // SELinux type label // +optional - Type string `json:"type,omitempty"` + Type string // SELinux level label. // +optional - Level string `json:"level,omitempty"` + Level string } // RangeAllocation is an opaque API object (not exposed to end users) that can be persisted to record @@ -3505,18 +3505,18 @@ type SELinuxOptions struct { // data encoding hints). A range allocation should *ALWAYS* be recreatable at any time by observation // of the cluster, thus the object is less strongly typed than most. type RangeAllocation struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - ObjectMeta `json:"metadata,omitempty"` + ObjectMeta // 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. - Range string `json:"range"` + Range string // A byte array representing the serialized state of a range allocation. Additional clarifiers on // the type or format of data should be represented with annotations. For IP allocations, this is // represented as a bit array starting at the base IP of the CIDR in Range, with each bit representing // a single allocated address (the fifth bit on CIDR 10.0.0.0/8 is 10.0.0.4). - Data []byte `json:"data"` + Data []byte } const ( diff --git a/pkg/apis/apps/types.go b/pkg/apis/apps/types.go index b9402708c6a..b389954314d 100644 --- a/pkg/apis/apps/types.go +++ b/pkg/apis/apps/types.go @@ -30,18 +30,18 @@ import ( // The StatefulSet guarantees that a given network identity will always // map to the same storage identity. type StatefulSet struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - api.ObjectMeta `json:"metadata,omitempty"` + api.ObjectMeta // Spec defines the desired identities of pods in this set. // +optional - Spec StatefulSetSpec `json:"spec,omitempty"` + Spec StatefulSetSpec // Status is the current status of Pods in this StatefulSet. This data // may be out of date by some window of time. // +optional - Status StatefulSetStatus `json:"status,omitempty"` + Status StatefulSetStatus } // A StatefulSetSpec is the specification of a StatefulSet. @@ -52,19 +52,19 @@ type StatefulSetSpec struct { // If unspecified, defaults to 1. // TODO: Consider a rename of this field. // +optional - Replicas int32 `json:"replicas,omitempty"` + Replicas int32 // 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 *metav1.LabelSelector `json:"selector,omitempty"` + Selector *metav1.LabelSelector // Template is the object that describes the pod that will be created if // insufficient replicas are detected. Each pod stamped out by the StatefulSet // will fulfill this Template, but have a unique identity from the rest // of the StatefulSet. - Template api.PodTemplateSpec `json:"template"` + Template api.PodTemplateSpec // VolumeClaimTemplates is a list of claims that pods are allowed to reference. // The StatefulSet controller is responsible for mapping network identities to @@ -74,30 +74,30 @@ type StatefulSetSpec struct { // 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"` + VolumeClaimTemplates []api.PersistentVolumeClaim // ServiceName is the name of the service that governs this StatefulSet. // This service must exist before the StatefulSet, and is responsible for // the network identity of the set. Pods get DNS/hostnames that follow the // pattern: pod-specific-string.serviceName.default.svc.cluster.local // where "pod-specific-string" is managed by the StatefulSet controller. - ServiceName string `json:"serviceName"` + ServiceName string } // StatefulSetStatus represents the current state of a StatefulSet. type StatefulSetStatus struct { // most recent generation observed by this autoscaler. // +optional - ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + ObservedGeneration *int64 // Replicas is the number of actual replicas. - Replicas int32 `json:"replicas"` + Replicas int32 } // StatefulSetList is a collection of StatefulSets. type StatefulSetList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` - Items []StatefulSet `json:"items"` + metav1.ListMeta + Items []StatefulSet } diff --git a/pkg/apis/autoscaling/types.go b/pkg/apis/autoscaling/types.go index 8170226bbd2..85e34729bd7 100644 --- a/pkg/apis/autoscaling/types.go +++ b/pkg/apis/autoscaling/types.go @@ -23,113 +23,113 @@ import ( // Scale represents a scaling request for a resource. type Scale struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // Standard object metadata; More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata. // +optional - api.ObjectMeta `json:"metadata,omitempty"` + api.ObjectMeta // 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"` + Spec ScaleSpec // 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"` + Status ScaleStatus } // 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"` + Replicas int32 } // ScaleStatus represents the current status of a scale subresource. type ScaleStatus struct { // actual number of observed instances of the scaled object. - Replicas int32 `json:"replicas"` + Replicas int32 // label query over pods that should match the replicas count. This is same // 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"` + Selector string } // CrossVersionObjectReference contains enough information to let you identify the referred resource. type CrossVersionObjectReference struct { // Kind of the referent; More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds" - Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"` + Kind string // Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names - Name string `json:"name" protobuf:"bytes,2,opt,name=name"` + Name string // API version of the referent // +optional - APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,3,opt,name=apiVersion"` + APIVersion string } // specification of a horizontal pod autoscaler. type HorizontalPodAutoscalerSpec struct { // reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption // and will set the desired number of pods by using its Scale subresource. - ScaleTargetRef CrossVersionObjectReference `json:"scaleTargetRef"` + ScaleTargetRef CrossVersionObjectReference // lower limit for the number of pods that can be set by the autoscaler, default 1. // +optional - MinReplicas *int32 `json:"minReplicas,omitempty"` + MinReplicas *int32 // upper limit for the number of pods that can be set by the autoscaler. It cannot be smaller than MinReplicas. - MaxReplicas int32 `json:"maxReplicas"` + MaxReplicas int32 // 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"` + TargetCPUUtilizationPercentage *int32 } // current status of a horizontal pod autoscaler type HorizontalPodAutoscalerStatus struct { // most recent generation observed by this autoscaler. // +optional - ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + ObservedGeneration *int64 // 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 *metav1.Time `json:"lastScaleTime,omitempty"` + LastScaleTime *metav1.Time // current number of replicas of pods managed by this autoscaler. - CurrentReplicas int32 `json:"currentReplicas"` + CurrentReplicas int32 // desired number of replicas of pods managed by this autoscaler. - DesiredReplicas int32 `json:"desiredReplicas"` + DesiredReplicas int32 // 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"` + CurrentCPUUtilizationPercentage *int32 } // +genclient=true // configuration of a horizontal pod autoscaler. type HorizontalPodAutoscaler struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - api.ObjectMeta `json:"metadata,omitempty"` + api.ObjectMeta // behaviour of autoscaler. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status. // +optional - Spec HorizontalPodAutoscalerSpec `json:"spec,omitempty"` + Spec HorizontalPodAutoscalerSpec // current information about the autoscaler. // +optional - Status HorizontalPodAutoscalerStatus `json:"status,omitempty"` + Status HorizontalPodAutoscalerStatus } // list of horizontal pod autoscaler objects. type HorizontalPodAutoscalerList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta // list of horizontal pod autoscaler objects. - Items []HorizontalPodAutoscaler `json:"items"` + Items []HorizontalPodAutoscaler } diff --git a/pkg/apis/batch/types.go b/pkg/apis/batch/types.go index 1b5bd4433f3..7cd12dfc776 100644 --- a/pkg/apis/batch/types.go +++ b/pkg/apis/batch/types.go @@ -25,47 +25,47 @@ import ( // Job represents the configuration of a single job. type Job struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // +optional - api.ObjectMeta `json:"metadata,omitempty"` + api.ObjectMeta // 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"` + Spec JobSpec // 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"` + Status JobStatus } // JobList is a collection of jobs. type JobList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // Standard list metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta // Items is the list of Job. - Items []Job `json:"items"` + Items []Job } // JobTemplate describes a template for creating copies of a predefined pod. type JobTemplate struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // +optional - api.ObjectMeta `json:"metadata,omitempty"` + api.ObjectMeta // 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"` + Template JobTemplateSpec } // JobTemplateSpec describes the data a Job should have when created from a template @@ -73,12 +73,12 @@ 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"` + api.ObjectMeta // 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"` + Spec JobSpec } // JobSpec describes how the job execution will look like. @@ -89,7 +89,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. // +optional - Parallelism *int32 `json:"parallelism,omitempty"` + Parallelism *int32 // Completions specifies the desired number of successfully finished pods the // job should be run with. Setting to nil means that the success of any @@ -97,17 +97,17 @@ 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. // +optional - Completions *int32 `json:"completions,omitempty"` + Completions *int32 // 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"` + ActiveDeadlineSeconds *int64 // Selector is a label query over pods that should match the pod count. // Normally, the system sets this field for you. // +optional - Selector *metav1.LabelSelector `json:"selector,omitempty"` + Selector *metav1.LabelSelector // ManualSelector controls generation of pod labels and pod selectors. // Leave `manualSelector` unset unless you are certain what you are doing. @@ -119,11 +119,11 @@ type JobSpec struct { // `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` // API. // +optional - ManualSelector *bool `json:"manualSelector,omitempty"` + ManualSelector *bool // Template is the object that describes the pod that will be created when // executing a job. - Template api.PodTemplateSpec `json:"template"` + Template api.PodTemplateSpec } // JobStatus represents the current state of a Job. @@ -131,31 +131,31 @@ 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"` + Conditions []JobCondition // 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 *metav1.Time `json:"startTime,omitempty"` + StartTime *metav1.Time // 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 *metav1.Time `json:"completionTime,omitempty"` + CompletionTime *metav1.Time // Active is the number of actively running pods. // +optional - Active int32 `json:"active,omitempty"` + Active int32 // Succeeded is the number of pods which reached Phase Succeeded. // +optional - Succeeded int32 `json:"succeeded,omitempty"` + Succeeded int32 // Failed is the number of pods which reached Phase Failed. // +optional - Failed int32 `json:"failed,omitempty"` + Failed int32 } type JobConditionType string @@ -171,79 +171,79 @@ const ( // JobCondition describes current state of a job. type JobCondition struct { // Type of job condition, Complete or Failed. - Type JobConditionType `json:"type"` + Type JobConditionType // Status of the condition, one of True, False, Unknown. - Status api.ConditionStatus `json:"status"` + Status api.ConditionStatus // Last time the condition was checked. // +optional - LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"` + LastProbeTime metav1.Time // Last time the condition transit from one status to another. // +optional - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` + LastTransitionTime metav1.Time // (brief) reason for the condition's last transition. // +optional - Reason string `json:"reason,omitempty"` + Reason string // Human readable message indicating details about last transition. // +optional - Message string `json:"message,omitempty"` + Message string } // +genclient=true // CronJob represents the configuration of a single cron job. type CronJob struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // +optional - api.ObjectMeta `json:"metadata,omitempty"` + api.ObjectMeta // 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 CronJobSpec `json:"spec,omitempty"` + Spec CronJobSpec // 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 CronJobStatus `json:"status,omitempty"` + Status CronJobStatus } // CronJobList is a collection of cron jobs. type CronJobList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // Standard list metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta // Items is the list of CronJob. - Items []CronJob `json:"items"` + Items []CronJob } // CronJobSpec describes how the job execution will look like and when it will actually run. type CronJobSpec struct { // Schedule contains the schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. - Schedule string `json:"schedule"` + Schedule string // 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"` + StartingDeadlineSeconds *int64 // ConcurrencyPolicy specifies how to treat concurrent executions of a Job. // +optional - ConcurrencyPolicy ConcurrencyPolicy `json:"concurrencyPolicy,omitempty"` + ConcurrencyPolicy 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"` + Suspend *bool // JobTemplate is the object that describes the job that will be created when // executing a CronJob. - JobTemplate JobTemplateSpec `json:"jobTemplate"` + JobTemplate JobTemplateSpec } // ConcurrencyPolicy describes how the job will be handled. @@ -268,9 +268,9 @@ const ( type CronJobStatus struct { // Active holds pointers to currently running jobs. // +optional - Active []api.ObjectReference `json:"active,omitempty"` + Active []api.ObjectReference // LastScheduleTime keeps information of when was the last time the job was successfully scheduled. // +optional - LastScheduleTime *metav1.Time `json:"lastScheduleTime,omitempty"` + LastScheduleTime *metav1.Time } diff --git a/pkg/apis/certificates/types.go b/pkg/apis/certificates/types.go index fc85afbf130..71bc07c21ac 100644 --- a/pkg/apis/certificates/types.go +++ b/pkg/apis/certificates/types.go @@ -26,17 +26,17 @@ import ( // Describes a certificate signing request type CertificateSigningRequest struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - api.ObjectMeta `json:"metadata,omitempty"` + api.ObjectMeta // The certificate request itself and any additional information. // +optional - Spec CertificateSigningRequestSpec `json:"spec,omitempty"` + Spec CertificateSigningRequestSpec // Derived information about the request. // +optional - Status CertificateSigningRequestStatus `json:"status,omitempty"` + Status CertificateSigningRequestStatus } // This information is immutable after the request is created. Only the Request @@ -44,26 +44,26 @@ type CertificateSigningRequest struct { // Kubernetes and cannot be modified by users. type CertificateSigningRequestSpec struct { // Base64-encoded PKCS#10 CSR data - Request []byte `json:"request"` + Request []byte // Information about the requesting user (if relevant) // See user.Info interface for details // +optional - Username string `json:"username,omitempty"` + Username string // +optional - UID string `json:"uid,omitempty"` + UID string // +optional - Groups []string `json:"groups,omitempty"` + Groups []string } type CertificateSigningRequestStatus struct { // Conditions applied to the request, such as approval or denial. // +optional - Conditions []CertificateSigningRequestCondition `json:"conditions,omitempty"` + Conditions []CertificateSigningRequestCondition // If request was approved, the controller will place the issued certificate here. // +optional - Certificate []byte `json:"certificate,omitempty"` + Certificate []byte } type RequestConditionType string @@ -76,23 +76,23 @@ const ( type CertificateSigningRequestCondition struct { // request approval state, currently Approved or Denied. - Type RequestConditionType `json:"type"` + Type RequestConditionType // brief reason for the request state // +optional - Reason string `json:"reason,omitempty"` + Reason string // human readable message with details about the request state // +optional - Message string `json:"message,omitempty"` + Message string // timestamp for the last update to this condition // +optional - LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"` + LastUpdateTime metav1.Time } type CertificateSigningRequestList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta // +optional - Items []CertificateSigningRequest `json:"items,omitempty"` + Items []CertificateSigningRequest } diff --git a/pkg/apis/componentconfig/types.go b/pkg/apis/componentconfig/types.go index 55e33e31646..3229f47dccb 100644 --- a/pkg/apis/componentconfig/types.go +++ b/pkg/apis/componentconfig/types.go @@ -27,64 +27,64 @@ type KubeProxyConfiguration struct { // bindAddress is the IP address for the proxy server to serve on (set to 0.0.0.0 // for all interfaces) - BindAddress string `json:"bindAddress"` + BindAddress string // clusterCIDR is the CIDR range of the pods in the cluster. It is used to // bridge traffic coming from outside of the cluster. If not provided, // no off-cluster bridging will be performed. - ClusterCIDR string `json:"clusterCIDR"` + ClusterCIDR string // healthzBindAddress is the IP address for the health check server to serve on, // defaulting to 127.0.0.1 (set to 0.0.0.0 for all interfaces) - HealthzBindAddress string `json:"healthzBindAddress"` + HealthzBindAddress string // healthzPort is the port to bind the health check server. Use 0 to disable. - HealthzPort int32 `json:"healthzPort"` + HealthzPort int32 // hostnameOverride, if non-empty, will be used as the identity instead of the actual hostname. - HostnameOverride string `json:"hostnameOverride"` + HostnameOverride string // iptablesMasqueradeBit is the bit of the iptables fwmark space to use for SNAT if using // the pure iptables proxy mode. Values must be within the range [0, 31]. - IPTablesMasqueradeBit *int32 `json:"iptablesMasqueradeBit"` + IPTablesMasqueradeBit *int32 // iptablesSyncPeriod is the period that iptables rules are refreshed (e.g. '5s', '1m', // '2h22m'). Must be greater than 0. - IPTablesSyncPeriod metav1.Duration `json:"iptablesSyncPeriodSeconds"` + IPTablesSyncPeriod metav1.Duration // iptablesMinSyncPeriod is the minimum period that iptables rules are refreshed (e.g. '5s', '1m', // '2h22m'). - IPTablesMinSyncPeriod metav1.Duration `json:"iptablesMinSyncPeriodSeconds"` + IPTablesMinSyncPeriod metav1.Duration // kubeconfigPath is the path to the kubeconfig file with authorization information (the // master location is set by the master flag). - KubeconfigPath string `json:"kubeconfigPath"` + KubeconfigPath string // masqueradeAll tells kube-proxy to SNAT everything if using the pure iptables proxy mode. - MasqueradeAll bool `json:"masqueradeAll"` + MasqueradeAll bool // master is the address of the Kubernetes API server (overrides any value in kubeconfig) - Master string `json:"master"` + Master string // oomScoreAdj is the oom-score-adj value for kube-proxy process. Values must be within // the range [-1000, 1000] - OOMScoreAdj *int32 `json:"oomScoreAdj"` + OOMScoreAdj *int32 // mode specifies which proxy mode to use. - Mode ProxyMode `json:"mode"` + Mode ProxyMode // portRange is the range of host ports (beginPort-endPort, inclusive) that may be consumed // in order to proxy service traffic. If unspecified (0-0) then ports will be randomly chosen. - PortRange string `json:"portRange"` + PortRange string // resourceContainer is the absolute name of the resource-only container to create and run // the Kube-proxy in (Default: /kube-proxy). - ResourceContainer string `json:"resourceContainer"` + ResourceContainer string // udpIdleTimeout is how long an idle UDP connection will be kept open (e.g. '250ms', '2s'). // Must be greater than 0. Only applicable for proxyMode=userspace. - UDPIdleTimeout metav1.Duration `json:"udpTimeoutMilliseconds"` + UDPIdleTimeout metav1.Duration // conntrackMax is the maximum number of NAT connections to track (0 to // leave as-is). This takes precedence over conntrackMaxPerCore and conntrackMin. - ConntrackMax int32 `json:"conntrackMax"` + ConntrackMax int32 // conntrackMaxPerCore is the maximum number of NAT connections to track // per CPU core (0 to leave the limit as-is and ignore conntrackMin). - ConntrackMaxPerCore int32 `json:"conntrackMaxPerCore"` + ConntrackMaxPerCore int32 // conntrackMin is the minimum value of connect-tracking records to allocate, // regardless of conntrackMaxPerCore (set conntrackMaxPerCore=0 to leave the limit as-is). - ConntrackMin int32 `json:"conntrackMin"` + ConntrackMin int32 // conntrackTCPEstablishedTimeout is how long an idle TCP connection will be kept open // (e.g. '2s'). Must be greater than 0. - ConntrackTCPEstablishedTimeout metav1.Duration `json:"conntrackTCPEstablishedTimeout"` + ConntrackTCPEstablishedTimeout metav1.Duration // conntrackTCPCloseWaitTimeout is how long an idle conntrack entry // in CLOSE_WAIT state will remain in the conntrack // table. (e.g. '60s'). Must be greater than 0 to set. - ConntrackTCPCloseWaitTimeout metav1.Duration `json:"conntrackTCPCloseWaitTimeout"` + ConntrackTCPCloseWaitTimeout metav1.Duration } // Currently two modes of proxying are available: 'userspace' (older, stable) or 'iptables' @@ -124,229 +124,229 @@ type KubeletConfiguration struct { // podManifestPath is the path to the directory containing pod manifests to // run, or the path to a single manifest file - PodManifestPath string `json:"podManifestPath"` + PodManifestPath string // syncFrequency is the max period between synchronizing running // containers and config - SyncFrequency metav1.Duration `json:"syncFrequency"` + SyncFrequency metav1.Duration // fileCheckFrequency is the duration between checking config files for // new data - FileCheckFrequency metav1.Duration `json:"fileCheckFrequency"` + FileCheckFrequency metav1.Duration // httpCheckFrequency is the duration between checking http for new data - HTTPCheckFrequency metav1.Duration `json:"httpCheckFrequency"` + HTTPCheckFrequency metav1.Duration // manifestURL is the URL for accessing the container manifest - ManifestURL string `json:"manifestURL"` + ManifestURL string // manifestURLHeader is the HTTP header to use when accessing the manifest // URL, with the key separated from the value with a ':', as in 'key:value' - ManifestURLHeader string `json:"manifestURLHeader"` + ManifestURLHeader string // enableServer enables the Kubelet's server - EnableServer bool `json:"enableServer"` + EnableServer bool // address is the IP address for the Kubelet to serve on (set to 0.0.0.0 // for all interfaces) - Address string `json:"address"` + Address string // port is the port for the Kubelet to serve on. - Port int32 `json:"port"` + Port int32 // readOnlyPort is the read-only port for the Kubelet to serve on with // no authentication/authorization (set to 0 to disable) - ReadOnlyPort int32 `json:"readOnlyPort"` + ReadOnlyPort int32 // tlsCertFile is the file containing x509 Certificate for HTTPS. (CA cert, // if any, concatenated after server cert). If tlsCertFile and // tlsPrivateKeyFile are not provided, a self-signed certificate // and key are generated for the public address and saved to the directory // passed to certDir. - TLSCertFile string `json:"tlsCertFile"` + TLSCertFile string // tlsPrivateKeyFile is the ile containing x509 private key matching // tlsCertFile. - TLSPrivateKeyFile string `json:"tlsPrivateKeyFile"` + TLSPrivateKeyFile string // certDirectory is the directory where the TLS certs are located (by // default /var/run/kubernetes). If tlsCertFile and tlsPrivateKeyFile // are provided, this flag will be ignored. - CertDirectory string `json:"certDirectory"` + CertDirectory string // authentication specifies how requests to the Kubelet's server are authenticated - Authentication KubeletAuthentication `json:"authentication"` + Authentication KubeletAuthentication // authorization specifies how requests to the Kubelet's server are authorized - Authorization KubeletAuthorization `json:"authorization"` + Authorization KubeletAuthorization // hostnameOverride is the hostname used to identify the kubelet instead // of the actual hostname. - HostnameOverride string `json:"hostnameOverride"` + HostnameOverride string // podInfraContainerImage is the image whose network/ipc namespaces // containers in each pod will use. - PodInfraContainerImage string `json:"podInfraContainerImage"` + PodInfraContainerImage string // dockerEndpoint is the path to the docker endpoint to communicate with. - DockerEndpoint string `json:"dockerEndpoint"` + DockerEndpoint string // rootDirectory is the directory path to place kubelet files (volume // mounts,etc). - RootDirectory string `json:"rootDirectory"` + RootDirectory string // seccompProfileRoot is the directory path for seccomp profiles. - SeccompProfileRoot string `json:"seccompProfileRoot"` + SeccompProfileRoot string // allowPrivileged enables containers to request privileged mode. // Defaults to false. - AllowPrivileged bool `json:"allowPrivileged"` + AllowPrivileged bool // hostNetworkSources is a comma-separated list of sources from which the // Kubelet allows pods to use of host network. Defaults to "*". Valid // options are "file", "http", "api", and "*" (all sources). - HostNetworkSources []string `json:"hostNetworkSources"` + HostNetworkSources []string // hostPIDSources is a comma-separated list of sources from which the // Kubelet allows pods to use the host pid namespace. Defaults to "*". - HostPIDSources []string `json:"hostPIDSources"` + HostPIDSources []string // hostIPCSources is a comma-separated list of sources from which the // Kubelet allows pods to use the host ipc namespace. Defaults to "*". - HostIPCSources []string `json:"hostIPCSources"` + HostIPCSources []string // registryPullQPS is the limit of registry pulls per second. If 0, // unlimited. Set to 0 for no limit. Defaults to 5.0. - RegistryPullQPS int32 `json:"registryPullQPS"` + RegistryPullQPS int32 // registryBurst is the maximum size of a bursty pulls, temporarily allows // pulls to burst to this number, while still not exceeding registryQps. // Only used if registryQPS > 0. - RegistryBurst int32 `json:"registryBurst"` + RegistryBurst int32 // eventRecordQPS is the maximum event creations per second. If 0, there // is no limit enforced. - EventRecordQPS int32 `json:"eventRecordQPS"` + EventRecordQPS int32 // eventBurst is the maximum size of a bursty event records, temporarily // allows event records to burst to this number, while still not exceeding // event-qps. Only used if eventQps > 0 - EventBurst int32 `json:"eventBurst"` + EventBurst int32 // enableDebuggingHandlers enables server endpoints for log collection // and local running of containers and commands - EnableDebuggingHandlers bool `json:"enableDebuggingHandlers"` + EnableDebuggingHandlers bool // minimumGCAge is the minimum age for a finished container before it is // garbage collected. - MinimumGCAge metav1.Duration `json:"minimumGCAge"` + MinimumGCAge metav1.Duration // maxPerPodContainerCount is the maximum number of old instances to // retain per container. Each container takes up some disk space. - MaxPerPodContainerCount int32 `json:"maxPerPodContainerCount"` + MaxPerPodContainerCount int32 // maxContainerCount is the maximum number of old instances of containers // to retain globally. Each container takes up some disk space. - MaxContainerCount int32 `json:"maxContainerCount"` + MaxContainerCount int32 // cAdvisorPort is the port of the localhost cAdvisor endpoint - CAdvisorPort int32 `json:"cAdvisorPort"` + CAdvisorPort int32 // healthzPort is the port of the localhost healthz endpoint - HealthzPort int32 `json:"healthzPort"` + HealthzPort int32 // healthzBindAddress is the IP address for the healthz server to serve // on. - HealthzBindAddress string `json:"healthzBindAddress"` + HealthzBindAddress string // oomScoreAdj is The oom-score-adj value for kubelet process. Values // must be within the range [-1000, 1000]. - OOMScoreAdj int32 `json:"oomScoreAdj"` + OOMScoreAdj int32 // registerNode enables automatic registration with the apiserver. - RegisterNode bool `json:"registerNode"` + RegisterNode bool // clusterDomain is the DNS domain for this cluster. If set, kubelet will // configure all containers to search this domain in addition to the // host's search domains. - ClusterDomain string `json:"clusterDomain"` + ClusterDomain string // masterServiceNamespace is The namespace from which the kubernetes // master services should be injected into pods. - MasterServiceNamespace string `json:"masterServiceNamespace"` + MasterServiceNamespace string // clusterDNS is the IP address for a cluster DNS server. If set, kubelet // will configure all containers to use this for DNS resolution in // addition to the host's DNS servers - ClusterDNS string `json:"clusterDNS"` + ClusterDNS string // streamingConnectionIdleTimeout is the maximum time a streaming connection // can be idle before the connection is automatically closed. - StreamingConnectionIdleTimeout metav1.Duration `json:"streamingConnectionIdleTimeout"` + StreamingConnectionIdleTimeout metav1.Duration // nodeStatusUpdateFrequency is the frequency that kubelet posts node // status to master. Note: be cautious when changing the constant, it // must work with nodeMonitorGracePeriod in nodecontroller. - NodeStatusUpdateFrequency metav1.Duration `json:"nodeStatusUpdateFrequency"` + NodeStatusUpdateFrequency metav1.Duration // imageMinimumGCAge is the minimum age for an unused image before it is // garbage collected. - ImageMinimumGCAge metav1.Duration `json:"imageMinimumGCAge"` + ImageMinimumGCAge metav1.Duration // imageGCHighThresholdPercent is the percent of disk usage after which // image garbage collection is always run. - ImageGCHighThresholdPercent int32 `json:"imageGCHighThresholdPercent"` + ImageGCHighThresholdPercent int32 // imageGCLowThresholdPercent is the percent of disk usage before which // image garbage collection is never run. Lowest disk usage to garbage // collect to. - ImageGCLowThresholdPercent int32 `json:"imageGCLowThresholdPercent"` + ImageGCLowThresholdPercent int32 // lowDiskSpaceThresholdMB is the absolute free disk space, in MB, to // maintain. When disk space falls below this threshold, new pods would // be rejected. - LowDiskSpaceThresholdMB int32 `json:"lowDiskSpaceThresholdMB"` + LowDiskSpaceThresholdMB int32 // How frequently to calculate and cache volume disk usage for all pods - VolumeStatsAggPeriod metav1.Duration `json:"volumeStatsAggPeriod"` + VolumeStatsAggPeriod metav1.Duration // networkPluginName is the name of the network plugin to be invoked for // various events in kubelet/pod lifecycle - NetworkPluginName string `json:"networkPluginName"` + NetworkPluginName string // networkPluginMTU is the MTU to be passed to the network plugin, // and overrides the default MTU for cases where it cannot be automatically // computed (such as IPSEC). - NetworkPluginMTU int32 `json:"networkPluginMTU"` + NetworkPluginMTU int32 // networkPluginDir is the full path of the directory in which to search // for network plugins (and, for backwards-compat, CNI config files) - NetworkPluginDir string `json:"networkPluginDir"` + NetworkPluginDir string // CNIConfDir is the full path of the directory in which to search for // CNI config files - CNIConfDir string `json:"cniConfDir"` + CNIConfDir string // CNIBinDir is the full path of the directory in which to search for // CNI plugin binaries - CNIBinDir string `json:"cniBinDir"` + CNIBinDir string // volumePluginDir is the full path of the directory in which to search // for additional third party volume plugins - VolumePluginDir string `json:"volumePluginDir"` + VolumePluginDir string // cloudProvider is the provider for cloud services. // +optional - CloudProvider string `json:"cloudProvider,omitempty"` + CloudProvider string // cloudConfigFile is the path to the cloud provider configuration file. // +optional - CloudConfigFile string `json:"cloudConfigFile,omitempty"` + CloudConfigFile string // KubeletCgroups is the absolute name of cgroups to isolate the kubelet in. // +optional - KubeletCgroups string `json:"kubeletCgroups,omitempty"` + KubeletCgroups string // 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 - ExperimentalCgroupsPerQOS bool `json:"experimentalCgroupsPerQOS,omitempty"` + ExperimentalCgroupsPerQOS bool // driver that the kubelet uses to manipulate cgroups on the host (cgroupfs or systemd) // +optional - CgroupDriver string `json:"cgroupDriver,omitempty"` + CgroupDriver string // Cgroups that container runtime is expected to be isolated in. // +optional - RuntimeCgroups string `json:"runtimeCgroups,omitempty"` + RuntimeCgroups string // 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"` + SystemCgroups string // CgroupRoot is the root cgroup to use for pods. // If ExperimentalCgroupsPerQOS is enabled, this is the root of the QoS cgroup hierarchy. // +optional - CgroupRoot string `json:"cgroupRoot,omitempty"` + CgroupRoot string // containerRuntime is the container runtime to use. - ContainerRuntime string `json:"containerRuntime"` + ContainerRuntime string // remoteRuntimeEndpoint is the endpoint of remote runtime service - RemoteRuntimeEndpoint string `json:"remoteRuntimeEndpoint"` + RemoteRuntimeEndpoint string // remoteImageEndpoint is the endpoint of remote image service - RemoteImageEndpoint string `json:"remoteImageEndpoint"` + RemoteImageEndpoint string // runtimeRequestTimeout is the timeout for all runtime requests except long running // requests - pull, logs, exec and attach. // +optional - RuntimeRequestTimeout metav1.Duration `json:"runtimeRequestTimeout,omitempty"` + RuntimeRequestTimeout metav1.Duration // If no pulling progress is made before the deadline imagePullProgressDeadline, // the image pulling will be cancelled. Defaults to 1m0s. // +optional - ImagePullProgressDeadline metav1.Duration `json:"imagePullProgressDeadline,omitempty"` + ImagePullProgressDeadline metav1.Duration // rktPath is the path of rkt binary. Leave empty to use the first rkt in // $PATH. // +optional - RktPath string `json:"rktPath,omitempty"` + RktPath string // experimentalMounterPath is the path of mounter binary. Leave empty to use the default mount path - ExperimentalMounterPath string `json:"experimentalMounterPath,omitempty"` + ExperimentalMounterPath string // rktApiEndpoint is the endpoint of the rkt API service to communicate with. // +optional - RktAPIEndpoint string `json:"rktAPIEndpoint,omitempty"` + RktAPIEndpoint string // rktStage1Image is the image to use as stage1. Local paths and // http/https URLs are supported. // +optional - RktStage1Image string `json:"rktStage1Image,omitempty"` + RktStage1Image string // 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 // that may be running. - LockFilePath string `json:"lockFilePath"` + LockFilePath string // ExitOnLockContention is a flag that signifies to the kubelet that it is running // in "bootstrap" mode. This requires that 'LockFilePath' has been set. // This will cause the kubelet to listen to inotify events on the lock file, // releasing it and exiting when another process tries to open that file. - ExitOnLockContention bool `json:"exitOnLockContention"` + ExitOnLockContention bool // How should the kubelet configure the container bridge for hairpin packets. // Setting this flag allows endpoints in a Service to loadbalance back to // themselves if they should try to access their own Service. Values: @@ -355,134 +355,134 @@ type KubeletConfiguration struct { // "none": do nothing. // Generally, one must set --hairpin-mode=veth-flag to achieve hairpin NAT, // because promiscous-bridge assumes the existence of a container bridge named cbr0. - HairpinMode string `json:"hairpinMode"` + HairpinMode string // The node has babysitter process monitoring docker and kubelet. - BabysitDaemons bool `json:"babysitDaemons"` + BabysitDaemons bool // maxPods is the number of pods that can run on this Kubelet. - MaxPods int32 `json:"maxPods"` + MaxPods int32 // nvidiaGPUs is the number of NVIDIA GPU devices on this node. - NvidiaGPUs int32 `json:"nvidiaGPUs"` + NvidiaGPUs int32 // dockerExecHandlerName is the handler to use when executing a command // in a container. Valid values are 'native' and 'nsenter'. Defaults to // 'native'. - DockerExecHandlerName string `json:"dockerExecHandlerName"` + DockerExecHandlerName string // The CIDR to use for pod IP addresses, only used in standalone mode. // In cluster mode, this is obtained from the master. - PodCIDR string `json:"podCIDR"` + PodCIDR string // ResolverConfig is the resolver configuration file used as the basis // for the container DNS resolution configuration."), [] - ResolverConfig string `json:"resolvConf"` + ResolverConfig string // cpuCFSQuota is Enable CPU CFS quota enforcement for containers that // specify CPU limits - CPUCFSQuota bool `json:"cpuCFSQuota"` + CPUCFSQuota bool // containerized should be set to true if kubelet is running in a container. - Containerized bool `json:"containerized"` + Containerized bool // maxOpenFiles is Number of files that can be opened by Kubelet process. - MaxOpenFiles int64 `json:"maxOpenFiles"` + MaxOpenFiles int64 // reconcileCIDR is Reconcile node CIDR with the CIDR specified by the // API server. Won't have any effect if register-node is false. - ReconcileCIDR bool `json:"reconcileCIDR"` + ReconcileCIDR bool // registerSchedulable tells the kubelet to register the node as // schedulable. Won't have any effect if register-node is false. // DEPRECATED: use registerWithTaints instead - RegisterSchedulable bool `json:"registerSchedulable"` + RegisterSchedulable bool // registerWithTaints are an array of taints to add to a node object when // the kubelet registers itself. This only takes effect when registerNode // is true and upon the initial registration of the node. - RegisterWithTaints []api.Taint `json:"registerWithTaints"` + RegisterWithTaints []api.Taint // contentType is contentType of requests sent to apiserver. - ContentType string `json:"contentType"` + ContentType string // kubeAPIQPS is the QPS to use while talking with kubernetes apiserver - KubeAPIQPS int32 `json:"kubeAPIQPS"` + KubeAPIQPS int32 // kubeAPIBurst is the burst to allow while talking with kubernetes // apiserver - KubeAPIBurst int32 `json:"kubeAPIBurst"` + KubeAPIBurst int32 // serializeImagePulls when enabled, tells the Kubelet to pull images one // at a time. We recommend *not* changing the default value on nodes that // run docker daemon with version < 1.9 or an Aufs storage backend. // Issue #10959 has more details. - SerializeImagePulls bool `json:"serializeImagePulls"` + SerializeImagePulls bool // outOfDiskTransitionFrequency is duration for which the kubelet has to // wait before transitioning out of out-of-disk node condition status. // +optional - OutOfDiskTransitionFrequency metav1.Duration `json:"outOfDiskTransitionFrequency,omitempty"` + OutOfDiskTransitionFrequency metav1.Duration // nodeIP is IP address of the node. If set, kubelet will use this IP // address for the node. // +optional - NodeIP string `json:"nodeIP,omitempty"` + NodeIP string // nodeLabels to add when registering the node in the cluster. - NodeLabels map[string]string `json:"nodeLabels"` + NodeLabels map[string]string // nonMasqueradeCIDR configures masquerading: traffic to IPs outside this range will use IP masquerade. - NonMasqueradeCIDR string `json:"nonMasqueradeCIDR"` + NonMasqueradeCIDR string // enable gathering custom metrics. - EnableCustomMetrics bool `json:"enableCustomMetrics"` + EnableCustomMetrics bool // Comma-delimited list of hard eviction expressions. For example, 'memory.available<300Mi'. // +optional - EvictionHard string `json:"evictionHard,omitempty"` + EvictionHard string // Comma-delimited list of soft eviction expressions. For example, 'memory.available<300Mi'. // +optional - EvictionSoft string `json:"evictionSoft,omitempty"` + EvictionSoft string // Comma-delimeted list of grace periods for each soft eviction signal. For example, 'memory.available=30s'. // +optional - EvictionSoftGracePeriod string `json:"evictionSoftGracePeriod,omitempty"` + EvictionSoftGracePeriod string // Duration for which the kubelet has to wait before transitioning out of an eviction pressure condition. // +optional - EvictionPressureTransitionPeriod metav1.Duration `json:"evictionPressureTransitionPeriod,omitempty"` + EvictionPressureTransitionPeriod metav1.Duration // 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"` + EvictionMaxPodGracePeriod int32 // 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"` + EvictionMinimumReclaim string // If enabled, the kubelet will integrate with the kernel memcg notification to determine if memory eviction thresholds are crossed rather than polling. // +optional - ExperimentalKernelMemcgNotification bool `json:"experimentalKernelMemcgNotification"` + ExperimentalKernelMemcgNotification bool // Maximum number of pods per core. Cannot exceed MaxPods - PodsPerCore int32 `json:"podsPerCore"` + PodsPerCore int32 // enableControllerAttachDetach enables the Attach/Detach controller to // manage attachment/detachment of volumes scheduled to this node, and // disables kubelet from executing any attach/detach operations - EnableControllerAttachDetach bool `json:"enableControllerAttachDetach"` + EnableControllerAttachDetach bool // A set of ResourceName=ResourceQuantity (e.g. cpu=200m,memory=150G) pairs // that describe resources reserved for non-kubernetes components. // Currently only cpu and memory are supported. [default=none] // See http://kubernetes.io/docs/user-guide/compute-resources for more detail. - SystemReserved utilconfig.ConfigurationMap `json:"systemReserved"` + SystemReserved utilconfig.ConfigurationMap // A set of ResourceName=ResourceQuantity (e.g. cpu=200m,memory=150G) pairs // that describe resources reserved for kubernetes system components. // Currently only cpu and memory are supported. [default=none] // See http://kubernetes.io/docs/user-guide/compute-resources for more detail. - KubeReserved utilconfig.ConfigurationMap `json:"kubeReserved"` + KubeReserved utilconfig.ConfigurationMap // Default behaviour for kernel tuning - ProtectKernelDefaults bool `json:"protectKernelDefaults"` + ProtectKernelDefaults bool // If true, Kubelet ensures a set of iptables rules are present on host. // These rules will serve as utility for various components, e.g. kube-proxy. // The rules will be created based on IPTablesMasqueradeBit and IPTablesDropBit. - MakeIPTablesUtilChains bool `json:"makeIPTablesUtilChains"` + MakeIPTablesUtilChains bool // iptablesMasqueradeBit is the bit of the iptables fwmark space to use for SNAT // Values must be within the range [0, 31]. // Warning: Please match the value of corresponding parameter in kube-proxy // TODO: clean up IPTablesMasqueradeBit in kube-proxy - IPTablesMasqueradeBit int32 `json:"iptablesMasqueradeBit"` + IPTablesMasqueradeBit int32 // iptablesDropBit is the bit of the iptables fwmark space to use for dropping packets. Kubelet will ensure iptables mark and drop rules. // Values must be within the range [0, 31]. Must be different from IPTablesMasqueradeBit - IPTablesDropBit int32 `json:"iptablesDropBit"` + IPTablesDropBit int32 // Whitelist of unsafe sysctls or sysctl patterns (ending in *). // +optional - AllowedUnsafeSysctls []string `json:"experimentalAllowedUnsafeSysctls,omitempty"` + AllowedUnsafeSysctls []string // featureGates is a string of comma-separated key=value pairs that describe feature // gates for alpha/experimental features. - FeatureGates string `json:"featureGates"` + FeatureGates string // Enable Container Runtime Interface (CRI) integration. // +optional - EnableCRI bool `json:"enableCRI,omitempty"` + EnableCRI bool // TODO(#34726:1.8.0): Remove the opt-in for failing when swap is enabled. // Tells the Kubelet to fail to start if swap is enabled on the node. - ExperimentalFailSwapOn bool `json:"experimentalFailSwapOn,omitempty"` + ExperimentalFailSwapOn bool // This flag, if set, enables a check prior to mount operations to verify that the required components // (binaries, etc.) to mount the volume are available on the underlying node. If the check is enabled // and fails the mount operation fails. - ExperimentalCheckNodeCapabilitiesBeforeMount bool `json:"ExperimentalCheckNodeCapabilitiesBeforeMount,omitempty"` + ExperimentalCheckNodeCapabilitiesBeforeMount bool } type KubeletAuthorizationMode string @@ -498,82 +498,82 @@ type KubeletAuthorization struct { // mode is the authorization mode to apply to requests to the kubelet server. // Valid values are AlwaysAllow and Webhook. // Webhook mode uses the SubjectAccessReview API to determine authorization. - Mode KubeletAuthorizationMode `json:"mode"` + Mode KubeletAuthorizationMode // webhook contains settings related to Webhook authorization. - Webhook KubeletWebhookAuthorization `json:"webhook"` + Webhook KubeletWebhookAuthorization } type KubeletWebhookAuthorization struct { // cacheAuthorizedTTL is the duration to cache 'authorized' responses from the webhook authorizer. - CacheAuthorizedTTL metav1.Duration `json:"cacheAuthorizedTTL"` + CacheAuthorizedTTL metav1.Duration // cacheUnauthorizedTTL is the duration to cache 'unauthorized' responses from the webhook authorizer. - CacheUnauthorizedTTL metav1.Duration `json:"cacheUnauthorizedTTL"` + CacheUnauthorizedTTL metav1.Duration } type KubeletAuthentication struct { // x509 contains settings related to x509 client certificate authentication - X509 KubeletX509Authentication `json:"x509"` + X509 KubeletX509Authentication // webhook contains settings related to webhook bearer token authentication - Webhook KubeletWebhookAuthentication `json:"webhook"` + Webhook KubeletWebhookAuthentication // anonymous contains settings related to anonymous authentication - Anonymous KubeletAnonymousAuthentication `json:"anonymous"` + Anonymous KubeletAnonymousAuthentication } type KubeletX509Authentication struct { // clientCAFile is the path to a PEM-encoded certificate bundle. If set, any request presenting a client certificate // signed by one of the authorities in the bundle is authenticated with a username corresponding to the CommonName, // and groups corresponding to the Organization in the client certificate. - ClientCAFile string `json:"clientCAFile"` + ClientCAFile string } type KubeletWebhookAuthentication struct { // enabled allows bearer token authentication backed by the tokenreviews.authentication.k8s.io API - Enabled bool `json:"enabled"` + Enabled bool // cacheTTL enables caching of authentication results - CacheTTL metav1.Duration `json:"cacheTTL"` + CacheTTL metav1.Duration } type KubeletAnonymousAuthentication struct { // enabled allows anonymous requests to the kubelet server. // Requests that are not rejected by another authentication method are treated as anonymous requests. // Anonymous requests have a username of system:anonymous, and a group name of system:unauthenticated. - Enabled bool `json:"enabled"` + Enabled bool } type KubeSchedulerConfiguration struct { metav1.TypeMeta // port is the port that the scheduler's http service runs on. - Port int32 `json:"port"` + Port int32 // address is the IP address to serve on. - Address string `json:"address"` + Address string // algorithmProvider is the scheduling algorithm provider to use. - AlgorithmProvider string `json:"algorithmProvider"` + AlgorithmProvider string // policyConfigFile is the filepath to the scheduler policy configuration. - PolicyConfigFile string `json:"policyConfigFile"` + PolicyConfigFile string // enableProfiling enables profiling via web interface. - EnableProfiling bool `json:"enableProfiling"` + EnableProfiling bool // enableContentionProfiling enables lock contention profiling, if enableProfiling is true. - EnableContentionProfiling bool `json:"enableContentionProfiling"` + EnableContentionProfiling bool // contentType is contentType of requests sent to apiserver. - ContentType string `json:"contentType"` + ContentType string // kubeAPIQPS is the QPS to use while talking with kubernetes apiserver. - KubeAPIQPS float32 `json:"kubeAPIQPS"` + KubeAPIQPS float32 // kubeAPIBurst is the QPS burst to use while talking with kubernetes apiserver. - KubeAPIBurst int32 `json:"kubeAPIBurst"` + KubeAPIBurst int32 // schedulerName is name of the scheduler, used to select which pods // will be processed by this scheduler, based on pod's annotation with // key 'scheduler.alpha.kubernetes.io/name'. - SchedulerName string `json:"schedulerName"` + SchedulerName string // RequiredDuringScheduling affinity is not symmetric, but there is an implicit PreferredDuringScheduling affinity rule // corresponding to every RequiredDuringScheduling affinity rule. // HardPodAffinitySymmetricWeight represents the weight of implicit PreferredDuringScheduling affinity rule, in the range 0-100. - HardPodAffinitySymmetricWeight int `json:"hardPodAffinitySymmetricWeight"` + HardPodAffinitySymmetricWeight int // Indicate the "all topologies" set for empty topologyKey when it's used for PreferredDuringScheduling pod anti-affinity. - FailureDomains string `json:"failureDomains"` + FailureDomains string // leaderElection defines the configuration of leader election client. - LeaderElection LeaderElectionConfiguration `json:"leaderElection"` + LeaderElection LeaderElectionConfiguration } // LeaderElectionConfiguration defines the configuration of leader election @@ -582,199 +582,199 @@ type LeaderElectionConfiguration struct { // leaderElect enables a leader election client to gain leadership // before executing the main loop. Enable this when running replicated // components for high availability. - LeaderElect bool `json:"leaderElect"` + LeaderElect bool // leaseDuration is the duration that non-leader candidates will wait // after observing a leadership renewal until attempting to acquire // leadership of a led but unrenewed leader slot. This is effectively the // maximum duration that a leader can be stopped before it is replaced // by another candidate. This is only applicable if leader election is // enabled. - LeaseDuration metav1.Duration `json:"leaseDuration"` + LeaseDuration metav1.Duration // renewDeadline is the interval between attempts by the acting master to // renew a leadership slot before it stops leading. This must be less // than or equal to the lease duration. This is only applicable if leader // election is enabled. - RenewDeadline metav1.Duration `json:"renewDeadline"` + RenewDeadline metav1.Duration // retryPeriod is the duration the clients should wait between attempting // acquisition and renewal of a leadership. This is only applicable if // leader election is enabled. - RetryPeriod metav1.Duration `json:"retryPeriod"` + RetryPeriod metav1.Duration } type KubeControllerManagerConfiguration struct { metav1.TypeMeta // port is the port that the controller-manager's http service runs on. - Port int32 `json:"port"` + Port int32 // address is the IP address to serve on (set to 0.0.0.0 for all interfaces). - Address string `json:"address"` + Address string // useServiceAccountCredentials indicates whether controllers should be run with // individual service account credentials. - UseServiceAccountCredentials bool `json:"useServiceAccountCredentials"` + UseServiceAccountCredentials bool // cloudProvider is the provider for cloud services. - CloudProvider string `json:"cloudProvider"` + CloudProvider string // cloudConfigFile is the path to the cloud provider configuration file. - CloudConfigFile string `json:"cloudConfigFile"` + CloudConfigFile string // concurrentEndpointSyncs is the number of endpoint syncing operations // that will be done concurrently. Larger number = faster endpoint updating, // but more CPU (and network) load. - ConcurrentEndpointSyncs int32 `json:"concurrentEndpointSyncs"` + ConcurrentEndpointSyncs int32 // concurrentRSSyncs is the number of replica sets that are allowed to sync // concurrently. Larger number = more responsive replica management, but more // CPU (and network) load. - ConcurrentRSSyncs int32 `json:"concurrentRSSyncs"` + ConcurrentRSSyncs int32 // concurrentRCSyncs is the number of replication controllers that are // allowed to sync concurrently. Larger number = more responsive replica // management, but more CPU (and network) load. - ConcurrentRCSyncs int32 `json:"concurrentRCSyncs"` + ConcurrentRCSyncs int32 // concurrentServiceSyncs is the number of services that are // allowed to sync concurrently. Larger number = more responsive service // management, but more CPU (and network) load. - ConcurrentServiceSyncs int32 `json:"concurrentServiceSyncs"` + ConcurrentServiceSyncs int32 // concurrentResourceQuotaSyncs is the number of resource quotas that are // allowed to sync concurrently. Larger number = more responsive quota // management, but more CPU (and network) load. - ConcurrentResourceQuotaSyncs int32 `json:"concurrentResourceQuotaSyncs"` + ConcurrentResourceQuotaSyncs int32 // concurrentDeploymentSyncs is the number of deployment objects that are // allowed to sync concurrently. Larger number = more responsive deployments, // but more CPU (and network) load. - ConcurrentDeploymentSyncs int32 `json:"concurrentDeploymentSyncs"` + ConcurrentDeploymentSyncs int32 // concurrentDaemonSetSyncs is the number of daemonset objects that are // allowed to sync concurrently. Larger number = more responsive daemonset, // but more CPU (and network) load. - ConcurrentDaemonSetSyncs int32 `json:"concurrentDaemonSetSyncs"` + ConcurrentDaemonSetSyncs int32 // concurrentJobSyncs is the number of job objects that are // allowed to sync concurrently. Larger number = more responsive jobs, // but more CPU (and network) load. - ConcurrentJobSyncs int32 `json:"concurrentJobSyncs"` + ConcurrentJobSyncs int32 // concurrentNamespaceSyncs is the number of namespace objects that are // allowed to sync concurrently. - ConcurrentNamespaceSyncs int32 `json:"concurrentNamespaceSyncs"` + ConcurrentNamespaceSyncs int32 // concurrentSATokenSyncs is the number of service account token syncing operations // that will be done concurrently. - ConcurrentSATokenSyncs int32 `json:"concurrentSATokenSyncs"` + ConcurrentSATokenSyncs int32 // lookupCacheSizeForRC is the size of lookup cache for replication controllers. // Larger number = more responsive replica management, but more MEM load. - LookupCacheSizeForRC int32 `json:"lookupCacheSizeForRC"` + LookupCacheSizeForRC int32 // lookupCacheSizeForRS is the size of lookup cache for replicatsets. // Larger number = more responsive replica management, but more MEM load. - LookupCacheSizeForRS int32 `json:"lookupCacheSizeForRS"` + LookupCacheSizeForRS int32 // lookupCacheSizeForDaemonSet is the size of lookup cache for daemonsets. // Larger number = more responsive daemonset, but more MEM load. - LookupCacheSizeForDaemonSet int32 `json:"lookupCacheSizeForDaemonSet"` + LookupCacheSizeForDaemonSet int32 // serviceSyncPeriod is the period for syncing services with their external // load balancers. - ServiceSyncPeriod metav1.Duration `json:"serviceSyncPeriod"` + ServiceSyncPeriod metav1.Duration // nodeSyncPeriod is the period for syncing nodes from cloudprovider. Longer // periods will result in fewer calls to cloud provider, but may delay addition // of new nodes to cluster. - NodeSyncPeriod metav1.Duration `json:"nodeSyncPeriod"` + NodeSyncPeriod metav1.Duration // routeReconciliationPeriod is the period for reconciling routes created for Nodes by cloud provider.. - RouteReconciliationPeriod metav1.Duration `json:"routeReconciliationPeriod"` + RouteReconciliationPeriod metav1.Duration // resourceQuotaSyncPeriod is the period for syncing quota usage status // in the system. - ResourceQuotaSyncPeriod metav1.Duration `json:"resourceQuotaSyncPeriod"` + ResourceQuotaSyncPeriod metav1.Duration // namespaceSyncPeriod is the period for syncing namespace life-cycle // updates. - NamespaceSyncPeriod metav1.Duration `json:"namespaceSyncPeriod"` + NamespaceSyncPeriod metav1.Duration // pvClaimBinderSyncPeriod is the period for syncing persistent volumes // and persistent volume claims. - PVClaimBinderSyncPeriod metav1.Duration `json:"pvClaimBinderSyncPeriod"` + PVClaimBinderSyncPeriod metav1.Duration // minResyncPeriod is the resync period in reflectors; will be random between // minResyncPeriod and 2*minResyncPeriod. - MinResyncPeriod metav1.Duration `json:"minResyncPeriod"` + MinResyncPeriod metav1.Duration // terminatedPodGCThreshold is the number of terminated pods that can exist // before the terminated pod garbage collector starts deleting terminated pods. // If <= 0, the terminated pod garbage collector is disabled. - TerminatedPodGCThreshold int32 `json:"terminatedPodGCThreshold"` + TerminatedPodGCThreshold int32 // horizontalPodAutoscalerSyncPeriod is the period for syncing the number of // pods in horizontal pod autoscaler. - HorizontalPodAutoscalerSyncPeriod metav1.Duration `json:"horizontalPodAutoscalerSyncPeriod"` + HorizontalPodAutoscalerSyncPeriod metav1.Duration // deploymentControllerSyncPeriod is the period for syncing the deployments. - DeploymentControllerSyncPeriod metav1.Duration `json:"deploymentControllerSyncPeriod"` + DeploymentControllerSyncPeriod metav1.Duration // podEvictionTimeout is the grace period for deleting pods on failed nodes. - PodEvictionTimeout metav1.Duration `json:"podEvictionTimeout"` + PodEvictionTimeout metav1.Duration // DEPRECATED: deletingPodsQps is the number of nodes per second on which pods are deleted in // case of node failure. - DeletingPodsQps float32 `json:"deletingPodsQps"` + DeletingPodsQps float32 // DEPRECATED: deletingPodsBurst is the number of nodes on which pods are bursty deleted in // case of node failure. For more details look into RateLimiter. - DeletingPodsBurst int32 `json:"deletingPodsBurst"` + DeletingPodsBurst int32 // nodeMontiorGracePeriod is the amount of time which we allow a running node to be // unresponsive before marking it unhealthy. Must be N times more than kubelet's // nodeStatusUpdateFrequency, where N means number of retries allowed for kubelet // to post node status. - NodeMonitorGracePeriod metav1.Duration `json:"nodeMonitorGracePeriod"` + NodeMonitorGracePeriod metav1.Duration // registerRetryCount is the number of retries for initial node registration. // Retry interval equals node-sync-period. - RegisterRetryCount int32 `json:"registerRetryCount"` + RegisterRetryCount int32 // nodeStartupGracePeriod is the amount of time which we allow starting a node to // be unresponsive before marking it unhealthy. - NodeStartupGracePeriod metav1.Duration `json:"nodeStartupGracePeriod"` + NodeStartupGracePeriod metav1.Duration // nodeMonitorPeriod is the period for syncing NodeStatus in NodeController. - NodeMonitorPeriod metav1.Duration `json:"nodeMonitorPeriod"` + NodeMonitorPeriod metav1.Duration // serviceAccountKeyFile is the filename containing a PEM-encoded private RSA key // used to sign service account tokens. - ServiceAccountKeyFile string `json:"serviceAccountKeyFile"` + ServiceAccountKeyFile string // clusterSigningCertFile is the filename containing a PEM-encoded // X509 CA certificate used to issue cluster-scoped certificates - ClusterSigningCertFile string `json:"clusterSigningCertFile"` + ClusterSigningCertFile string // clusterSigningCertFile is the filename containing a PEM-encoded // RSA or ECDSA private key used to issue cluster-scoped certificates - ClusterSigningKeyFile string `json:"clusterSigningKeyFile"` + ClusterSigningKeyFile string // approveAllKubeletCSRs tells the CSR controller to approve all CSRs originating // from the kubelet bootstrapping group automatically. // WARNING: this grants all users with access to the certificates API group // the ability to create credentials for any user that has access to the boostrapping // user's credentials. - ApproveAllKubeletCSRsForGroup string `json:"approveAllKubeletCSRsForGroup"` + ApproveAllKubeletCSRsForGroup string // enableProfiling enables profiling via web interface host:port/debug/pprof/ - EnableProfiling bool `json:"enableProfiling"` + EnableProfiling bool // clusterName is the instance prefix for the cluster. - ClusterName string `json:"clusterName"` + ClusterName string // clusterCIDR is CIDR Range for Pods in cluster. - ClusterCIDR string `json:"clusterCIDR"` + ClusterCIDR string // serviceCIDR is CIDR Range for Services in cluster. - ServiceCIDR string `json:"serviceCIDR"` + ServiceCIDR string // NodeCIDRMaskSize is the mask size for node cidr in cluster. - NodeCIDRMaskSize int32 `json:"nodeCIDRMaskSize"` + NodeCIDRMaskSize int32 // allocateNodeCIDRs enables CIDRs for Pods to be allocated and, if // ConfigureCloudRoutes is true, to be set on the cloud provider. - AllocateNodeCIDRs bool `json:"allocateNodeCIDRs"` + AllocateNodeCIDRs bool // configureCloudRoutes enables CIDRs allocated with allocateNodeCIDRs // to be configured on the cloud provider. - ConfigureCloudRoutes bool `json:"configureCloudRoutes"` + ConfigureCloudRoutes bool // rootCAFile is the root certificate authority will be included in service // account's token secret. This must be a valid PEM-encoded CA bundle. - RootCAFile string `json:"rootCAFile"` + RootCAFile string // contentType is contentType of requests sent to apiserver. - ContentType string `json:"contentType"` + ContentType string // kubeAPIQPS is the QPS to use while talking with kubernetes apiserver. - KubeAPIQPS float32 `json:"kubeAPIQPS"` + KubeAPIQPS float32 // kubeAPIBurst is the burst to use while talking with kubernetes apiserver. - KubeAPIBurst int32 `json:"kubeAPIBurst"` + KubeAPIBurst int32 // leaderElection defines the configuration of leader election client. - LeaderElection LeaderElectionConfiguration `json:"leaderElection"` + LeaderElection LeaderElectionConfiguration // volumeConfiguration holds configuration for volume related features. - VolumeConfiguration VolumeConfiguration `json:"volumeConfiguration"` + VolumeConfiguration VolumeConfiguration // How long to wait between starting controller managers - ControllerStartInterval metav1.Duration `json:"controllerStartInterval"` + ControllerStartInterval metav1.Duration // enables the generic garbage collector. MUST be synced with the // corresponding flag of the kube-apiserver. WARNING: the generic garbage // collector is an alpha feature. - EnableGarbageCollector bool `json:"enableGarbageCollector"` + EnableGarbageCollector bool // concurrentGCSyncs is the number of garbage collector workers that are // allowed to sync concurrently. - ConcurrentGCSyncs int32 `json:"concurrentGCSyncs"` + ConcurrentGCSyncs int32 // nodeEvictionRate is the number of nodes per second on which pods are deleted in case of node failure when a zone is healthy - NodeEvictionRate float32 `json:"nodeEvictionRate"` + NodeEvictionRate float32 // secondaryNodeEvictionRate is the number of nodes per second on which pods are deleted in case of node failure when a zone is unhealty - SecondaryNodeEvictionRate float32 `json:"secondaryNodeEvictionRate"` + SecondaryNodeEvictionRate float32 // secondaryNodeEvictionRate is implicitly overridden to 0 for clusters smaller than or equal to largeClusterSizeThreshold - LargeClusterSizeThreshold int32 `json:"largeClusterSizeThreshold"` + LargeClusterSizeThreshold int32 // Zone is treated as unhealthy in nodeEvictionRate and secondaryNodeEvictionRate when at least // unhealthyZoneThreshold (no less than 3) of Nodes in the zone are NotReady - UnhealthyZoneThreshold float32 `json:"unhealthyZoneThreshold"` + UnhealthyZoneThreshold float32 } // VolumeConfiguration contains *all* enumerated flags meant to configure all volume @@ -787,40 +787,40 @@ type VolumeConfiguration struct { // cloud provider. This allows testing and development of provisioning features. HostPath // provisioning is not supported in any way, won't work in a multi-node cluster, and // should not be used for anything other than testing or development. - EnableHostPathProvisioning bool `json:"enableHostPathProvisioning"` + EnableHostPathProvisioning bool // enableDynamicProvisioning enables the provisioning of volumes when running within an environment // that supports dynamic provisioning. Defaults to true. - EnableDynamicProvisioning bool `json:"enableDynamicProvisioning"` + EnableDynamicProvisioning bool // persistentVolumeRecyclerConfiguration holds configuration for persistent volume plugins. - PersistentVolumeRecyclerConfiguration PersistentVolumeRecyclerConfiguration `json:"persitentVolumeRecyclerConfiguration"` + PersistentVolumeRecyclerConfiguration PersistentVolumeRecyclerConfiguration // volumePluginDir is the full path of the directory in which the flex // volume plugin should search for additional third party volume plugins - FlexVolumePluginDir string `json:"flexVolumePluginDir"` + FlexVolumePluginDir string } type PersistentVolumeRecyclerConfiguration struct { // maximumRetry is number of retries the PV recycler will execute on failure to recycle // PV. - MaximumRetry int32 `json:"maximumRetry"` + MaximumRetry int32 // minimumTimeoutNFS is the minimum ActiveDeadlineSeconds to use for an NFS Recycler // pod. - MinimumTimeoutNFS int32 `json:"minimumTimeoutNFS"` + MinimumTimeoutNFS int32 // podTemplateFilePathNFS is the file path to a pod definition used as a template for // NFS persistent volume recycling - PodTemplateFilePathNFS string `json:"podTemplateFilePathNFS"` + PodTemplateFilePathNFS string // incrementTimeoutNFS is the increment of time added per Gi to ActiveDeadlineSeconds // for an NFS scrubber pod. - IncrementTimeoutNFS int32 `json:"incrementTimeoutNFS"` + IncrementTimeoutNFS int32 // podTemplateFilePathHostPath is the file path to a pod definition used as a template for // HostPath persistent volume recycling. This is for development and testing only and // will not work in a multi-node cluster. - PodTemplateFilePathHostPath string `json:"podTemplateFilePathHostPath"` + PodTemplateFilePathHostPath string // minimumTimeoutHostPath is the minimum ActiveDeadlineSeconds to use for a HostPath // Recycler pod. This is for development and testing only and will not work in a multi-node // cluster. - MinimumTimeoutHostPath int32 `json:"minimumTimeoutHostPath"` + MinimumTimeoutHostPath int32 // incrementTimeoutHostPath is the increment of time added per Gi to ActiveDeadlineSeconds // for a HostPath scrubber pod. This is for development and testing only and will not work // in a multi-node cluster. - IncrementTimeoutHostPath int32 `json:"incrementTimeoutHostPath"` + IncrementTimeoutHostPath int32 } diff --git a/pkg/apis/extensions/types.go b/pkg/apis/extensions/types.go index 2bb3f26e347..2083f73ba3d 100644 --- a/pkg/apis/extensions/types.go +++ b/pkg/apis/extensions/types.go @@ -46,18 +46,18 @@ const ( type ScaleSpec struct { // desired number of instances for the scaled object. // +optional - Replicas int32 `json:"replicas,omitempty"` + Replicas int32 } // represents the current status of a scale subresource. type ScaleStatus struct { // actual number of observed instances of the scaled object. - Replicas int32 `json:"replicas"` + Replicas int32 // label query over pods that should match the replicas count. // More info: http://kubernetes.io/docs/user-guide/labels#label-selectors // +optional - Selector *metav1.LabelSelector `json:"selector,omitempty"` + Selector *metav1.LabelSelector } // +genclient=true @@ -65,46 +65,46 @@ type ScaleStatus struct { // represents a scaling request for a resource. type Scale struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // Standard object metadata; More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata. // +optional - api.ObjectMeta `json:"metadata,omitempty"` + api.ObjectMeta // 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"` + Spec ScaleSpec // 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"` + Status ScaleStatus } // Dummy definition type ReplicationControllerDummy struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta } // Alpha-level support for Custom Metrics in HPA (as annotations). type CustomMetricTarget struct { // Custom Metric name. - Name string `json:"name"` + Name string // Custom Metric value (average). - TargetValue resource.Quantity `json:"value"` + TargetValue resource.Quantity } type CustomMetricTargetList struct { - Items []CustomMetricTarget `json:"items"` + Items []CustomMetricTarget } type CustomMetricCurrentStatus struct { // Custom Metric name. - Name string `json:"name"` + Name string // Custom Metric value (average). - CurrentValue resource.Quantity `json:"value"` + CurrentValue resource.Quantity } type CustomMetricCurrentStatusList struct { - Items []CustomMetricCurrentStatus `json:"items"` + Items []CustomMetricCurrentStatus } // +genclient=true @@ -113,103 +113,103 @@ type CustomMetricCurrentStatusList struct { // A ThirdPartyResource is a generic representation of a resource, it is used by add-ons and plugins to add new resource // types to the API. It consists of one or more Versions of the api. type ThirdPartyResource struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // Standard object metadata // +optional - api.ObjectMeta `json:"metadata,omitempty"` + api.ObjectMeta // Description is the description of this object. // +optional - Description string `json:"description,omitempty"` + Description string // Versions are versions for this third party object - Versions []APIVersion `json:"versions,omitempty"` + Versions []APIVersion } type ThirdPartyResourceList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // Standard list metadata. // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta // Items is the list of horizontal pod autoscalers. - Items []ThirdPartyResource `json:"items"` + Items []ThirdPartyResource } // An APIVersion represents a single concrete version of an object model. // TODO: we should consider merge this struct with GroupVersion in metav1.go type APIVersion struct { // Name of this version (e.g. 'v1'). - Name string `json:"name,omitempty"` + Name string } // An internal object, used for versioned storage in etcd. Not exposed to the end user. type ThirdPartyResourceData struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // Standard object metadata. // +optional - api.ObjectMeta `json:"metadata,omitempty"` + api.ObjectMeta // Data is the raw JSON data for this data. // +optional - Data []byte `json:"data,omitempty"` + Data []byte } // +genclient=true type Deployment struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - api.ObjectMeta `json:"metadata,omitempty"` + api.ObjectMeta // Specification of the desired behavior of the Deployment. // +optional - Spec DeploymentSpec `json:"spec,omitempty"` + Spec DeploymentSpec // Most recently observed status of the Deployment. // +optional - Status DeploymentStatus `json:"status,omitempty"` + Status DeploymentStatus } 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"` + Replicas int32 // Label selector for pods. Existing ReplicaSets whose pods are // selected by this will be the ones affected by this deployment. // +optional - Selector *metav1.LabelSelector `json:"selector,omitempty"` + Selector *metav1.LabelSelector // Template describes the pods that will be created. - Template api.PodTemplateSpec `json:"template"` + Template api.PodTemplateSpec // The deployment strategy to use to replace existing pods with new ones. // +optional - Strategy DeploymentStrategy `json:"strategy,omitempty"` + Strategy DeploymentStrategy // 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"` + MinReadySeconds int32 // 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"` + RevisionHistoryLimit *int32 // Indicates that the deployment is paused and will not be processed by the // deployment controller. // +optional - Paused bool `json:"paused,omitempty"` + Paused bool // The config this deployment is rolling back to. Will be cleared after rollback is done. // +optional - RollbackTo *RollbackConfig `json:"rollbackTo,omitempty"` + RollbackTo *RollbackConfig // The maximum time in seconds for a deployment to make progress before it // is considered to be failed. The deployment controller will continue to @@ -218,25 +218,25 @@ type DeploymentSpec struct { // implemented, the deployment controller will automatically rollback failed // deployments. Note that progress will not be estimated during the time a // deployment is paused. This is not set by default. - ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"` + ProgressDeadlineSeconds *int32 } // DeploymentRollback stores the information required to rollback a deployment. type DeploymentRollback struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // Required: This must match the Name of a deployment. - Name string `json:"name"` + Name string // The annotations to be updated to a deployment // +optional - UpdatedAnnotations map[string]string `json:"updatedAnnotations,omitempty"` + UpdatedAnnotations map[string]string // The config of this deployment rollback. - RollbackTo RollbackConfig `json:"rollbackTo"` + RollbackTo RollbackConfig } type RollbackConfig struct { // The revision to rollback to. If set to 0, rollbck to the last revision. // +optional - Revision int64 `json:"revision,omitempty"` + Revision int64 } const ( @@ -249,7 +249,7 @@ const ( type DeploymentStrategy struct { // Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate. // +optional - Type DeploymentStrategyType `json:"type,omitempty"` + Type DeploymentStrategyType // Rolling update config params. Present only if DeploymentStrategyType = // RollingUpdate. @@ -257,7 +257,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"` + RollingUpdate *RollingUpdateDeployment } type DeploymentStrategyType string @@ -283,7 +283,7 @@ type RollingUpdateDeployment struct { // that at least 70% of original number of pods are available at all times // during the update. // +optional - MaxUnavailable intstr.IntOrString `json:"maxUnavailable,omitempty"` + MaxUnavailable intstr.IntOrString // The maximum number of pods that can be scheduled above the original number of // pods. @@ -296,32 +296,32 @@ type RollingUpdateDeployment struct { // 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"` + MaxSurge intstr.IntOrString } type DeploymentStatus struct { // The generation observed by the deployment controller. // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` + ObservedGeneration int64 // Total number of non-terminated pods targeted by this deployment (their labels match the selector). // +optional - Replicas int32 `json:"replicas,omitempty"` + Replicas int32 // Total number of non-terminated pods targeted by this deployment that have the desired template spec. // +optional - UpdatedReplicas int32 `json:"updatedReplicas,omitempty"` + UpdatedReplicas int32 // Total number of available pods (ready for at least minReadySeconds) targeted by this deployment. // +optional - AvailableReplicas int32 `json:"availableReplicas,omitempty"` + AvailableReplicas int32 // Total number of unavailable pods targeted by this deployment. // +optional - UnavailableReplicas int32 `json:"unavailableReplicas,omitempty"` + UnavailableReplicas int32 // Represents the latest available observations of a deployment's current state. - Conditions []DeploymentCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` + Conditions []DeploymentCondition } type DeploymentConditionType string @@ -344,26 +344,26 @@ const ( // DeploymentCondition describes the state of a deployment at a certain point. type DeploymentCondition struct { // Type of deployment condition. - Type DeploymentConditionType `json:"type"` + Type DeploymentConditionType // Status of the condition, one of True, False, Unknown. - Status api.ConditionStatus `json:"status"` + Status api.ConditionStatus // The last time this condition was updated. - LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"` + LastUpdateTime metav1.Time // Last time the condition transitioned from one status to another. - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` + LastTransitionTime metav1.Time // The reason for the condition's last transition. - Reason string `json:"reason,omitempty"` + Reason string // A human readable message indicating details about the transition. - Message string `json:"message,omitempty"` + Message string } type DeploymentList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta // Items is the list of deployments. - Items []Deployment `json:"items"` + Items []Deployment } // TODO(madhusudancs): Uncomment while implementing DaemonSet updates. @@ -371,7 +371,7 @@ type DeploymentList struct { type DaemonSetUpdateStrategy struct { // Type of daemon set update. Only "RollingUpdate" is supported at this time. Default is RollingUpdate. // +optional - Type DaemonSetUpdateStrategyType `json:"type,omitempty"` + Type DaemonSetUpdateStrategyType // Rolling update config params. Present only if DaemonSetUpdateStrategy = // RollingUpdate. @@ -379,7 +379,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"` + RollingUpdate *RollingUpdateDaemonSet } type DaemonSetUpdateStrategyType string @@ -405,14 +405,14 @@ type RollingUpdateDaemonSet struct { // 70% of original number of DaemonSet pods are available at all times // during the update. // +optional - MaxUnavailable intstr.IntOrString `json:"maxUnavailable,omitempty"` + MaxUnavailable intstr.IntOrString // 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"` + MinReadySeconds int } */ @@ -423,20 +423,20 @@ type DaemonSetSpec struct { // If empty, defaulted to labels on Pod template. // More info: http://kubernetes.io/docs/user-guide/labels#label-selectors // +optional - Selector *metav1.LabelSelector `json:"selector,omitempty"` + Selector *metav1.LabelSelector // Template is the object that describes the pod that will be created. // The DaemonSet will create exactly one copy of this pod on every node // that matches the template's node selector (or on every node if no node // selector is specified). // More info: http://kubernetes.io/docs/user-guide/replication-controller#pod-template - Template api.PodTemplateSpec `json:"template"` + Template api.PodTemplateSpec // 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. // +optional - UpdateStrategy DaemonSetUpdateStrategy `json:"updateStrategy,omitempty"` + UpdateStrategy DaemonSetUpdateStrategy // Label key that is added to DaemonSet pods to distinguish between old and // new pod templates during DaemonSet update. @@ -446,7 +446,7 @@ type DaemonSetSpec struct { // 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"` + UniqueLabelKey string */ } @@ -461,35 +461,35 @@ const ( type DaemonSetStatus struct { // CurrentNumberScheduled is the number of nodes that are running at least 1 // daemon pod and are supposed to run the daemon pod. - CurrentNumberScheduled int32 `json:"currentNumberScheduled"` + CurrentNumberScheduled int32 // NumberMisscheduled is the number of nodes that are running the daemon pod, but are // not supposed to run the daemon pod. - NumberMisscheduled int32 `json:"numberMisscheduled"` + NumberMisscheduled int32 // DesiredNumberScheduled is the total number of nodes that should be running the daemon // pod (including nodes correctly running the daemon pod). - DesiredNumberScheduled int32 `json:"desiredNumberScheduled"` + DesiredNumberScheduled int32 // NumberReady is the number of nodes that should be running the daemon pod and have one // or more of the daemon pod running and ready. - NumberReady int32 `json:"numberReady"` + NumberReady int32 } // +genclient=true // DaemonSet represents the configuration of a daemon set. type DaemonSet struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // +optional - api.ObjectMeta `json:"metadata,omitempty"` + api.ObjectMeta // 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"` + Spec DaemonSetSpec // Status is the current status of this daemon set. This data may be // out of date by some window of time. @@ -497,29 +497,29 @@ type DaemonSet struct { // Read-only. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status // +optional - Status DaemonSetStatus `json:"status,omitempty"` + Status DaemonSetStatus } // DaemonSetList is a collection of daemon sets. type DaemonSetList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // Standard list metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta // Items is a list of daemon sets. - Items []DaemonSet `json:"items"` + Items []DaemonSet } type ThirdPartyResourceDataList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // Standard list metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta // Items is a list of third party objects - Items []ThirdPartyResourceData `json:"items"` + Items []ThirdPartyResourceData } // +genclient=true @@ -529,33 +529,33 @@ type ThirdPartyResourceDataList struct { // externally-reachable urls, load balance traffic, terminate SSL, offer name // based virtual hosting etc. type Ingress struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // +optional - api.ObjectMeta `json:"metadata,omitempty"` + api.ObjectMeta // 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"` + Spec IngressSpec // 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"` + Status IngressStatus } // IngressList is a collection of Ingress. type IngressList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta // Items is the list of Ingress. - Items []Ingress `json:"items"` + Items []Ingress } // IngressSpec describes the Ingress the user wishes to exist. @@ -565,7 +565,7 @@ type IngressSpec struct { // is optional to allow the loadbalancer controller or defaulting logic to // specify a global default. // +optional - Backend *IngressBackend `json:"backend,omitempty"` + Backend *IngressBackend // TLS configuration. Currently the Ingress only supports a single TLS // port, 443. If multiple members of this list specify different hosts, they @@ -573,12 +573,12 @@ type IngressSpec struct { // through the SNI TLS extension, if the ingress controller fulfilling the // ingress supports SNI. // +optional - TLS []IngressTLS `json:"tls,omitempty"` + TLS []IngressTLS // 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"` + Rules []IngressRule // TODO: Add the ability to specify load-balancer IP through claims } @@ -589,14 +589,14 @@ type IngressTLS struct { // wildcard host setting for the loadbalancer controller fulfilling this // Ingress, if left unspecified. // +optional - Hosts []string `json:"hosts,omitempty"` + Hosts []string // 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"` + SecretName string // TODO: Consider specifying different modes of termination, protocols etc. } @@ -604,7 +604,7 @@ type IngressTLS struct { type IngressStatus struct { // LoadBalancer contains the current status of the load-balancer. // +optional - LoadBalancer api.LoadBalancerStatus `json:"loadBalancer,omitempty"` + LoadBalancer api.LoadBalancerStatus } // IngressRule represents the rules mapping the paths under a specified host to @@ -624,14 +624,14 @@ type IngressRule struct { // If the host is unspecified, the Ingress routes all traffic based on the // specified IngressRuleValue. // +optional - Host string `json:"host,omitempty"` + Host string // 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"` + IngressRuleValue } // IngressRuleValue represents a rule to apply against incoming requests. If the @@ -646,7 +646,7 @@ type IngressRuleValue struct { // usable by a loadbalancer, like http keep-alive. // +optional - HTTP *HTTPIngressRuleValue `json:"http,omitempty"` + HTTP *HTTPIngressRuleValue } // HTTPIngressRuleValue is a list of http selectors pointing to backends. @@ -656,7 +656,7 @@ type IngressRuleValue struct { // or '#'. type HTTPIngressRuleValue struct { // A collection of paths that map requests to backends. - Paths []HTTPIngressPath `json:"paths"` + Paths []HTTPIngressPath // TODO: Consider adding fields for ingress-type specific global // options usable by a loadbalancer, like http keep-alive. } @@ -672,47 +672,47 @@ type HTTPIngressPath struct { // a '/'. If unspecified, the path defaults to a catch all sending // traffic to the backend. // +optional - Path string `json:"path,omitempty"` + Path string // Backend defines the referenced service endpoint to which the traffic // will be forwarded to. - Backend IngressBackend `json:"backend"` + Backend IngressBackend } // IngressBackend describes all endpoints for a given service and port. type IngressBackend struct { // Specifies the name of the referenced service. - ServiceName string `json:"serviceName"` + ServiceName string // Specifies the port of the referenced service. - ServicePort intstr.IntOrString `json:"servicePort"` + ServicePort intstr.IntOrString } // +genclient=true // ReplicaSet represents the configuration of a replica set. type ReplicaSet struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - api.ObjectMeta `json:"metadata,omitempty"` + api.ObjectMeta // Spec defines the desired behavior of this ReplicaSet. // +optional - Spec ReplicaSetSpec `json:"spec,omitempty"` + Spec ReplicaSetSpec // 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"` + Status ReplicaSetStatus } // ReplicaSetList is a collection of ReplicaSets. type ReplicaSetList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta - Items []ReplicaSet `json:"items"` + Items []ReplicaSet } // ReplicaSetSpec is the specification of a ReplicaSet. @@ -720,51 +720,51 @@ type ReplicaSetList struct { // a Template set. type ReplicaSetSpec struct { // Replicas is the number of desired replicas. - Replicas int32 `json:"replicas"` + Replicas int32 // 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"` + MinReadySeconds int32 // 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 *metav1.LabelSelector `json:"selector,omitempty"` + Selector *metav1.LabelSelector // Template is the object that describes the pod that will be created if // insufficient replicas are detected. // +optional - Template api.PodTemplateSpec `json:"template,omitempty"` + Template api.PodTemplateSpec } // ReplicaSetStatus represents the current status of a ReplicaSet. type ReplicaSetStatus struct { // Replicas is the number of actual replicas. - Replicas int32 `json:"replicas"` + Replicas int32 // The number of pods that have labels matching the labels of the pod template of the replicaset. // +optional - FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty"` + FullyLabeledReplicas int32 // The number of ready replicas for this replica set. // +optional - ReadyReplicas int32 `json:"readyReplicas,omitempty"` + ReadyReplicas int32 // The number of available replicas (ready for at least minReadySeconds) for this replica set. // +optional - AvailableReplicas int32 `json:"availableReplicas,omitempty"` + AvailableReplicas int32 // ObservedGeneration is the most recent generation observed by the controller. // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` + ObservedGeneration int64 // Represents the latest available observations of a replica set's current state. // +optional - Conditions []ReplicaSetCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` + Conditions []ReplicaSetCondition } type ReplicaSetConditionType string @@ -780,18 +780,18 @@ const ( // ReplicaSetCondition describes the state of a replica set at a certain point. type ReplicaSetCondition struct { // Type of replica set condition. - Type ReplicaSetConditionType `json:"type"` + Type ReplicaSetConditionType // Status of the condition, one of True, False, Unknown. - Status api.ConditionStatus `json:"status"` + Status api.ConditionStatus // The last time the condition transitioned from one status to another. // +optional - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` + LastTransitionTime metav1.Time // The reason for the condition's last transition. // +optional - Reason string `json:"reason,omitempty"` + Reason string // A human readable message indicating details about the transition. // +optional - Message string `json:"message,omitempty"` + Message string } // +genclient=true @@ -800,74 +800,74 @@ type ReplicaSetCondition struct { // PodSecurityPolicy governs the ability to make requests that affect the SecurityContext // that will be applied to a pod and container. type PodSecurityPolicy struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - api.ObjectMeta `json:"metadata,omitempty"` + api.ObjectMeta // Spec defines the policy enforced. // +optional - Spec PodSecurityPolicySpec `json:"spec,omitempty"` + Spec PodSecurityPolicySpec } // 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"` + Privileged bool // 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"` + DefaultAddCapabilities []api.Capability // 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"` + RequiredDropCapabilities []api.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 []api.Capability `json:"allowedCapabilities,omitempty"` + AllowedCapabilities []api.Capability // Volumes is a white list of allowed volume plugins. Empty indicates that all plugins // may be used. // +optional - Volumes []FSType `json:"volumes,omitempty"` + Volumes []FSType // HostNetwork determines if the policy allows the use of HostNetwork in the pod spec. // +optional - HostNetwork bool `json:"hostNetwork,omitempty"` + HostNetwork bool // HostPorts determines which host port ranges are allowed to be exposed. // +optional - HostPorts []HostPortRange `json:"hostPorts,omitempty"` + HostPorts []HostPortRange // HostPID determines if the policy allows the use of HostPID in the pod spec. // +optional - HostPID bool `json:"hostPID,omitempty"` + HostPID bool // HostIPC determines if the policy allows the use of HostIPC in the pod spec. // +optional - HostIPC bool `json:"hostIPC,omitempty"` + HostIPC bool // SELinux is the strategy that will dictate the allowable labels that may be set. - SELinux SELinuxStrategyOptions `json:"seLinux"` + SELinux SELinuxStrategyOptions // RunAsUser is the strategy that will dictate the allowable RunAsUser values that may be set. - RunAsUser RunAsUserStrategyOptions `json:"runAsUser"` + RunAsUser RunAsUserStrategyOptions // SupplementalGroups is the strategy that will dictate what supplemental groups are used by the SecurityContext. - SupplementalGroups SupplementalGroupsStrategyOptions `json:"supplementalGroups"` + SupplementalGroups SupplementalGroupsStrategyOptions // FSGroup is the strategy that will dictate what fs group is used by the SecurityContext. - FSGroup FSGroupStrategyOptions `json:"fsGroup"` + FSGroup FSGroupStrategyOptions // ReadOnlyRootFilesystem when set to true will force containers to run with a read only root file // system. If the container specifically requests to run with a non-read only root file system // 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"` + ReadOnlyRootFilesystem bool } // HostPortRange defines a range of host ports that will be enabled by a policy // for pods to use. It requires both the start and end to be defined. type HostPortRange struct { // Min is the start of the range, inclusive. - Min int `json:"min"` + Min int // Max is the end of the range, inclusive. - Max int `json:"max"` + Max int } // FSType gives strong typing to different file systems that are used by volumes. @@ -903,11 +903,11 @@ var ( // SELinuxStrategyOptions defines the strategy type and any options used to create the strategy. type SELinuxStrategyOptions struct { // Rule is the strategy that will dictate the allowable labels that may be set. - Rule SELinuxStrategy `json:"rule"` + Rule 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 *api.SELinuxOptions `json:"seLinuxOptions,omitempty"` + SELinuxOptions *api.SELinuxOptions } // SELinuxStrategy denotes strategy types for generating SELinux options for a @@ -924,18 +924,18 @@ const ( // RunAsUserStrategyOptions defines the strategy type and any options used to create the strategy. type RunAsUserStrategyOptions struct { // Rule is the strategy that will dictate the allowable RunAsUser values that may be set. - Rule RunAsUserStrategy `json:"rule"` + Rule RunAsUserStrategy // Ranges are the allowed ranges of uids that may be used. // +optional - Ranges []IDRange `json:"ranges,omitempty"` + Ranges []IDRange } // IDRange provides a min/max of an allowed range of IDs. type IDRange struct { // Min is the start of the range, inclusive. - Min int64 `json:"min"` + Min int64 // Max is the end of the range, inclusive. - Max int64 `json:"max"` + Max int64 } // RunAsUserStrategy denotes strategy types for generating RunAsUser values for a @@ -955,11 +955,11 @@ const ( type FSGroupStrategyOptions struct { // Rule is the strategy that will dictate what FSGroup is used in the SecurityContext. // +optional - Rule FSGroupStrategyType `json:"rule,omitempty"` + Rule 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"` + Ranges []IDRange } // FSGroupStrategyType denotes strategy types for generating FSGroup values for a @@ -977,11 +977,11 @@ const ( type SupplementalGroupsStrategyOptions struct { // Rule is the strategy that will dictate what supplemental groups is used in the SecurityContext. // +optional - Rule SupplementalGroupsStrategyType `json:"rule,omitempty"` + Rule 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"` + Ranges []IDRange } // SupplementalGroupsStrategyType denotes strategy types for determining valid supplemental @@ -997,23 +997,23 @@ const ( // PodSecurityPolicyList is a list of PodSecurityPolicy objects. type PodSecurityPolicyList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta - Items []PodSecurityPolicy `json:"items"` + Items []PodSecurityPolicy } // +genclient=true type NetworkPolicy struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - api.ObjectMeta `json:"metadata,omitempty"` + api.ObjectMeta // Specification of the desired behavior for this NetworkPolicy. // +optional - Spec NetworkPolicySpec `json:"spec,omitempty"` + Spec NetworkPolicySpec } type NetworkPolicySpec struct { @@ -1022,7 +1022,7 @@ type NetworkPolicySpec struct { // same set of pods. In this case, the ingress rules for each are combined additively. // This field is NOT optional and follows standard label selector semantics. // An empty podSelector matches all pods in this namespace. - PodSelector metav1.LabelSelector `json:"podSelector"` + PodSelector metav1.LabelSelector // List of ingress rules to be applied to the selected pods. // Traffic is allowed to a pod if namespace.networkPolicy.ingress.isolation is undefined and cluster policy allows it, @@ -1033,7 +1033,7 @@ type NetworkPolicySpec struct { // 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"` + Ingress []NetworkPolicyIngressRule } // This NetworkPolicyIngressRule matches traffic if and only if the traffic matches both ports AND from. @@ -1046,7 +1046,7 @@ type NetworkPolicyIngressRule struct { // 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"` + Ports []NetworkPolicyPort // List of sources which should be able to access the pods selected for this rule. // Items in this list are combined using a logical OR operation. @@ -1056,14 +1056,14 @@ type NetworkPolicyIngressRule struct { // 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"` + From []NetworkPolicyPeer } 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"` + Protocol *api.Protocol // If specified, the port on the given protocol. This can // either be a numerical or named port on a pod. If this field is not provided, @@ -1071,7 +1071,7 @@ type NetworkPolicyPort struct { // If present, only traffic on the specified protocol AND port // will be matched. // +optional - Port *intstr.IntOrString `json:"port,omitempty"` + Port *intstr.IntOrString } type NetworkPolicyPeer struct { @@ -1082,7 +1082,7 @@ type NetworkPolicyPeer struct { // If not provided, this selector selects no pods. // If present but empty, this selector selects all pods in this namespace. // +optional - PodSelector *metav1.LabelSelector `json:"podSelector,omitempty"` + PodSelector *metav1.LabelSelector // Selects Namespaces using cluster scoped-labels. This // matches all pods in all namespaces selected by this label selector. @@ -1090,14 +1090,14 @@ type NetworkPolicyPeer struct { // If omitted, this selector selects no namespaces. // If present but empty, this selector selects all namespaces. // +optional - NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"` + NamespaceSelector *metav1.LabelSelector } // NetworkPolicyList is a list of NetworkPolicy objects. type NetworkPolicyList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta - Items []NetworkPolicy `json:"items"` + Items []NetworkPolicy } diff --git a/pkg/apis/policy/types.go b/pkg/apis/policy/types.go index 535e744f97d..46a1b41690c 100644 --- a/pkg/apis/policy/types.go +++ b/pkg/apis/policy/types.go @@ -29,12 +29,12 @@ type PodDisruptionBudgetSpec struct { // absence of the evicted pod. So for example you can prevent all voluntary // evictions by specifying "100%". // +optional - MinAvailable intstr.IntOrString `json:"minAvailable,omitempty"` + MinAvailable intstr.IntOrString // Label query over pods whose evictions are managed by the disruption // budget. // +optional - Selector *metav1.LabelSelector `json:"selector,omitempty"` + Selector *metav1.LabelSelector } // PodDisruptionBudgetStatus represents information about the status of a @@ -43,7 +43,7 @@ type PodDisruptionBudgetStatus struct { // Most recent generation observed when updating this PDB status. PodDisruptionsAllowed and other // status informatio is valid only if observedGeneration equals to PDB's object generation. // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` + ObservedGeneration int64 // DisruptedPods contains information about pods whose eviction was // processed by the API server eviction subresource handler but has not @@ -56,43 +56,43 @@ type PodDisruptionBudgetStatus struct { // the list automatically by PodDisruptionBudget controller after some time. // If everything goes smooth this map should be empty for the most of the time. // Large number of entries in the map may indicate problems with pod deletions. - DisruptedPods map[string]metav1.Time `json:"disruptedPods" protobuf:"bytes,5,rep,name=disruptedPods"` + DisruptedPods map[string]metav1.Time // Number of pod disruptions that are currently allowed. - PodDisruptionsAllowed int32 `json:"disruptionsAllowed"` + PodDisruptionsAllowed int32 // current number of healthy pods - CurrentHealthy int32 `json:"currentHealthy"` + CurrentHealthy int32 // minimum desired number of healthy pods - DesiredHealthy int32 `json:"desiredHealthy"` + DesiredHealthy int32 // total number of pods counted by this disruption budget - ExpectedPods int32 `json:"expectedPods"` + ExpectedPods int32 } // +genclient=true // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods type PodDisruptionBudget struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - api.ObjectMeta `json:"metadata,omitempty"` + api.ObjectMeta // Specification of the desired behavior of the PodDisruptionBudget. // +optional - Spec PodDisruptionBudgetSpec `json:"spec,omitempty"` + Spec PodDisruptionBudgetSpec // Most recently observed status of the PodDisruptionBudget. // +optional - Status PodDisruptionBudgetStatus `json:"status,omitempty"` + Status PodDisruptionBudgetStatus } // PodDisruptionBudgetList is a collection of PodDisruptionBudgets. type PodDisruptionBudgetList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - metav1.ListMeta `json:"metadata,omitempty"` - Items []PodDisruptionBudget `json:"items"` + metav1.ListMeta + Items []PodDisruptionBudget } // +genclient=true @@ -102,13 +102,13 @@ type PodDisruptionBudgetList struct { // This is a subresource of Pod. A request to cause such an eviction is // created by POSTing to .../pods//eviction. type Eviction struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // ObjectMeta describes the pod that is being evicted. // +optional - api.ObjectMeta `json:"metadata,omitempty"` + api.ObjectMeta // DeleteOptions may be provided // +optional - DeleteOptions *api.DeleteOptions `json:"deleteOptions,omitempty"` + DeleteOptions *api.DeleteOptions } diff --git a/pkg/apis/storage/types.go b/pkg/apis/storage/types.go index 5ea67c53a27..bd3acc72a75 100644 --- a/pkg/apis/storage/types.go +++ b/pkg/apis/storage/types.go @@ -31,15 +31,15 @@ import ( // called "profiles" in other storage systems. // The name of a StorageClass object is significant, and is how users can request a particular class. type StorageClass struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // +optional - api.ObjectMeta `json:"metadata,omitempty"` + api.ObjectMeta // provisioner is the driver expected to handle this StorageClass. // This is an optionally-prefixed name, like a label key. // For example: "kubernetes.io/gce-pd" or "kubernetes.io/aws-ebs". // This value may not be empty. - Provisioner string `json:"provisioner"` + Provisioner string // parameters holds parameters for the provisioner. // These values are opaque to the system and are passed directly @@ -47,17 +47,17 @@ type StorageClass struct { // not empty. The maximum number of parameters is // 512, with a cumulative max size of 256K // +optional - Parameters map[string]string `json:"parameters,omitempty"` + Parameters map[string]string } // StorageClassList is a collection of storage classes. type StorageClassList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // Standard list metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // +optional - metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta // Items is the list of StorageClasses - Items []StorageClass `json:"items"` + Items []StorageClass } diff --git a/plugin/pkg/scheduler/api/types.go b/plugin/pkg/scheduler/api/types.go index f5d795ddb35..8b76a9c60fb 100644 --- a/plugin/pkg/scheduler/api/types.go +++ b/plugin/pkg/scheduler/api/types.go @@ -25,34 +25,34 @@ import ( ) type Policy struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta // Holds the information to configure the fit predicate functions - Predicates []PredicatePolicy `json:"predicates"` + Predicates []PredicatePolicy // Holds the information to configure the priority functions - Priorities []PriorityPolicy `json:"priorities"` + Priorities []PriorityPolicy // Holds the information to communicate with the extender(s) - ExtenderConfigs []ExtenderConfig `json:"extenders"` + ExtenderConfigs []ExtenderConfig } type PredicatePolicy struct { // Identifier of the predicate policy // For a custom predicate, the name can be user-defined // For the Kubernetes provided predicates, the name is the identifier of the pre-defined predicate - Name string `json:"name"` + Name string // Holds the parameters to configure the given predicate - Argument *PredicateArgument `json:"argument"` + Argument *PredicateArgument } type PriorityPolicy struct { // Identifier of the priority policy // For a custom priority, the name can be user-defined // For the Kubernetes provided priority functions, the name is the identifier of the pre-defined priority function - Name string `json:"name"` + Name string // The numeric multiplier for the node scores that the priority function generates // The weight should be a positive integer - Weight int `json:"weight"` + Weight int // Holds the parameters to configure the given priority function - Argument *PriorityArgument `json:"argument"` + Argument *PriorityArgument } // Represents the arguments that the different types of predicates take @@ -60,10 +60,10 @@ type PriorityPolicy struct { type PredicateArgument struct { // The predicate that provides affinity for pods belonging to a service // It uses a label to identify nodes that belong to the same "group" - ServiceAffinity *ServiceAffinity `json:"serviceAffinity"` + ServiceAffinity *ServiceAffinity // The predicate that checks whether a particular node has a certain label // defined or not, regardless of value - LabelsPresence *LabelsPresence `json:"labelsPresence"` + LabelsPresence *LabelsPresence } // Represents the arguments that the different types of priorities take. @@ -71,72 +71,72 @@ type PredicateArgument struct { type PriorityArgument struct { // The priority function that ensures a good spread (anti-affinity) for pods belonging to a service // It uses a label to identify nodes that belong to the same "group" - ServiceAntiAffinity *ServiceAntiAffinity `json:"serviceAntiAffinity"` + ServiceAntiAffinity *ServiceAntiAffinity // The priority function that checks whether a particular node has a certain label // defined or not, regardless of value - LabelPreference *LabelPreference `json:"labelPreference"` + LabelPreference *LabelPreference } // Holds the parameters that are used to configure the corresponding predicate type ServiceAffinity struct { // The list of labels that identify node "groups" // All of the labels should match for the node to be considered a fit for hosting the pod - Labels []string `json:"labels"` + Labels []string } // Holds the parameters that are used to configure the corresponding predicate type LabelsPresence struct { // The list of labels that identify node "groups" // All of the labels should be either present (or absent) for the node to be considered a fit for hosting the pod - Labels []string `json:"labels"` + Labels []string // The boolean flag that indicates whether the labels should be present or absent from the node - Presence bool `json:"presence"` + Presence bool } // Holds the parameters that are used to configure the corresponding priority function type ServiceAntiAffinity struct { // Used to identify node "groups" - Label string `json:"label"` + Label string } // Holds the parameters that are used to configure the corresponding priority function type LabelPreference struct { // Used to identify node "groups" - Label string `json:"label"` + Label string // This is a boolean flag // If true, higher priority is given to nodes that have the label // If false, higher priority is given to nodes that do not have the label - Presence bool `json:"presence"` + Presence bool } // Holds the parameters used to communicate with the extender. If a verb is unspecified/empty, // it is assumed that the extender chose not to provide that extension. type ExtenderConfig struct { // URLPrefix at which the extender is available - URLPrefix string `json:"urlPrefix"` + URLPrefix string // Verb for the filter call, empty if not supported. This verb is appended to the URLPrefix when issuing the filter call to extender. - FilterVerb string `json:"filterVerb,omitempty"` + FilterVerb string // Verb for the prioritize call, empty if not supported. This verb is appended to the URLPrefix when issuing the prioritize call to extender. - PrioritizeVerb string `json:"prioritizeVerb,omitempty"` + PrioritizeVerb string // The numeric multiplier for the node scores that the prioritize call generates. // The weight should be a positive integer - Weight int `json:"weight,omitempty"` + Weight int // EnableHttps specifies whether https should be used to communicate with the extender - EnableHttps bool `json:"enableHttps,omitempty"` + EnableHttps bool // TLSConfig specifies the transport layer security config - TLSConfig *restclient.TLSClientConfig `json:"tlsConfig,omitempty"` + TLSConfig *restclient.TLSClientConfig // HTTPTimeout specifies the timeout duration for a call to the extender. Filter timeout fails the scheduling of the pod. Prioritize // timeout is ignored, k8s/other extenders priorities are used to select the node. - HTTPTimeout time.Duration `json:"httpTimeout,omitempty"` + HTTPTimeout time.Duration } // ExtenderArgs represents the arguments needed by the extender to filter/prioritize // nodes for a pod. type ExtenderArgs struct { // Pod being scheduled - Pod v1.Pod `json:"pod"` + Pod v1.Pod // List of candidate nodes where the pod can be scheduled - Nodes v1.NodeList `json:"nodes"` + Nodes v1.NodeList } // FailedNodesMap represents the filtered out nodes, with node names and failure messages @@ -145,19 +145,19 @@ type FailedNodesMap map[string]string // ExtenderFilterResult represents the results of a filter call to an extender type ExtenderFilterResult struct { // Filtered set of nodes where the pod can be scheduled - Nodes v1.NodeList `json:"nodes,omitempty"` + Nodes v1.NodeList // Filtered out nodes where the pod can't be scheduled and the failure messages - FailedNodes FailedNodesMap `json:"failedNodes,omitempty"` + FailedNodes FailedNodesMap // Error message indicating failure - Error string `json:"error,omitempty"` + Error string } // HostPriority represents the priority of scheduling to a particular host, higher priority is better. type HostPriority struct { // Name of the host - Host string `json:"host"` + Host string // Score associated with the host - Score int `json:"score"` + Score int } type HostPriorityList []HostPriority