Add Daemon API

This commit is contained in:
AnanyaKumar
2015-07-25 12:08:34 -07:00
committed by Ananya Kumar
parent 0d1f2cd227
commit d9b85652ae
14 changed files with 965 additions and 15 deletions

View File

@@ -1054,6 +1054,54 @@ type ReplicationControllerList struct {
Items []ReplicationController `json:"items"`
}
// DaemonSpec is the specification of a daemon.
type DaemonSpec struct {
// Selector is a label query over pods that are managed by the daemon.
Selector map[string]string `json:"selector"`
// Template is the object that describes the pod that will be created.
// The Daemon 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).
Template *PodTemplateSpec `json:"template,omitempty"`
}
// DaemonStatus represents the current status of a daemon.
type DaemonStatus struct {
// CurrentNumberScheduled is the number of nodes that are running exactly 1 copy of the
// daemon and are supposed to run the daemon.
CurrentNumberScheduled int `json:"currentNumberScheduled"`
// NumberMisscheduled is the number of nodes that are running the daemon, but are
// not supposed to run the daemon.
NumberMisscheduled int `json:"numberMisscheduled"`
// DesiredNumberScheduled is the total number of nodes that should be running the daemon
// (including nodes correctly running the daemon).
DesiredNumberScheduled int `json:"desiredNumberScheduled"`
}
// Daemon represents the configuration of a daemon.
type Daemon struct {
TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`
// Spec defines the desired behavior of this daemon.
Spec DaemonSpec `json:"spec,omitempty"`
// Status is the current status of this daemon. This data may be
// out of date by some window of time.
Status DaemonStatus `json:"status,omitempty"`
}
// DaemonList is a collection of daemon.
type DaemonList struct {
TypeMeta `json:",inline"`
ListMeta `json:"metadata,omitempty"`
Items []Daemon `json:"items"`
}
const (
// ClusterIPNone - do not assign a cluster IP
// no proxying required and no environment variables should be created for pods
@@ -1927,6 +1975,8 @@ const (
ResourceServices ResourceName = "services"
// ReplicationControllers, number
ResourceReplicationControllers ResourceName = "replicationcontrollers"
// Daemon, number
ResourceDaemon ResourceName = "daemon"
// ResourceQuotas, number
ResourceQuotas ResourceName = "resourcequotas"
// ResourceSecrets, number