Remove json serialization annotations from internal types

parent 59cfdfb8
...@@ -86,6 +86,6 @@ type NodeConfiguration struct { ...@@ -86,6 +86,6 @@ type NodeConfiguration struct {
type ClusterInfo struct { type ClusterInfo struct {
metav1.TypeMeta metav1.TypeMeta
// TODO(phase1+) this may become simply `api.Config` // TODO(phase1+) this may become simply `api.Config`
CertificateAuthorities []string `json:"certificateAuthorities"` CertificateAuthorities []string
Endpoints []string `json:"endpoints"` Endpoints []string
} }
...@@ -24,16 +24,16 @@ import ( ...@@ -24,16 +24,16 @@ import (
// +genclient=true // +genclient=true
type TestType struct { type TestType struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
api.ObjectMeta `json:"metadata,omitempty"` api.ObjectMeta
Status TestTypeStatus `json:"status,omitempty"` Status TestTypeStatus
} }
type TestTypeList struct { type TestTypeList struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
metav1.ListMeta `json:"metadata,omitempty"` metav1.ListMeta
Items []TestType `json:"items"` Items []TestType
} }
type TestTypeStatus struct { type TestTypeStatus struct {
......
...@@ -24,10 +24,10 @@ import ( ...@@ -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. // ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.
type ServerAddressByClientCIDR struct { type ServerAddressByClientCIDR struct {
// The CIDR with which clients can match their IP to figure out the server address that they should use. // 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. // Address of this server, suitable for a client that matches the above CIDR.
// This can be a hostname, hostname:port, IP or IP:port. // 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. // ClusterSpec describes the attributes of a kubernetes cluster.
...@@ -36,14 +36,14 @@ type ClusterSpec struct { ...@@ -36,14 +36,14 @@ type ClusterSpec struct {
// This is to help clients reach servers in the most network-efficient way possible. // 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. // 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. // 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. // Name of the secret containing kubeconfig to access this cluster.
// The secret is read from the kubernetes cluster that is hosting federation control plane. // 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". // 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 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. // This can be left empty if the cluster allows insecure access.
// +optional // +optional
SecretRef *api.LocalObjectReference `json:"secretRef,omitempty"` SecretRef *api.LocalObjectReference
} }
type ClusterConditionType string type ClusterConditionType string
...@@ -59,35 +59,35 @@ const ( ...@@ -59,35 +59,35 @@ const (
// ClusterCondition describes current state of a cluster. // ClusterCondition describes current state of a cluster.
type ClusterCondition struct { type ClusterCondition struct {
// Type of cluster condition, Complete or Failed. // Type of cluster condition, Complete or Failed.
Type ClusterConditionType `json:"type"` Type ClusterConditionType
// Status of the condition, one of True, False, Unknown. // Status of the condition, one of True, False, Unknown.
Status api.ConditionStatus `json:"status"` Status api.ConditionStatus
// Last time the condition was checked. // Last time the condition was checked.
// +optional // +optional
LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"` LastProbeTime metav1.Time
// Last time the condition transit from one status to another. // Last time the condition transit from one status to another.
// +optional // +optional
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` LastTransitionTime metav1.Time
// (brief) reason for the condition's last transition. // (brief) reason for the condition's last transition.
// +optional // +optional
Reason string `json:"reason,omitempty"` Reason string
// Human readable message indicating details about last transition. // Human readable message indicating details about last transition.
// +optional // +optional
Message string `json:"message,omitempty"` Message string
} }
// ClusterStatus is information about the current status of a cluster updated by cluster controller peridocally. // ClusterStatus is information about the current status of a cluster updated by cluster controller peridocally.
type ClusterStatus struct { type ClusterStatus struct {
// Conditions is an array of current cluster conditions. // Conditions is an array of current cluster conditions.
// +optional // +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'. // 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. // These will always be in the same region.
// +optional // +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'. // Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'.
// +optional // +optional
Region string `json:"region,omitempty"` Region string
} }
// +genclient=true // +genclient=true
...@@ -95,30 +95,30 @@ type ClusterStatus struct { ...@@ -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. // Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation.
type Cluster struct { type Cluster struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// Standard object's metadata. // Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
api.ObjectMeta `json:"metadata,omitempty"` api.ObjectMeta
// Spec defines the behavior of the Cluster. // Spec defines the behavior of the Cluster.
// +optional // +optional
Spec ClusterSpec `json:"spec,omitempty"` Spec ClusterSpec
// Status describes the current status of a Cluster // Status describes the current status of a Cluster
// +optional // +optional
Status ClusterStatus `json:"status,omitempty"` Status ClusterStatus
} }
// A list of all the kubernetes clusters registered to the federation // A list of all the kubernetes clusters registered to the federation
type ClusterList struct { type ClusterList struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// Standard list metadata. // Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
// +optional // +optional
metav1.ListMeta `json:"metadata,omitempty"` metav1.ListMeta
// List of Cluster objects. // List of Cluster objects.
Items []Cluster `json:"items"` Items []Cluster
} }
// Temporary/alpha structures to support custom replica assignments within FederatedReplicaSet. // Temporary/alpha structures to support custom replica assignments within FederatedReplicaSet.
...@@ -131,24 +131,24 @@ type FederatedReplicaSetPreferences struct { ...@@ -131,24 +131,24 @@ type FederatedReplicaSetPreferences struct {
// in order to bring cluster replicasets towards a desired state. Otherwise, if set to false, // in order to bring cluster replicasets towards a desired state. Otherwise, if set to false,
// up and running replicas will not be moved. // up and running replicas will not be moved.
// +optional // +optional
Rebalance bool `json:"rebalance,omitempty"` Rebalance bool
// A mapping between cluster names and preferences regarding local ReplicaSet in these clusters. // 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 // "*" (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. // "*" that clusters without explicit preferences should not have any replicas scheduled.
// +optional // +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. // Preferences regarding number of replicas assigned to a cluster replicaset within a federated replicaset.
type ClusterReplicaSetPreferences struct { type ClusterReplicaSetPreferences struct {
// Minimum number of replicas that should be assigned to this Local ReplicaSet. 0 by default. // Minimum number of replicas that should be assigned to this Local ReplicaSet. 0 by default.
// +optional // +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). // Maximum number of replicas that should be assigned to this Local ReplicaSet. Unbounded if no value provided (default).
// +optional // +optional
MaxReplicas *int64 `json:"maxReplicas,omitempty"` MaxReplicas *int64
// A number expressing the preference to put an additional replica to this LocalReplicaSet. 0 by default. // A number expressing the preference to put an additional replica to this LocalReplicaSet. 0 by default.
Weight int64 Weight int64
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -30,18 +30,18 @@ import ( ...@@ -30,18 +30,18 @@ import (
// The StatefulSet guarantees that a given network identity will always // The StatefulSet guarantees that a given network identity will always
// map to the same storage identity. // map to the same storage identity.
type StatefulSet struct { type StatefulSet struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// +optional // +optional
api.ObjectMeta `json:"metadata,omitempty"` api.ObjectMeta
// Spec defines the desired identities of pods in this set. // Spec defines the desired identities of pods in this set.
// +optional // +optional
Spec StatefulSetSpec `json:"spec,omitempty"` Spec StatefulSetSpec
// Status is the current status of Pods in this StatefulSet. This data // Status is the current status of Pods in this StatefulSet. This data
// may be out of date by some window of time. // may be out of date by some window of time.
// +optional // +optional
Status StatefulSetStatus `json:"status,omitempty"` Status StatefulSetStatus
} }
// A StatefulSetSpec is the specification of a StatefulSet. // A StatefulSetSpec is the specification of a StatefulSet.
...@@ -52,19 +52,19 @@ type StatefulSetSpec struct { ...@@ -52,19 +52,19 @@ type StatefulSetSpec struct {
// If unspecified, defaults to 1. // If unspecified, defaults to 1.
// TODO: Consider a rename of this field. // TODO: Consider a rename of this field.
// +optional // +optional
Replicas int32 `json:"replicas,omitempty"` Replicas int32
// Selector is a label query over pods that should match the replica count. // Selector is a label query over pods that should match the replica count.
// If empty, defaulted to labels on the pod template. // If empty, defaulted to labels on the pod template.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors // More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional // +optional
Selector *metav1.LabelSelector `json:"selector,omitempty"` Selector *metav1.LabelSelector
// Template is the object that describes the pod that will be created if // Template is the object that describes the pod that will be created if
// insufficient replicas are detected. Each pod stamped out by the StatefulSet // insufficient replicas are detected. Each pod stamped out by the StatefulSet
// will fulfill this Template, but have a unique identity from the rest // will fulfill this Template, but have a unique identity from the rest
// of the StatefulSet. // of the StatefulSet.
Template api.PodTemplateSpec `json:"template"` Template api.PodTemplateSpec
// VolumeClaimTemplates is a list of claims that pods are allowed to reference. // VolumeClaimTemplates is a list of claims that pods are allowed to reference.
// The StatefulSet controller is responsible for mapping network identities to // The StatefulSet controller is responsible for mapping network identities to
...@@ -74,30 +74,30 @@ type StatefulSetSpec struct { ...@@ -74,30 +74,30 @@ type StatefulSetSpec struct {
// any volumes in the template, with the same name. // any volumes in the template, with the same name.
// TODO: Define the behavior if a claim already exists with the same name. // TODO: Define the behavior if a claim already exists with the same name.
// +optional // +optional
VolumeClaimTemplates []api.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty"` VolumeClaimTemplates []api.PersistentVolumeClaim
// ServiceName is the name of the service that governs this StatefulSet. // ServiceName is the name of the service that governs this StatefulSet.
// This service must exist before the StatefulSet, and is responsible for // This service must exist before the StatefulSet, and is responsible for
// the network identity of the set. Pods get DNS/hostnames that follow the // the network identity of the set. Pods get DNS/hostnames that follow the
// pattern: pod-specific-string.serviceName.default.svc.cluster.local // pattern: pod-specific-string.serviceName.default.svc.cluster.local
// where "pod-specific-string" is managed by the StatefulSet controller. // where "pod-specific-string" is managed by the StatefulSet controller.
ServiceName string `json:"serviceName"` ServiceName string
} }
// StatefulSetStatus represents the current state of a StatefulSet. // StatefulSetStatus represents the current state of a StatefulSet.
type StatefulSetStatus struct { type StatefulSetStatus struct {
// most recent generation observed by this autoscaler. // most recent generation observed by this autoscaler.
// +optional // +optional
ObservedGeneration *int64 `json:"observedGeneration,omitempty"` ObservedGeneration *int64
// Replicas is the number of actual replicas. // Replicas is the number of actual replicas.
Replicas int32 `json:"replicas"` Replicas int32
} }
// StatefulSetList is a collection of StatefulSets. // StatefulSetList is a collection of StatefulSets.
type StatefulSetList struct { type StatefulSetList struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// +optional // +optional
metav1.ListMeta `json:"metadata,omitempty"` metav1.ListMeta
Items []StatefulSet `json:"items"` Items []StatefulSet
} }
...@@ -23,113 +23,113 @@ import ( ...@@ -23,113 +23,113 @@ import (
// Scale represents a scaling request for a resource. // Scale represents a scaling request for a resource.
type Scale struct { 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. // Standard object metadata; More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata.
// +optional // +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. // defines the behavior of the scale. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status.
// +optional // +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. // current status of the scale. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status. Read-only.
// +optional // +optional
Status ScaleStatus `json:"status,omitempty"` Status ScaleStatus
} }
// ScaleSpec describes the attributes of a scale subresource. // ScaleSpec describes the attributes of a scale subresource.
type ScaleSpec struct { type ScaleSpec struct {
// desired number of instances for the scaled object. // desired number of instances for the scaled object.
// +optional // +optional
Replicas int32 `json:"replicas,omitempty"` Replicas int32
} }
// ScaleStatus represents the current status of a scale subresource. // ScaleStatus represents the current status of a scale subresource.
type ScaleStatus struct { type ScaleStatus struct {
// actual number of observed instances of the scaled object. // 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 // 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 // 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. // 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 // More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional // +optional
Selector string `json:"selector,omitempty"` Selector string
} }
// CrossVersionObjectReference contains enough information to let you identify the referred resource. // CrossVersionObjectReference contains enough information to let you identify the referred resource.
type CrossVersionObjectReference struct { type CrossVersionObjectReference struct {
// Kind of the referent; More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds" // 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 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 // API version of the referent
// +optional // +optional
APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,3,opt,name=apiVersion"` APIVersion string
} }
// specification of a horizontal pod autoscaler. // specification of a horizontal pod autoscaler.
type HorizontalPodAutoscalerSpec struct { type HorizontalPodAutoscalerSpec struct {
// reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption // 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. // 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. // lower limit for the number of pods that can be set by the autoscaler, default 1.
// +optional // +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. // 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; // 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. // if not specified the default autoscaling policy will be used.
// +optional // +optional
TargetCPUUtilizationPercentage *int32 `json:"targetCPUUtilizationPercentage,omitempty"` TargetCPUUtilizationPercentage *int32
} }
// current status of a horizontal pod autoscaler // current status of a horizontal pod autoscaler
type HorizontalPodAutoscalerStatus struct { type HorizontalPodAutoscalerStatus struct {
// most recent generation observed by this autoscaler. // most recent generation observed by this autoscaler.
// +optional // +optional
ObservedGeneration *int64 `json:"observedGeneration,omitempty"` ObservedGeneration *int64
// last time the HorizontalPodAutoscaler scaled the number of pods; // last time the HorizontalPodAutoscaler scaled the number of pods;
// used by the autoscaler to control how often the number of pods is changed. // used by the autoscaler to control how often the number of pods is changed.
// +optional // +optional
LastScaleTime *metav1.Time `json:"lastScaleTime,omitempty"` LastScaleTime *metav1.Time
// current number of replicas of pods managed by this autoscaler. // 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. // 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, // 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. // e.g. 70 means that an average pod is using now 70% of its requested CPU.
// +optional // +optional
CurrentCPUUtilizationPercentage *int32 `json:"currentCPUUtilizationPercentage,omitempty"` CurrentCPUUtilizationPercentage *int32
} }
// +genclient=true // +genclient=true
// configuration of a horizontal pod autoscaler. // configuration of a horizontal pod autoscaler.
type HorizontalPodAutoscaler struct { type HorizontalPodAutoscaler struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// +optional // +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. // behaviour of autoscaler. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status.
// +optional // +optional
Spec HorizontalPodAutoscalerSpec `json:"spec,omitempty"` Spec HorizontalPodAutoscalerSpec
// current information about the autoscaler. // current information about the autoscaler.
// +optional // +optional
Status HorizontalPodAutoscalerStatus `json:"status,omitempty"` Status HorizontalPodAutoscalerStatus
} }
// list of horizontal pod autoscaler objects. // list of horizontal pod autoscaler objects.
type HorizontalPodAutoscalerList struct { type HorizontalPodAutoscalerList struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// +optional // +optional
metav1.ListMeta `json:"metadata,omitempty"` metav1.ListMeta
// list of horizontal pod autoscaler objects. // list of horizontal pod autoscaler objects.
Items []HorizontalPodAutoscaler `json:"items"` Items []HorizontalPodAutoscaler
} }
...@@ -25,47 +25,47 @@ import ( ...@@ -25,47 +25,47 @@ import (
// Job represents the configuration of a single job. // Job represents the configuration of a single job.
type Job struct { type Job struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// Standard object's metadata. // Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
api.ObjectMeta `json:"metadata,omitempty"` api.ObjectMeta
// Spec is a structure defining the expected behavior of a job. // 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 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional // +optional
Spec JobSpec `json:"spec,omitempty"` Spec JobSpec
// Status is a structure describing current status of a job. // 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 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional // +optional
Status JobStatus `json:"status,omitempty"` Status JobStatus
} }
// JobList is a collection of jobs. // JobList is a collection of jobs.
type JobList struct { type JobList struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// Standard list metadata // Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
metav1.ListMeta `json:"metadata,omitempty"` metav1.ListMeta
// Items is the list of Job. // Items is the list of Job.
Items []Job `json:"items"` Items []Job
} }
// JobTemplate describes a template for creating copies of a predefined pod. // JobTemplate describes a template for creating copies of a predefined pod.
type JobTemplate struct { type JobTemplate struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// Standard object's metadata. // Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
api.ObjectMeta `json:"metadata,omitempty"` api.ObjectMeta
// Template defines jobs that will be created from this template // Template defines jobs that will be created from this template
// http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status // http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional // +optional
Template JobTemplateSpec `json:"template,omitempty"` Template JobTemplateSpec
} }
// JobTemplateSpec describes the data a Job should have when created from a template // JobTemplateSpec describes the data a Job should have when created from a template
...@@ -73,12 +73,12 @@ type JobTemplateSpec struct { ...@@ -73,12 +73,12 @@ type JobTemplateSpec struct {
// Standard object's metadata of the jobs created from this template. // Standard object's metadata of the jobs created from this template.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
api.ObjectMeta `json:"metadata,omitempty"` api.ObjectMeta
// Specification of the desired behavior of the job. // Specification of the desired behavior of the job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional // +optional
Spec JobSpec `json:"spec,omitempty"` Spec JobSpec
} }
// JobSpec describes how the job execution will look like. // JobSpec describes how the job execution will look like.
...@@ -89,7 +89,7 @@ type JobSpec struct { ...@@ -89,7 +89,7 @@ type JobSpec struct {
// be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), // 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. // i.e. when the work left to do is less than max parallelism.
// +optional // +optional
Parallelism *int32 `json:"parallelism,omitempty"` Parallelism *int32
// Completions specifies the desired number of successfully finished pods the // Completions specifies the desired number of successfully finished pods the
// job should be run with. Setting to nil means that the success of any // job should be run with. Setting to nil means that the success of any
...@@ -97,17 +97,17 @@ type JobSpec struct { ...@@ -97,17 +97,17 @@ type JobSpec struct {
// value. Setting to 1 means that parallelism is limited to 1 and the success of that // value. Setting to 1 means that parallelism is limited to 1 and the success of that
// pod signals the success of the job. // pod signals the success of the job.
// +optional // +optional
Completions *int32 `json:"completions,omitempty"` Completions *int32
// Optional duration in seconds relative to the startTime that the job may be active // 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 // before the system tries to terminate it; value must be positive integer
// +optional // +optional
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"` ActiveDeadlineSeconds *int64
// Selector is a label query over pods that should match the pod count. // Selector is a label query over pods that should match the pod count.
// Normally, the system sets this field for you. // Normally, the system sets this field for you.
// +optional // +optional
Selector *metav1.LabelSelector `json:"selector,omitempty"` Selector *metav1.LabelSelector
// ManualSelector controls generation of pod labels and pod selectors. // ManualSelector controls generation of pod labels and pod selectors.
// Leave `manualSelector` unset unless you are certain what you are doing. // Leave `manualSelector` unset unless you are certain what you are doing.
...@@ -119,11 +119,11 @@ type JobSpec struct { ...@@ -119,11 +119,11 @@ type JobSpec struct {
// `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` // `manualSelector=true` in jobs that were created with the old `extensions/v1beta1`
// API. // API.
// +optional // +optional
ManualSelector *bool `json:"manualSelector,omitempty"` ManualSelector *bool
// Template is the object that describes the pod that will be created when // Template is the object that describes the pod that will be created when
// executing a job. // executing a job.
Template api.PodTemplateSpec `json:"template"` Template api.PodTemplateSpec
} }
// JobStatus represents the current state of a Job. // JobStatus represents the current state of a Job.
...@@ -131,31 +131,31 @@ type JobStatus struct { ...@@ -131,31 +131,31 @@ type JobStatus struct {
// Conditions represent the latest available observations of an object's current state. // Conditions represent the latest available observations of an object's current state.
// +optional // +optional
Conditions []JobCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` Conditions []JobCondition
// StartTime represents time when the job was acknowledged by the Job Manager. // 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 not guaranteed to be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC. // It is represented in RFC3339 form and is in UTC.
// +optional // +optional
StartTime *metav1.Time `json:"startTime,omitempty"` StartTime *metav1.Time
// CompletionTime represents time when the job was completed. It is not guaranteed to // CompletionTime represents time when the job was completed. It is not guaranteed to
// be set in happens-before order across separate operations. // be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC. // It is represented in RFC3339 form and is in UTC.
// +optional // +optional
CompletionTime *metav1.Time `json:"completionTime,omitempty"` CompletionTime *metav1.Time
// Active is the number of actively running pods. // Active is the number of actively running pods.
// +optional // +optional
Active int32 `json:"active,omitempty"` Active int32
// Succeeded is the number of pods which reached Phase Succeeded. // Succeeded is the number of pods which reached Phase Succeeded.
// +optional // +optional
Succeeded int32 `json:"succeeded,omitempty"` Succeeded int32
// Failed is the number of pods which reached Phase Failed. // Failed is the number of pods which reached Phase Failed.
// +optional // +optional
Failed int32 `json:"failed,omitempty"` Failed int32
} }
type JobConditionType string type JobConditionType string
...@@ -171,79 +171,79 @@ const ( ...@@ -171,79 +171,79 @@ const (
// JobCondition describes current state of a job. // JobCondition describes current state of a job.
type JobCondition struct { type JobCondition struct {
// Type of job condition, Complete or Failed. // Type of job condition, Complete or Failed.
Type JobConditionType `json:"type"` Type JobConditionType
// Status of the condition, one of True, False, Unknown. // Status of the condition, one of True, False, Unknown.
Status api.ConditionStatus `json:"status"` Status api.ConditionStatus
// Last time the condition was checked. // Last time the condition was checked.
// +optional // +optional
LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"` LastProbeTime metav1.Time
// Last time the condition transit from one status to another. // Last time the condition transit from one status to another.
// +optional // +optional
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` LastTransitionTime metav1.Time
// (brief) reason for the condition's last transition. // (brief) reason for the condition's last transition.
// +optional // +optional
Reason string `json:"reason,omitempty"` Reason string
// Human readable message indicating details about last transition. // Human readable message indicating details about last transition.
// +optional // +optional
Message string `json:"message,omitempty"` Message string
} }
// +genclient=true // +genclient=true
// CronJob represents the configuration of a single cron job. // CronJob represents the configuration of a single cron job.
type CronJob struct { type CronJob struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// Standard object's metadata. // Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
api.ObjectMeta `json:"metadata,omitempty"` api.ObjectMeta
// Spec is a structure defining the expected behavior of a job, including the schedule. // 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 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional // +optional
Spec CronJobSpec `json:"spec,omitempty"` Spec CronJobSpec
// Status is a structure describing current status of a job. // 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 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional // +optional
Status CronJobStatus `json:"status,omitempty"` Status CronJobStatus
} }
// CronJobList is a collection of cron jobs. // CronJobList is a collection of cron jobs.
type CronJobList struct { type CronJobList struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// Standard list metadata // Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
metav1.ListMeta `json:"metadata,omitempty"` metav1.ListMeta
// Items is the list of CronJob. // 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. // CronJobSpec describes how the job execution will look like and when it will actually run.
type CronJobSpec struct { type CronJobSpec struct {
// Schedule contains the schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. // 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 // 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. // time for any reason. Missed jobs executions will be counted as failed ones.
// +optional // +optional
StartingDeadlineSeconds *int64 `json:"startingDeadlineSeconds,omitempty"` StartingDeadlineSeconds *int64
// ConcurrencyPolicy specifies how to treat concurrent executions of a Job. // ConcurrencyPolicy specifies how to treat concurrent executions of a Job.
// +optional // +optional
ConcurrencyPolicy ConcurrencyPolicy `json:"concurrencyPolicy,omitempty"` ConcurrencyPolicy ConcurrencyPolicy
// Suspend flag tells the controller to suspend subsequent executions, it does // Suspend flag tells the controller to suspend subsequent executions, it does
// not apply to already started executions. Defaults to false. // not apply to already started executions. Defaults to false.
// +optional // +optional
Suspend *bool `json:"suspend,omitempty"` Suspend *bool
// JobTemplate is the object that describes the job that will be created when // JobTemplate is the object that describes the job that will be created when
// executing a CronJob. // executing a CronJob.
JobTemplate JobTemplateSpec `json:"jobTemplate"` JobTemplate JobTemplateSpec
} }
// ConcurrencyPolicy describes how the job will be handled. // ConcurrencyPolicy describes how the job will be handled.
...@@ -268,9 +268,9 @@ const ( ...@@ -268,9 +268,9 @@ const (
type CronJobStatus struct { type CronJobStatus struct {
// Active holds pointers to currently running jobs. // Active holds pointers to currently running jobs.
// +optional // +optional
Active []api.ObjectReference `json:"active,omitempty"` Active []api.ObjectReference
// LastScheduleTime keeps information of when was the last time the job was successfully scheduled. // LastScheduleTime keeps information of when was the last time the job was successfully scheduled.
// +optional // +optional
LastScheduleTime *metav1.Time `json:"lastScheduleTime,omitempty"` LastScheduleTime *metav1.Time
} }
...@@ -26,17 +26,17 @@ import ( ...@@ -26,17 +26,17 @@ import (
// Describes a certificate signing request // Describes a certificate signing request
type CertificateSigningRequest struct { type CertificateSigningRequest struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// +optional // +optional
api.ObjectMeta `json:"metadata,omitempty"` api.ObjectMeta
// The certificate request itself and any additional information. // The certificate request itself and any additional information.
// +optional // +optional
Spec CertificateSigningRequestSpec `json:"spec,omitempty"` Spec CertificateSigningRequestSpec
// Derived information about the request. // Derived information about the request.
// +optional // +optional
Status CertificateSigningRequestStatus `json:"status,omitempty"` Status CertificateSigningRequestStatus
} }
// This information is immutable after the request is created. Only the Request // This information is immutable after the request is created. Only the Request
...@@ -44,26 +44,26 @@ type CertificateSigningRequest struct { ...@@ -44,26 +44,26 @@ type CertificateSigningRequest struct {
// Kubernetes and cannot be modified by users. // Kubernetes and cannot be modified by users.
type CertificateSigningRequestSpec struct { type CertificateSigningRequestSpec struct {
// Base64-encoded PKCS#10 CSR data // Base64-encoded PKCS#10 CSR data
Request []byte `json:"request"` Request []byte
// Information about the requesting user (if relevant) // Information about the requesting user (if relevant)
// See user.Info interface for details // See user.Info interface for details
// +optional // +optional
Username string `json:"username,omitempty"` Username string
// +optional // +optional
UID string `json:"uid,omitempty"` UID string
// +optional // +optional
Groups []string `json:"groups,omitempty"` Groups []string
} }
type CertificateSigningRequestStatus struct { type CertificateSigningRequestStatus struct {
// Conditions applied to the request, such as approval or denial. // Conditions applied to the request, such as approval or denial.
// +optional // +optional
Conditions []CertificateSigningRequestCondition `json:"conditions,omitempty"` Conditions []CertificateSigningRequestCondition
// If request was approved, the controller will place the issued certificate here. // If request was approved, the controller will place the issued certificate here.
// +optional // +optional
Certificate []byte `json:"certificate,omitempty"` Certificate []byte
} }
type RequestConditionType string type RequestConditionType string
...@@ -76,23 +76,23 @@ const ( ...@@ -76,23 +76,23 @@ const (
type CertificateSigningRequestCondition struct { type CertificateSigningRequestCondition struct {
// request approval state, currently Approved or Denied. // request approval state, currently Approved or Denied.
Type RequestConditionType `json:"type"` Type RequestConditionType
// brief reason for the request state // brief reason for the request state
// +optional // +optional
Reason string `json:"reason,omitempty"` Reason string
// human readable message with details about the request state // human readable message with details about the request state
// +optional // +optional
Message string `json:"message,omitempty"` Message string
// timestamp for the last update to this condition // timestamp for the last update to this condition
// +optional // +optional
LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"` LastUpdateTime metav1.Time
} }
type CertificateSigningRequestList struct { type CertificateSigningRequestList struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// +optional // +optional
metav1.ListMeta `json:"metadata,omitempty"` metav1.ListMeta
// +optional // +optional
Items []CertificateSigningRequest `json:"items,omitempty"` Items []CertificateSigningRequest
} }
...@@ -29,12 +29,12 @@ type PodDisruptionBudgetSpec struct { ...@@ -29,12 +29,12 @@ type PodDisruptionBudgetSpec struct {
// absence of the evicted pod. So for example you can prevent all voluntary // absence of the evicted pod. So for example you can prevent all voluntary
// evictions by specifying "100%". // evictions by specifying "100%".
// +optional // +optional
MinAvailable intstr.IntOrString `json:"minAvailable,omitempty"` MinAvailable intstr.IntOrString
// Label query over pods whose evictions are managed by the disruption // Label query over pods whose evictions are managed by the disruption
// budget. // budget.
// +optional // +optional
Selector *metav1.LabelSelector `json:"selector,omitempty"` Selector *metav1.LabelSelector
} }
// PodDisruptionBudgetStatus represents information about the status of a // PodDisruptionBudgetStatus represents information about the status of a
...@@ -43,7 +43,7 @@ type PodDisruptionBudgetStatus struct { ...@@ -43,7 +43,7 @@ type PodDisruptionBudgetStatus struct {
// Most recent generation observed when updating this PDB status. PodDisruptionsAllowed and other // 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. // status informatio is valid only if observedGeneration equals to PDB's object generation.
// +optional // +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"` ObservedGeneration int64
// DisruptedPods contains information about pods whose eviction was // DisruptedPods contains information about pods whose eviction was
// processed by the API server eviction subresource handler but has not // processed by the API server eviction subresource handler but has not
...@@ -56,43 +56,43 @@ type PodDisruptionBudgetStatus struct { ...@@ -56,43 +56,43 @@ type PodDisruptionBudgetStatus struct {
// the list automatically by PodDisruptionBudget controller after some time. // the list automatically by PodDisruptionBudget controller after some time.
// If everything goes smooth this map should be empty for the most of the 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. // 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. // Number of pod disruptions that are currently allowed.
PodDisruptionsAllowed int32 `json:"disruptionsAllowed"` PodDisruptionsAllowed int32
// current number of healthy pods // current number of healthy pods
CurrentHealthy int32 `json:"currentHealthy"` CurrentHealthy int32
// minimum desired number of healthy pods // minimum desired number of healthy pods
DesiredHealthy int32 `json:"desiredHealthy"` DesiredHealthy int32
// total number of pods counted by this disruption budget // total number of pods counted by this disruption budget
ExpectedPods int32 `json:"expectedPods"` ExpectedPods int32
} }
// +genclient=true // +genclient=true
// PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods
type PodDisruptionBudget struct { type PodDisruptionBudget struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// +optional // +optional
api.ObjectMeta `json:"metadata,omitempty"` api.ObjectMeta
// Specification of the desired behavior of the PodDisruptionBudget. // Specification of the desired behavior of the PodDisruptionBudget.
// +optional // +optional
Spec PodDisruptionBudgetSpec `json:"spec,omitempty"` Spec PodDisruptionBudgetSpec
// Most recently observed status of the PodDisruptionBudget. // Most recently observed status of the PodDisruptionBudget.
// +optional // +optional
Status PodDisruptionBudgetStatus `json:"status,omitempty"` Status PodDisruptionBudgetStatus
} }
// PodDisruptionBudgetList is a collection of PodDisruptionBudgets. // PodDisruptionBudgetList is a collection of PodDisruptionBudgets.
type PodDisruptionBudgetList struct { type PodDisruptionBudgetList struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// +optional // +optional
metav1.ListMeta `json:"metadata,omitempty"` metav1.ListMeta
Items []PodDisruptionBudget `json:"items"` Items []PodDisruptionBudget
} }
// +genclient=true // +genclient=true
...@@ -102,13 +102,13 @@ type PodDisruptionBudgetList struct { ...@@ -102,13 +102,13 @@ type PodDisruptionBudgetList struct {
// This is a subresource of Pod. A request to cause such an eviction is // This is a subresource of Pod. A request to cause such an eviction is
// created by POSTing to .../pods/<pod name>/eviction. // created by POSTing to .../pods/<pod name>/eviction.
type Eviction struct { type Eviction struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// ObjectMeta describes the pod that is being evicted. // ObjectMeta describes the pod that is being evicted.
// +optional // +optional
api.ObjectMeta `json:"metadata,omitempty"` api.ObjectMeta
// DeleteOptions may be provided // DeleteOptions may be provided
// +optional // +optional
DeleteOptions *api.DeleteOptions `json:"deleteOptions,omitempty"` DeleteOptions *api.DeleteOptions
} }
...@@ -31,15 +31,15 @@ import ( ...@@ -31,15 +31,15 @@ import (
// called "profiles" in other storage systems. // called "profiles" in other storage systems.
// The name of a StorageClass object is significant, and is how users can request a particular class. // The name of a StorageClass object is significant, and is how users can request a particular class.
type StorageClass struct { type StorageClass struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// +optional // +optional
api.ObjectMeta `json:"metadata,omitempty"` api.ObjectMeta
// provisioner is the driver expected to handle this StorageClass. // provisioner is the driver expected to handle this StorageClass.
// This is an optionally-prefixed name, like a label key. // This is an optionally-prefixed name, like a label key.
// For example: "kubernetes.io/gce-pd" or "kubernetes.io/aws-ebs". // For example: "kubernetes.io/gce-pd" or "kubernetes.io/aws-ebs".
// This value may not be empty. // This value may not be empty.
Provisioner string `json:"provisioner"` Provisioner string
// parameters holds parameters for the provisioner. // parameters holds parameters for the provisioner.
// These values are opaque to the system and are passed directly // These values are opaque to the system and are passed directly
...@@ -47,17 +47,17 @@ type StorageClass struct { ...@@ -47,17 +47,17 @@ type StorageClass struct {
// not empty. The maximum number of parameters is // not empty. The maximum number of parameters is
// 512, with a cumulative max size of 256K // 512, with a cumulative max size of 256K
// +optional // +optional
Parameters map[string]string `json:"parameters,omitempty"` Parameters map[string]string
} }
// StorageClassList is a collection of storage classes. // StorageClassList is a collection of storage classes.
type StorageClassList struct { type StorageClassList struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// Standard list metadata // Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
metav1.ListMeta `json:"metadata,omitempty"` metav1.ListMeta
// Items is the list of StorageClasses // Items is the list of StorageClasses
Items []StorageClass `json:"items"` Items []StorageClass
} }
...@@ -25,34 +25,34 @@ import ( ...@@ -25,34 +25,34 @@ import (
) )
type Policy struct { type Policy struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// Holds the information to configure the fit predicate functions // Holds the information to configure the fit predicate functions
Predicates []PredicatePolicy `json:"predicates"` Predicates []PredicatePolicy
// Holds the information to configure the priority functions // Holds the information to configure the priority functions
Priorities []PriorityPolicy `json:"priorities"` Priorities []PriorityPolicy
// Holds the information to communicate with the extender(s) // Holds the information to communicate with the extender(s)
ExtenderConfigs []ExtenderConfig `json:"extenders"` ExtenderConfigs []ExtenderConfig
} }
type PredicatePolicy struct { type PredicatePolicy struct {
// Identifier of the predicate policy // Identifier of the predicate policy
// For a custom predicate, the name can be user-defined // 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 // 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 // Holds the parameters to configure the given predicate
Argument *PredicateArgument `json:"argument"` Argument *PredicateArgument
} }
type PriorityPolicy struct { type PriorityPolicy struct {
// Identifier of the priority policy // Identifier of the priority policy
// For a custom priority, the name can be user-defined // 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 // 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 numeric multiplier for the node scores that the priority function generates
// The weight should be a positive integer // The weight should be a positive integer
Weight int `json:"weight"` Weight int
// Holds the parameters to configure the given priority function // 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 // Represents the arguments that the different types of predicates take
...@@ -60,10 +60,10 @@ type PriorityPolicy struct { ...@@ -60,10 +60,10 @@ type PriorityPolicy struct {
type PredicateArgument struct { type PredicateArgument struct {
// The predicate that provides affinity for pods belonging to a service // The predicate that provides affinity for pods belonging to a service
// It uses a label to identify nodes that belong to the same "group" // 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 // The predicate that checks whether a particular node has a certain label
// defined or not, regardless of value // defined or not, regardless of value
LabelsPresence *LabelsPresence `json:"labelsPresence"` LabelsPresence *LabelsPresence
} }
// Represents the arguments that the different types of priorities take. // Represents the arguments that the different types of priorities take.
...@@ -71,72 +71,72 @@ type PredicateArgument struct { ...@@ -71,72 +71,72 @@ type PredicateArgument struct {
type PriorityArgument struct { type PriorityArgument struct {
// The priority function that ensures a good spread (anti-affinity) for pods belonging to a service // 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" // 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 // The priority function that checks whether a particular node has a certain label
// defined or not, regardless of value // defined or not, regardless of value
LabelPreference *LabelPreference `json:"labelPreference"` LabelPreference *LabelPreference
} }
// Holds the parameters that are used to configure the corresponding predicate // Holds the parameters that are used to configure the corresponding predicate
type ServiceAffinity struct { type ServiceAffinity struct {
// The list of labels that identify node "groups" // 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 // 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 // Holds the parameters that are used to configure the corresponding predicate
type LabelsPresence struct { type LabelsPresence struct {
// The list of labels that identify node "groups" // 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 // 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 // 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 // Holds the parameters that are used to configure the corresponding priority function
type ServiceAntiAffinity struct { type ServiceAntiAffinity struct {
// Used to identify node "groups" // Used to identify node "groups"
Label string `json:"label"` Label string
} }
// Holds the parameters that are used to configure the corresponding priority function // Holds the parameters that are used to configure the corresponding priority function
type LabelPreference struct { type LabelPreference struct {
// Used to identify node "groups" // Used to identify node "groups"
Label string `json:"label"` Label string
// This is a boolean flag // This is a boolean flag
// If true, higher priority is given to nodes that have the label // 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 // 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, // 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. // it is assumed that the extender chose not to provide that extension.
type ExtenderConfig struct { type ExtenderConfig struct {
// URLPrefix at which the extender is available // 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. // 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. // 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 numeric multiplier for the node scores that the prioritize call generates.
// The weight should be a positive integer // 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 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 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 // 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. // 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 // ExtenderArgs represents the arguments needed by the extender to filter/prioritize
// nodes for a pod. // nodes for a pod.
type ExtenderArgs struct { type ExtenderArgs struct {
// Pod being scheduled // Pod being scheduled
Pod v1.Pod `json:"pod"` Pod v1.Pod
// List of candidate nodes where the pod can be scheduled // 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 // FailedNodesMap represents the filtered out nodes, with node names and failure messages
...@@ -145,19 +145,19 @@ type FailedNodesMap map[string]string ...@@ -145,19 +145,19 @@ type FailedNodesMap map[string]string
// ExtenderFilterResult represents the results of a filter call to an extender // ExtenderFilterResult represents the results of a filter call to an extender
type ExtenderFilterResult struct { type ExtenderFilterResult struct {
// Filtered set of nodes where the pod can be scheduled // 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 // 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 message indicating failure
Error string `json:"error,omitempty"` Error string
} }
// HostPriority represents the priority of scheduling to a particular host, higher priority is better. // HostPriority represents the priority of scheduling to a particular host, higher priority is better.
type HostPriority struct { type HostPriority struct {
// Name of the host // Name of the host
Host string `json:"host"` Host string
// Score associated with the host // Score associated with the host
Score int `json:"score"` Score int
} }
type HostPriorityList []HostPriority type HostPriorityList []HostPriority
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment