client

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2017 License: Apache-2.0 Imports: 5 Imported by: 12

README

k8s-client GoDoc

k8s-client is a Kubernetes client for Go.

Notice

Master should not be considered stable. Please vendor a tagged version. I will be making breaking changes to the API. Also import paths have changed to github.com/bakins/k8s-client

Status

k8s-client should be considered alpha quality. The API is subject to change.

k8s-client does not have 100% coverage of the Kubenretes API, but supports the common operations. Submit an issue or PR for support of others.

Motivation

The "official" Kubernetes client for Go is part of the Kubernetes project proper and lives within the main Kubernetes repository. It also requires a rather large number of dependencies.

k8s-client is a small simple API client.

License

Apache 2 License

k8s-client also includes parts of the Kubernetes code that is also under the Apache 2 License.

Usage

See GoDoc for documentation.

Testing

To test the included Kubernetes http client, I use minikube to start a local cluster. Then I run kubectl proxy to proxy to the local cluster without authentication (this makes testing easier). Then:

cd http
go test -v

The tests will try to connect to Kubernetes at http://127.0.0.1:8001. This can be overriden using the K8S_SERVER environment value.

TODO

  • Mock client for testing
  • Better docs/examples
  • Support all the Kubernetes types and operations
  • Support watches

Documentation

Overview

Package client provides a simple Kubernetes client

Index

Constants

View Source
const (
	RestartPolicyAlways    RestartPolicy = "Always"
	RestartPolicyOnFailure RestartPolicy = "OnFailure"
	RestartPolicyNever     RestartPolicy = "Never"
	DNSClusterFirst        DNSPolicy     = "ClusterFirst"
	DNSDefault             DNSPolicy     = "Default"
	// URISchemeHTTP means that the scheme used will be http://
	URISchemeHTTP URIScheme = "HTTP"
	// URISchemeHTTPS means that the scheme used will be https://
	URISchemeHTTPS URIScheme = "HTTPS"
	// CPU, in cores. (500m = .5 cores)
	ResourceCPU ResourceName = "cpu"
	// Memory, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)
	ResourceMemory ResourceName = "memory"
	// Volume size, in bytes (e,g. 5Gi = 5GiB = 5 * 1024 * 1024 * 1024)
	ResourceStorage ResourceName = "storage"
	// PullAlways means that kubelet always attempts to pull the latest image.  Container will fail If the pull fails.
	PullAlways PullPolicy = "Always"
	// PullNever means that kubelet never pulls an image, but only uses a local image.  Container will fail if the image isn't present
	PullNever PullPolicy = "Never"
	// PullIfNotPresent means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails.
	PullIfNotPresent PullPolicy = "IfNotPresent"
	// PodPending means the pod has been accepted by the system, but one or more of the containers
	// has not been started. This includes time before being bound to a node, as well as time spent
	// pulling images onto the host.
	PodPending PodPhase = "Pending"
	// PodRunning means the pod has been bound to a node and all of the containers have been started.
	// At least one container is still running or is in the process of being restarted.
	PodRunning PodPhase = "Running"
	// PodSucceeded means that all containers in the pod have voluntarily terminated
	// with a container exit code of 0, and the system is not going to restart any of these containers.
	PodSucceeded PodPhase = "Succeeded"
	// PodFailed means that all containers in the pod have terminated, and at least one container has
	// terminated in a failure (exited with a non-zero exit code or was stopped by the system).
	PodFailed PodPhase = "Failed"
	// PodUnknown means that for some reason the state of the pod could not be obtained, typically due
	// to an error in communicating with the host of the pod.
	PodUnknown PodPhase = "Unknown"
)
View Source
const (
	// ServiceTypeClusterIP means a service will only be accessible inside the
	// cluster, via the ClusterIP.
	ServiceTypeClusterIP ServiceType = "ClusterIP"

	// ServiceTypeNodePort means a service will be exposed on one port of
	// every node, in addition to 'ClusterIP' type.
	ServiceTypeNodePort ServiceType = "NodePort"

	// ServiceTypeLoadBalancer means a service will be exposed via an
	// external load balancer (if the cloud provider supports it), in addition
	// to 'NodePort' type.
	ServiceTypeLoadBalancer ServiceType = "LoadBalancer"

	// ServiceTypeExternalName means a service that does not have selectors.
	// It does not define any ports or endpoints.
	// Rather, it serves as a way to return an alias to an external service residing outside the cluster.
	ServiceTypeExternalName ServiceType = "ExternalName"

	// ServiceAffinityClientIP is the Client IP based.
	ServiceAffinityClientIP ServiceAffinity = "ClientIP"

	// ServiceAffinityNone - no session affinity.
	ServiceAffinityNone ServiceAffinity = "None"
)
View Source
const (
	StatusSuccess = "Success"
	StatusFailure = "Failure"
)

Values of Status.Status

View Source
const (
	// AffinityAnnotationKey represents the key of affinity data (json serialized)
	// in the Annotations of a Pod.
	AffinityAnnotationKey string = "scheduler.alpha.kubernetes.io/affinity"
)

Variables

This section is empty.

Functions

func IsNotFoundError

func IsNotFoundError(err error) bool

IsNotFoundError can be used to check if the error was a not found error.

Types

type Affinity

type Affinity struct {
	// Describes node affinity scheduling rules for the pod.
	NodeAffinity *NodeAffinity `json:"nodeAffinity,omitempty"`
	// Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).
	PodAffinity *PodAffinity `json:"podAffinity,omitempty"`
	// Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).
	PodAntiAffinity *PodAntiAffinity `json:"podAntiAffinity,omitempty"`
}

Affinity is a group of affinity scheduling rules.

type CauseType

type CauseType string

CauseType is a machine readable value providing more detail about what occurred in a status response. An operation may have multiple causes for a status (whether Failure or Success).

const (
	// CauseTypeFieldValueNotFound is used to report failure to find a requested value
	// (e.g. looking up an ID).
	CauseTypeFieldValueNotFound CauseType = "FieldValueNotFound"
	// CauseTypeFieldValueRequired is used to report required values that are not
	// provided (e.g. empty strings, null values, or empty arrays).
	CauseTypeFieldValueRequired CauseType = "FieldValueRequired"
	// CauseTypeFieldValueDuplicate is used to report collisions of values that must be
	// unique (e.g. unique IDs).
	CauseTypeFieldValueDuplicate CauseType = "FieldValueDuplicate"
	// CauseTypeFieldValueInvalid is used to report malformed values (e.g. failed regex
	// match).
	CauseTypeFieldValueInvalid CauseType = "FieldValueInvalid"
	// CauseTypeFieldValueNotSupported is used to report valid (as per formatting rules)
	// values that can not be handled (e.g. an enumerated string).
	CauseTypeFieldValueNotSupported CauseType = "FieldValueNotSupported"
	// CauseTypeUnexpectedServerResponse is used to report when the server responded to the client
	// without the expected return type. The presence of this cause indicates the error may be
	// due to an intervening proxy or the server software malfunctioning.
	CauseTypeUnexpectedServerResponse CauseType = "UnexpectedServerResponse"
)

type ConditionStatus

type ConditionStatus string

type ConfigMap

type ConfigMap struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata,omitempty"`
	Data       map[string][]byte `json:"data,omitempty"`
}

func NewConfigMap

func NewConfigMap(namespace, name string) *ConfigMap

NewConfigMap creates a new ConfigMap struct

type ConfigMapInterface

type ConfigMapInterface interface {
	CreateConfigMap(namespace string, item *ConfigMap) (*ConfigMap, error)
	GetConfigMap(namespace, name string) (result *ConfigMap, err error)
	ListConfigMaps(namespace string, opts *ListOptions) (*ConfigMapList, error)
	WatchConfigMaps(namespace string, opts *WatchOptions, events chan ConfigMapWatchEvent) error
	DeleteConfigMap(namespace, name string) error
	UpdateConfigMap(namespace string, item *ConfigMap) (*ConfigMap, error)
}

type ConfigMapKeySelector

type ConfigMapKeySelector struct {
	LocalObjectReference `json:",inline"`
	Key                  string `json:"key"`
}

type ConfigMapList

type ConfigMapList struct {
	TypeMeta `json:",inline"`
	ListMeta `json:"metadata,omitempty"`

	Items []ConfigMap `json:"items"`
}

type ConfigMapType

type ConfigMapType string

type ConfigMapWatchEvent

type ConfigMapWatchEvent interface {
	Type() WatchEventType
	Object() (*ConfigMap, error)
}

type Container

type Container struct {
	Name                   string                `json:"name"`
	Image                  string                `json:"image"`
	Command                []string              `json:"command,omitempty"`
	Args                   []string              `json:"args,omitempty"`
	WorkingDir             string                `json:"workingDir,omitempty"`
	Ports                  []ContainerPort       `json:"ports,omitempty"`
	Env                    []EnvVar              `json:"env,omitempty"`
	Resources              *ResourceRequirements `json:"resources,omitempty"`
	VolumeMounts           []VolumeMount         `json:"volumeMounts,omitempty"`
	LivenessProbe          *Probe                `json:"livenessProbe,omitempty"`
	ReadinessProbe         *Probe                `json:"readinessProbe,omitempty"`
	Lifecycle              *Lifecycle            `json:"lifecycle,omitempty"`
	TerminationMessagePath string                `json:"terminationMessagePath,omitempty"`
	ImagePullPolicy        PullPolicy            `json:"imagePullPolicy"`
	Stdin                  bool                  `json:"stdin,omitempty"`
	StdinOnce              bool                  `json:"stdinOnce,omitempty"`
	TTY                    bool                  `json:"tty,omitempty"`
}

type ContainerPort

type ContainerPort struct {
	Name          string   `json:"name,omitempty"`
	HostPort      int      `json:"hostPort,omitempty"`
	ContainerPort int      `json:"containerPort"`
	Protocol      Protocol `json:"protocol,omitempty"`
	HostIP        string   `json:"hostIP,omitempty"`
}

type ContainerState

type ContainerState struct {
	Waiting    *ContainerStateWaiting    `json:"waiting,omitempty"`
	Running    *ContainerStateRunning    `json:"running,omitempty"`
	Terminated *ContainerStateTerminated `json:"terminated,omitempty"`
}

ContainerState holds a possible state of container. Only one of its members may be specified. If none of them is specified, the default one is ContainerStateWaiting.

type ContainerStateRunning

type ContainerStateRunning struct {
	StartedAt Time `json:"startedAt,omitempty"`
}

type ContainerStateTerminated

type ContainerStateTerminated struct {
	ExitCode    int    `json:"exitCode"`
	Signal      int    `json:"signal,omitempty"`
	Reason      string `json:"reason,omitempty"`
	Message     string `json:"message,omitempty"`
	StartedAt   Time   `json:"startedAt,omitempty"`
	FinishedAt  Time   `json:"finishedAt,omitempty"`
	ContainerID string `json:"containerID,omitempty"`
}

type ContainerStateWaiting

type ContainerStateWaiting struct {
	// A brief CamelCase string indicating details about why the container is in waiting state.
	Reason string `json:"reason,omitempty"`
	// A human-readable message indicating details about why the container is in waiting state.
	Message string `json:"message,omitempty"`
}

type ContainerStatus

type ContainerStatus struct {
	// Each container in a pod must have a unique name.
	Name                 string          `json:"name"`
	State                *ContainerState `json:"state,omitempty"`
	LastTerminationState *ContainerState `json:"lastState,omitempty"`
	// Ready specifies whether the container has passed its readiness check.
	Ready bool `json:"ready"`
	// 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 int    `json:"restartCount"`
	Image        string `json:"image"`
	ImageID      string `json:"imageID"`
	ContainerID  string `json:"containerID,omitempty"`
}

ContainerStatus is the status of a single container within a pod.

type CrossVersionObjectReference

type CrossVersionObjectReference struct {
	// Kind of the referent; More info: http://releases.k8s.io/release-1.3/docs/devel/api-conventions.md#types-kinds"
	Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"`
	// Name of the referent; More info: http://releases.k8s.io/release-1.3/docs/user-guide/identifiers.md#names
	Name string `json:"name" protobuf:"bytes,2,opt,name=name"`
	// API version of the referent
	APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,3,opt,name=apiVersion"`
}

CrossVersionObjectReference contains enough information to let you identify the referred resource.

type DNSPolicy

type DNSPolicy string

type DaemonSet

type DaemonSet struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata,omitempty"`

	// Specification of the desired behavior of the DaemonSet.
	Spec *DaemonSetSpec `json:"spec,omitempty"`

	// Most recently observed status of the DaemonSet.
	Status *DaemonSetStatus `json:"status,omitempty"`
}

DaemonSet represents the configuration of a daemon set.

func NewDaemonSet

func NewDaemonSet(namespace, name string) *DaemonSet

NewDaemonSet creates a new DaemonSet struct

type DaemonSetInterface

type DaemonSetInterface interface {
	CreateDaemonSet(namespace string, item *DaemonSet) (*DaemonSet, error)
	GetDaemonSet(namespace, name string) (result *DaemonSet, err error)
	ListDaemonSets(namespace string, opts *ListOptions) (*DaemonSetList, error)
	WatchDaemonSets(namespace string, opts *WatchOptions, events chan DaemonSetWatchEvent) error
	DeleteDaemonSet(namespace, name string) error
	UpdateDaemonSet(namespace string, item *DaemonSet) (*DaemonSet, error)
}

DaemonSetInterface has methods to work with DaemonSet resources.

type DaemonSetList

type DaemonSetList struct {
	TypeMeta `json:",inline"`
	ListMeta `json:"metadata,omitempty"`

	// Items is the list of daemonsets.
	Items []DaemonSet `json:"items"`
}

type DaemonSetSpec

type DaemonSetSpec struct {
	// Selector is a label query over pods that are managed by the daemon set.
	// Must match in order to be controlled. If empty, defaulted to labels on Pod template.
	Selector *LabelSelector `json:"selector,omitempty"`

	// 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).
	Template PodTemplateSpec `json:"template"`
}

DaemonSetSpec is the specification of a daemon set.

type DaemonSetStatus

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"`
	// 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"`
	// 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"`
	// 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"`
}

DaemonSetStatus represents the current status of a daemon set.

type DaemonSetWatchEvent

type DaemonSetWatchEvent interface {
	Type() WatchEventType
	Object() (*DaemonSet, error)
}

type Deployment

type Deployment struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata,omitempty"`

	// Specification of the desired behavior of the Deployment.
	Spec *DeploymentSpec `json:"spec,omitempty"`

	// Most recently observed status of the Deployment.
	Status *DeploymentStatus `json:"status,omitempty"`
}

func NewDeployment

func NewDeployment(namespace, name string) *Deployment

NewDeployment creates a new Deployment struct

type DeploymentInterface

type DeploymentInterface interface {
	CreateDeployment(namespace string, item *Deployment) (*Deployment, error)
	GetDeployment(namespace, name string) (result *Deployment, err error)
	ListDeployments(namespace string, opts *ListOptions) (*DeploymentList, error)
	WatchDeployments(namespace string, opts *WatchOptions, events chan DeploymentWatchEvent) error
	DeleteDeployment(namespace, name string) error
	UpdateDeployment(namespace string, item *Deployment) (*Deployment, error)
}

DeploymentInterface has methods to work with Deployment resources.

type DeploymentList

type DeploymentList struct {
	TypeMeta `json:",inline"`
	ListMeta `json:"metadata,omitempty"`

	// Items is the list of deployments.
	Items []Deployment `json:"items"`
}

type DeploymentSpec

type DeploymentSpec struct {
	// Number of desired pods. This is a pointer to distinguish between explicit
	// zero and not specified. Defaults to 1.
	Replicas int `json:"replicas,omitempty"`

	// Label selector for pods. Existing ReplicaSets whose pods are
	// selected by this will be the ones affected by this deployment.
	Selector *LabelSelector `json:"selector,omitempty"`

	// Template describes the pods that will be created.
	Template PodTemplateSpec `json:"template"`

	// The deployment strategy to use to replace existing pods with new ones.
	Strategy *DeploymentStrategy `json:"strategy,omitempty"`

	// Minimum number of seconds for which a newly created pod should be ready
	// without any of its container crashing, for it to be considered available.
	// Defaults to 0 (pod will be considered available as soon as it is ready)
	MinReadySeconds int `json:"minReadySeconds,omitempty"`

	// The number of old ReplicaSets to retain to allow rollback.
	// This is a pointer to distinguish between explicit zero and not specified.
	RevisionHistoryLimit *int `json:"revisionHistoryLimit,omitempty"`

	// Indicates that the deployment is paused and will not be processed by the
	// deployment controller.
	Paused bool `json:"paused,omitempty"`
	// The config this deployment is rolling back to. Will be cleared after rollback is done.
	RollbackTo *RollbackConfig `json:"rollbackTo,omitempty"`
}

DeploymentSpec is the specification of the desired behavior of the Deployment.

type DeploymentStatus

type DeploymentStatus struct {
	// The generation observed by the deployment controller.
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Total number of non-terminated pods targeted by this deployment (their labels match the selector).
	Replicas int `json:"replicas,omitempty"`

	// Total number of non-terminated pods targeted by this deployment that have the desired template spec.
	UpdatedReplicas int `json:"updatedReplicas,omitempty"`

	// Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.
	AvailableReplicas int `json:"availableReplicas,omitempty"`

	// Total number of unavailable pods targeted by this deployment.
	UnavailableReplicas int `json:"unavailableReplicas,omitempty"`
}

DeploymentStatus is the most recently observed status of the Deployment.

type DeploymentStrategy

type DeploymentStrategy struct {
	// Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate.
	Type DeploymentStrategyType `json:"type,omitempty"`

	// Rolling update config params. Present only if DeploymentStrategyType =
	// RollingUpdate.
	//---
	// TODO: Update this to follow our convention for oneOf, whatever we decide it
	// to be.
	RollingUpdate *RollingUpdateDeployment `json:"rollingUpdate,omitempty"`
}

type DeploymentStrategyType

type DeploymentStrategyType string
const (
	// Kill all existing pods before creating new ones.
	RecreateDeploymentStrategyType DeploymentStrategyType = "Recreate"

	// Replace the old RCs by new one using rolling update i.e gradually scale down the old RCs and scale up the new one.
	RollingUpdateDeploymentStrategyType DeploymentStrategyType = "RollingUpdate"
)

type DeploymentWatchEvent

type DeploymentWatchEvent interface {
	Type() WatchEventType
	Object() (*Deployment, error)
}

type EmptyDirVolumeSource

type EmptyDirVolumeSource struct {
	Medium StorageMedium `json:"medium,omitempty"`
}

Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling.

type EndpointAddress

type EndpointAddress struct {
	// The IP of this endpoint.
	// May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), or link-local multicast ((224.0.0.0/24).
	// IPv6 is also accepted but not fully supported on all platforms.
	// Also, certain kubernetes components, like kube-proxy, are not IPv6 ready.
	IP string `json:"ip,omitempty"`
	// The Hostname of this endpoint
	Hostname string `json:"hostname,omitempty"`
	// Optional: Node hosting this endpoint. This can be used to determine endpoints local to a node.
	NodeName string `json:"nodeName,omitempty"`
	// Reference to object providing the endpoint.
	TargetRef *ObjectReference `json:"targetRef,omitempty"`
}

type EndpointPort

type EndpointPort struct {
	// The name of this port (corresponds to ServicePort.Name). Must be a DNS_LABEL.
	// Optional only if one port is defined.
	Name string `json:"name,omitempty"`
	// The port number of the endpoint.
	Port int32 `json:"port"`
	// The IP protocol for this port. Must be UDP or TCP. Default is TCP.
	Protocol string `json:"protocol,omitempty"`
}

type EndpointSubset

type EndpointSubset struct {
	// IP addresses which offer the related ports that are marked as ready.
	// These endpoints should be considered safe for load balancers and clients to utilize.
	Addresses []EndpointAddress `json:"addresses,omitempty"`

	// IP addresses which offer the related ports but are not currently marked as ready because
	// they have not yet finished starting, have recently failed a readiness check, or have recently failed a liveness check.
	NotReadyAddresses []EndpointAddress `json:"notReadyAddresses,omitempty"`

	// Port numbers available on the related IP addresses
	Ports []EndpointPort `json:"ports,omitempty"`
}

EndpointSubset is a group of addresses with a common set of ports. The expanded set of endpoints is the Cartesian product of Addresses x Ports.

type Endpoints

type Endpoints struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata,omitempty"`

	// The set of all endpoints is the union of all subsets.
	// Addresses are placed into subsets according to the IPs they share.
	// A single address with multiple ports, some of which are ready and some of which are not
	// (because they come from different containers) will result in the address being displayed in different
	// subsets for the different ports.
	// No address will appear in both Addresses and NotReadyAddresses in the same subset.
	// Sets of addresses and ports that comprise a service
	Subsets []EndpointSubset `json:"subsets,omitempty"`
}

Endpoints is a collection of endpoints that implement the actual service.

type EndpointsInterface

type EndpointsInterface interface {
	CreateEndpoints(namespace string, item *Endpoints) (*Endpoints, error)
	GetEndpoints(namespace, name string) (result *Endpoints, err error)
	ListEndpoints(namespace string, opts *ListOptions) (*EndpointsList, error)
	WatchEndpoints(namespace string, opts *WatchOptions, events chan EndpointsWatchEvent) error
	DeleteEndpoints(namespace, name string) error
	UpdateEndpoints(namespace string, item *Endpoints) (*Endpoints, error)
}

EndpointsInterface has methods to work with Endpoints resources.

type EndpointsList

type EndpointsList struct {
	TypeMeta `json:",inline"`
	ListMeta `json:"metadata,omitempty"`

	Items []Endpoints `json:"items"`
}

EndpointsList holds a list of endpoints.

type EndpointsWatchEvent

type EndpointsWatchEvent interface {
	Type() WatchEventType
	Object() (*Endpoints, error)
}

type EnvVar

type EnvVar struct {
	Name      string        `json:"name"`
	Value     string        `json:"value,omitempty"`
	ValueFrom *EnvVarSource `json:"valueFrom,omitempty"`
}

type EnvVarSource

type EnvVarSource struct {
	FieldRef        *ObjectFieldSelector  `json:"fieldRef,omitempty"`
	ConfigMapKeyRef *ConfigMapKeySelector `json:"configMapKeyRef,omitempty"`
	SecretKeyRef    *SecretKeySelector    `json:"secretKeyRef,omitempty"`
}

type ExecAction

type ExecAction struct {
	// Command is the command line to execute inside the container, the working directory for the
	// command  is root ('/') in the container's filesystem.  The command is simply exec'd, it is
	// not run inside a shell, so traditional shell instructions ('|', etc) won't work.  To use
	// a shell, you need to explicitly call out to that shell.
	Command []string `json:"command,omitempty"`
}

ExecAction describes a "run in container" action.

type FieldSelector

type FieldSelector map[string]string

type FinalizerName

type FinalizerName string

type HTTPGetAction

type HTTPGetAction struct {
	// Optional: Path to access on the HTTP server.
	Path string `json:"path,omitempty"`
	// Required: Name or number of the port to access on the container.
	Port intstr.IntOrString `json:"port,omitempty"`
	// Optional: Host name to connect to, defaults to the pod IP. You
	// probably want to set "Host" in httpHeaders instead.
	Host string `json:"host,omitempty"`
	// Optional: Scheme to use for connecting to the host, defaults to HTTP.
	Scheme URIScheme `json:"scheme,omitempty"`
	// Optional: Custom headers to set in the request. HTTP allows repeated headers.
	HTTPHeaders []HTTPHeader `json:"httpHeaders,omitempty"`
}

HTTPGetAction describes an action based on HTTP Get requests.

type HTTPHeader

type HTTPHeader struct {
	// The header field name
	Name string `json:"name"`
	// The header field value
	Value string `json:"value"`
}

HTTPHeader describes a custom header to be used in HTTP probes

type HTTPIngressPath

type HTTPIngressPath struct {
	// Path is an extended POSIX regex as defined by IEEE Std 1003.1, (i.e this follows the egrep/unix syntax,
	// not the perl syntax) matched against the path of an incoming request.
	// Currently it can contain characters disallowed from the conventional "path" part of a URL as defined by RFC 3986.
	// Paths must begin with a /. If unspecified, the path defaults to a catch all sending traffic to the backend.
	Path string `json:"path,omitempty"`

	// Backend defines the referenced service endpoint to which the traffic will be forwarded to.
	Backend IngressBackend `json:"backend"`
}

HTTPIngressPath associates a path regex with a backend. Incoming urls matching the path are forwarded to the backend.

type HTTPIngressRuleValue

type HTTPIngressRuleValue struct {
	// A collection of paths that map requests to backends
	Paths []HTTPIngressPath `json:"paths,omitempty"`
}

HTTPIngressRuleValue is a list of http selectors pointing to backends. In the example: http://<host>/<path>?<searchpart> → backend where where parts of the url correspond to RFC 3986, this resource will be used to match against everything after the last / and before the first ? or #.

type Handler

type Handler struct {
	// One and only one of the following should be specified.
	// Exec specifies the action to take.
	Exec *ExecAction `json:"exec,omitempty"`
	// HTTPGet specifies the http request to perform.
	HTTPGet *HTTPGetAction `json:"httpGet,omitempty"`
	// TCPSocket specifies an action involving a TCP port.
	// TODO: implement a realistic TCP lifecycle hook
	TCPSocket *TCPSocketAction `json:"tcpSocket,omitempty"`
}

Handler defines a specific action that should be taken TODO: pass structured data to these actions, and document that data here.

type HorizontalPodAutoscaler

type HorizontalPodAutoscaler struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata,omitempty"`

	// behaviour of autoscaler. More info: http://releases.k8s.io/release-1.3/docs/devel/api-conventions.md#spec-and-status.
	Spec *HorizontalPodAutoscalerSpec `json:"spec,omitempty"`

	// current information about the autoscaler.
	Status *HorizontalPodAutoscalerStatus `json:"status,omitempty"`
}

configuration of a horizontal pod autoscaler.

func NewHorizontalPodAutoscaler

func NewHorizontalPodAutoscaler(namespace, name string) *HorizontalPodAutoscaler

NewHorizontalPodAutoscaler creates a new HorizontalPodAutoscaler struct

type HorizontalPodAutoscalerInterface

type HorizontalPodAutoscalerInterface interface {
	CreateHorizontalPodAutoscaler(namespace string, item *HorizontalPodAutoscaler) (*HorizontalPodAutoscaler, error)
	GetHorizontalPodAutoscaler(namespace, name string) (result *HorizontalPodAutoscaler, err error)
	ListHorizontalPodAutoscalers(namespace string, opts *ListOptions) (*HorizontalPodAutoscalerList, error)
	WatchHorizontalPodAutoscalers(namespace string, opts *WatchOptions, events chan HorizontalPodAutoscalerWatchEvent) error
	DeleteHorizontalPodAutoscaler(namespace, name string) error
	UpdateHorizontalPodAutoscaler(namespace string, item *HorizontalPodAutoscaler) (*HorizontalPodAutoscaler, error)
}

type HorizontalPodAutoscalerList

type HorizontalPodAutoscalerList struct {
	TypeMeta `json:",inline"`
	ListMeta `json:"metadata,omitempty"`

	// list of horizontal pod autoscaler objects.
	Items []HorizontalPodAutoscaler `json:"items"`
}

list of horizontal pod autoscaler objects.

type HorizontalPodAutoscalerSpec

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"`
	// lower limit for the number of pods that can be set by the autoscaler, default 1.
	MinReplicas *int32 `json:"minReplicas,omitempty"`
	// upper limit for the number of pods that can be set by the autoscaler. It cannot be smaller than MinReplicas.
	MaxReplicas int32 `json:"maxReplicas"`
	// target average CPU utilization (represented as a percentage of requested CPU) over all the pods;
	// if not specified the default autoscaling policy will be used.
	TargetCPUUtilizationPercentage *int32 `json:"targetCPUUtilizationPercentage,omitempty"`
}

specification of a horizontal pod autoscaler.

type HorizontalPodAutoscalerStatus

type HorizontalPodAutoscalerStatus struct {
	// most recent generation observed by this autoscaler.
	ObservedGeneration *int64 `json:"observedGeneration,omitempty"`

	// last time the HorizontalPodAutoscaler scaled the number of pods;
	// used by the autoscaler to control how often the number of pods is changed.
	LastScaleTime *Time `json:"lastScaleTime,omitempty"`

	// current number of replicas of pods managed by this autoscaler.
	CurrentReplicas int32 `json:"currentReplicas"`

	// desired number of replicas of pods managed by this autoscaler.
	DesiredReplicas int32 `json:"desiredReplicas"`

	// 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.
	CurrentCPUUtilizationPercentage *int32 `json:"currentCPUUtilizationPercentage,omitempty"`
}

current status of a horizontal pod autoscaler

type HorizontalPodAutoscalerWatchEvent

type HorizontalPodAutoscalerWatchEvent interface {
	Type() WatchEventType
	Object() (*HorizontalPodAutoscaler, error)
}

type HostPathVolumeSource

type HostPathVolumeSource struct {
	// Path of the directory on the host.
	Path string `json:"path"`
}

Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling.

type Ingress

type Ingress struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata,omitempty"`

	// Spec is the desired state of the Ingress.
	Spec *IngressSpec `json:"spec,omitempty"`
	// Status is the current state of the Ingress.
	Status *IngressStatus `json:"status,omitempty"`
}

Ingress holds secret data of a certain type.

func NewIngress

func NewIngress(namespace, name string) *Ingress

NewIngress creates a new Ingress struct

type IngressBackend

type IngressBackend struct {
	//		Specifies the name of the referenced service.
	ServiceName string `json:"serviceName"`

	// Specifies the port of the referenced service.
	ServicePort intstr.IntOrString `json:"servicePort"`
}

IngressBackend describes all endpoints for a given service and port.

type IngressInterface

type IngressInterface interface {
	CreateIngress(namespace string, item *Ingress) (*Ingress, error)
	GetIngress(namespace, name string) (result *Ingress, err error)
	ListIngresses(namespace string, opts *ListOptions) (*IngressList, error)
	WatchIngresses(namespace string, opts *WatchOptions, events chan IngressWatchEvent) error
	DeleteIngress(namespace, name string) error
	UpdateIngress(namespace string, item *Ingress) (*Ingress, error)
}

IngressInterface has methods to work with Ingress resources.

type IngressList

type IngressList struct {
	TypeMeta `json:",inline"`
	ListMeta `json:"metadata,omitempty"`

	Items []Ingress `json:"items"`
}

IngressList holds a list of ingresses.

type IngressRule

type IngressRule struct {
	// Host is the fully qualified domain name of a network host, as defined by RFC 3986.
	// Note the following deviations from the "host" part of the URI as defined in the RFC:
	// 1. IPs are not allowed. Currently an IngressRuleValue can only apply to the IP in the Spec of the parent Ingress.
	// 2. The : delimiter is not respected because ports are not allowed.
	// Currently the port of an Ingress is implicitly :80 for http and :443 for https.
	// Both these may change in the future. Incoming requests are matched against the host before the IngressRuleValue.
	// If the host is unspecified, the Ingress routes all traffic based on the specified IngressRuleValue.
	Host string `json:"host,omitempty"`

	HTTP *HTTPIngressRuleValue `json:"http,omitempty"`
}

IngressRule represents the rules mapping the paths under a specified host to the related backend services. Incoming requests are first evaluated for a host match, then routed to the backend associated with the matching IngressRuleValue.

type IngressSpec

type IngressSpec struct {
	// A default backend capable of servicing requests that don’t match any rule.
	// At least one of backend or rules must be specified.
	// This field is optional to allow the loadbalancer controller or defaulting logic to specify a global default.
	Backend *IngressBackend `json:"backend,omitempty"`

	// TLS configuration.
	// Currently the Ingress only supports a single TLS port, 443.
	// If multiple members of this list specify different hosts, they will be multiplexed on the same port according to the hostname
	// specified through the SNI TLS extension, if the ingress controller fulfilling the ingress supports SNI.
	TLS []IngressTLS `json:"tls,omitempty"`

	// A list of host rules used to configure the Ingress.
	// If unspecified, or no rule matches, all traffic is sent to the default backend.
	Rules []IngressRule `json:"rules,omitempty"`
}

IngressSpec describes the Ingress the user wishes to exist.

type IngressStatus

type IngressStatus struct {
	// LoadBalancer contains the current status of the load-balancer.
	LoadBalancer *LoadBalancerStatus `json:"loadBalancer,omitempty"`
}

IngressStatus describe the current state of the Ingress.

type IngressTLS

type IngressTLS struct {
	// Hosts are a list of hosts included in the TLS certificate.
	// The values in this list must match the name/s used in the tlsSecret.
	// Defaults to the wildcard host setting for the loadbalancer controller fulfilling this Ingress, if left unspecified.
	Hosts []string `json:"hosts,omitempy"`

	// 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.
	SecretName string `json:"secretName,omitempty"`
}

IngressTLS describes the transport layer security associated with an Ingress.

type IngressWatchEvent

type IngressWatchEvent interface {
	Type() WatchEventType
	Object() (*Ingress, error)
}

type Job

type Job struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata,omitempty"`

	// Specification of the desired behavior of the Job.
	Spec *JobSpec `json:"spec,omitempty"`

	// Most recently observed status of the DaemonSet.
	Status *JobStatus `json:"status,omitempty"`
}

Job represents the configuration of a single job.

func NewJob

func NewJob(namespace, name string) *Job

NewJob creates a new Job struct

type JobCondition

type JobCondition struct {
	// Type of job condition, Complete or Failed.
	Type string `json:"type"`
	// Status of the condition, one of True, False, Unknown.
	Status string `json:"status"`
	// Last time the condition was checked.
	LastProbeTime Time `json:"lastProbeTime,omitempty"`
	// Last time the condition transit from one status to another.
	LastTransitionTime Time `json:"lastTransitionTime,omitempty"`
	// (brief) reason for the condition’s last transition.
	Reason string `json:"reason,omitempty"`
	// Human readable message indicating details about last transition.
	Message string `json:"message,omitempty"`
}

JobCondition describes current state of a job.

type JobInterface

type JobInterface interface {
	CreateJob(namespace string, item *Job) (*Job, error)
	GetJob(namespace, name string) (result *Job, err error)
	ListJobs(namespace string, opts *ListOptions) (*JobList, error)
	WatchJobs(namespace string, opts *WatchOptions, events chan JobWatchEvent) error
	DeleteJob(namespace, name string) error
	UpdateJob(namespace string, item *Job) (*Job, error)
}

JobInterface has methods to work with Job resources.

type JobList

type JobList struct {
	TypeMeta `json:",inline"`
	ListMeta `json:"metadata,omitempty"`

	// Items is the list of jobs.
	Items []Job `json:"items"`
}

type JobSpec

type JobSpec struct {
	// Parallelism specifies the maximum desired number of pods the job should run at any given time.
	// The actual number of pods running in steady state will be less than this number when
	// ((.spec.completions - .status.successful) < .spec.parallelism), i.e. when the work left to do is less than max parallelism.
	Parallelism int32 `json:"parallelism,omitempty"`
	// Completions specifies the desired number of successfully finished pods the job should be run with.
	// Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value.
	// Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job.
	Completions int32 `json:"completions,omitempty"`
	// Optional duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer
	ActiveDeadlineSeconds int64 `json:"activeDeadlineSeconds,omitempty"`
	// Selector is a label query over pods that should match the pod count. Normally, the system sets this field for you.
	Selector *LabelSelector `json:"selector,omitempty"`
	// ManualSelector controls generation of pod labels and pod selectors.
	// Leave manualSelector unset unless you are certain what you are doing.
	// When false or unset, the system pick labels unique to this job and appends those labels to the pod template.
	// When true, the user is responsible for picking unique labels and specifying the selector.
	// Failure to pick a unique label may cause this and other jobs to not function correctly.
	// However, You may see manualSelector=true in jobs that were created with the old extensions/v1beta1 API.
	ManualSelector bool `json:"manualSelector,omitempty"`
	// Template is the object that describes the pod that will be created when executing a job.
	Template PodTemplateSpec `json:"template"`
}

JobSpec describes how the job execution will look like.

type JobStatus

type JobStatus struct {
	// Conditions represent the latest available observations of an object’s current state
	Conditions []JobCondition `json:"conditions,omitempty"`
	// 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.
	StartTime Time `json:"startTime,omitempty"`
	// CompletionTime represents time when the job was completed.
	// It is not guaranteed to be set in happens-before order across separate operations.
	// It is represented in RFC3339 form and is in UTC.
	CompletionTime Time `json:"completionTime,omitempty"`
	// Active is the number of actively running pods.
	Active int32 `json:"active,omitempty"`
	// Succeeded is the number of pods which reached Phase Succeeded.
	Succeeded int32 `json:"succeeded,omitempty"`
	// Failed is the number of pods which reached Phase Failed.
	Failed int32 `json:"failed,omitempty"`
}

JobStatus represents the current status of a job.

type JobWatchEvent

type JobWatchEvent interface {
	Type() WatchEventType
	Object() (*Job, error)
}

type KeyToPath

type KeyToPath struct {
	// The key to project.
	Key string `json:"key"`
	// 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"`
	// 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.
	Mode int32 `json:"mode,omitempty"`
}

Maps a string key to a path within a volume.

type LabelSelector

type LabelSelector struct {
	// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
	// map is equivalent to an element of matchExpressions, whose key field is "key", the
	// operator is "In", and the values array contains only "value". The requirements are ANDed.
	MatchLabels map[string]string `json:"matchLabels,omitempty" protobuf:"bytes,1,rep,name=matchLabels"`
}

type Lifecycle

type Lifecycle struct {
	// PostStart is called immediately after a container is created.  If the handler fails, the container
	// is terminated and restarted.
	PostStart *Handler `json:"postStart,omitempty"`
	// PreStop is called immediately before a container is terminated.  The reason for termination is
	// passed to the handler.  Regardless of the outcome of the handler, the container is eventually terminated.
	PreStop *Handler `json:"preStop,omitempty"`
}

Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.

type ListMeta

type ListMeta struct {
	SelfLink        string `json:"selfLink,omitempty"`
	ResourceVersion string `json:"resourceVersion,omitempty"`
}

type ListObject

type ListObject interface {
	Object
	GetItems()
}

type ListOptions

type ListOptions struct {
	LabelSelector LabelSelector
	FieldSelector FieldSelector
}

type LoadBalancerIngress

type LoadBalancerIngress struct {
	// IP is set for load-balancer ingress points that are IP based
	// (typically GCE or OpenStack load-balancers)
	IP string `json:"ip,omitempty"`

	// Hostname is set for load-balancer ingress points that are DNS based
	// (typically AWS load-balancers)
	Hostname string `json:"hostname,omitempty"`
}

LoadBalancerIngress represents the status of a load-balancer ingress point: traffic intended for the service should be sent to an ingress point.

type LoadBalancerStatus

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.
	Ingress []LoadBalancerIngress `json:"ingress,omitempty"`
}

LoadBalancerStatus represents the status of a load-balancer

type LocalObjectReference

type LocalObjectReference struct {
	Name string `json:"name"`
}

type Namespace

type Namespace struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata,omitempty"`
	Spec       *NamespaceSpec   `json:"spec,omitempty"`
	Status     *NamespaceStatus `json:"status,omitempty"`
}

func NewNamespace

func NewNamespace(name string) *Namespace

NewNamespace creates a new namespace struct

type NamespaceInterface

type NamespaceInterface interface {
	CreateNamespace(item *Namespace) (*Namespace, error)
	GetNamespace(name string) (result *Namespace, err error)
	ListNamespaces(opts *ListOptions) (*NamespaceList, error)
	WatchNamespaces(opts *WatchOptions, events chan NamespaceWatchEvent) error
	DeleteNamespace(name string) error
	UpdateNamespace(item *Namespace) (*Namespace, error)
}

type NamespaceList

type NamespaceList struct {
	TypeMeta `json:",inline"`
	ListMeta `json:"metadata,omitempty"`

	Items []Namespace `json:"items"`
}

type NamespacePhase

type NamespacePhase string

type NamespaceSpec

type NamespaceSpec struct {
	Finalizers []FinalizerName
}

type NamespaceStatus

type NamespaceStatus struct {
	Phase NamespacePhase `json:"phase,omitempty"`
}

type NamespaceWatchEvent

type NamespaceWatchEvent interface {
	Type() WatchEventType
	Object() (*Namespace, error)
}

type NamespacedObject

type NamespacedObject interface {
	Object
	GetNamespace() string
}

type Node

type Node struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata,omitempty"`
	Spec       NodeSpec   `json:"spec,omitempty"`
	Status     NodeStatus `json:"status,omitempty"`
}

type NodeAddress

type NodeAddress struct {
	Type    NodeAddressType `json:"type"`
	Address string          `json:"address"`
}

type NodeAddressType

type NodeAddressType string

type NodeAffinity

type NodeAffinity struct {
	// 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
	// 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.
	RequiredDuringSchedulingIgnoredDuringExecution *NodeSelector `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"`

	// The scheduler will prefer to schedule pods to nodes that satisfy
	// the affinity expressions specified by this field, but it may choose
	// a node that violates one or more of the expressions. The node that is
	// most preferred is the one with the greatest sum of weights, i.e.
	// for each node that meets all of the scheduling requirements (resource
	// request, requiredDuringScheduling affinity expressions, etc.),
	// compute a sum by iterating through the elements of this field and adding
	// "weight" to the sum if the node matches the corresponding matchExpressions; the
	// node(s) with the highest sum are the most preferred.
	PreferredDuringSchedulingIgnoredDuringExecution []PreferredSchedulingTerm `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"`
}

NodeAffinity is a group of node affinity scheduling rules.

type NodeCondition

type NodeCondition struct {
	Type    NodeConditionType `json:"type"`
	Status  ConditionStatus   `json:"status"`
	Reason  string            `json:"reason,omitempty"`
	Message string            `json:"message,omitempty"`
}

type NodeConditionType

type NodeConditionType string

type NodeInterface

type NodeInterface interface {
	CreateNode(item *Node) (*Node, error)
	GetNode(name string) (result *Node, err error)
	ListNodes(opts *ListOptions) (*NodeList, error)
	WatchNodes(opts *WatchOptions, events chan NodeWatchEvent) error
	DeleteNode(name string) error
	UpdateNode(item *Node) (*Node, error)
}

type NodeList

type NodeList struct {
	TypeMeta `json:",inline"`
	ListMeta `json:"metadata,omitempty"`
	Items    []Node `json:"items"`
}

type NodePhase

type NodePhase string

type NodeSelector

type NodeSelector struct {
	// Required. A list of node selector terms. The terms are ORed.
	NodeSelectorTerms []NodeSelectorTerm `json:"nodeSelectorTerms"`
}

NodeSelector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.

type NodeSelectorRequirement

type NodeSelectorRequirement struct {
	// The label key that the selector applies to.
	Key string `json:"key,omitempty"`

	// Represents a key's relationship to a set of values.
	// Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
	Operator string `json:"operator,omitempty"`

	// 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.
	Values []string `json:"values,omitempty"`
}

A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.

type NodeSelectorTerm

type NodeSelectorTerm struct {
	// Required. A list of node selector requirements. The requirements are ANDed.
	MatchExpressions []NodeSelectorRequirement `json:"matchExpressions"`
}

A null or empty node selector term matches no objects.

type NodeSpec

type NodeSpec struct {
	PodCIDR       string `json:"podCIDR,omitempty"`
	ExternalID    string `json:"externalID,omitempty"`
	ProviderID    string `json:"providerID,omitempty"`
	Unschedulable bool   `json:"unschedulable,omitempty"`
}

type NodeStatus

type NodeStatus struct {
	Phase      NodePhase       `json:"phase,omitempty"`
	Conditions []NodeCondition `json:"conditions,omitempty"`
	Addresses  []NodeAddress   `json:"addresses,omitempty"`
	NodeInfo   *NodeSystemInfo `json:"nodeInfo,omitempty"`
}

type NodeSystemInfo

type NodeSystemInfo struct {
	// MachineID reported by the node. For unique machine identification in the cluster this field is prefered.
	MachineID string `json:"machineID"`
	// SystemUUID reported by the node. For unique machine identification MachineID is prefered. This field is specific to Red Hat hosts
	SystemUUID string `json:"systemUUID"`
	// Boot ID reported by the node.
	BootID string `json:"bootID"`
	// Kernel Version reported by the node from uname -r (e.g. 3.16.0-0.bpo.4-amd64).
	KernelVersion string `json:"kernelVersion"`
	// OS Image reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy)).
	OSImage string `json:"osImage"`
	// ContainerRuntime Version reported by the node through runtime remote API (e.g. docker://1.5.0).
	ContainerRuntimeVersion string `json:"containerRuntimeVersion"`
	// Kubelet Version reported by the node.
	KubeletVersion string `json:"kubeletVersion"`
	// KubeProxy Version reported by the node.
	KubeProxyVersion string `json:"kubeProxyVersion"`
	// The Operating System reported by the node.
	OperatingSystem string `json:"operatingSystem"`
	// The Architecture reported by the node.
	Architecture string `json:"architecture"`
}

NodeSystemInfo is a set of ids/uuids to uniquely identify the node.

type NodeWatchEvent

type NodeWatchEvent interface {
	Type() WatchEventType
	Object() (*Node, error)
}

type Object

type Object interface {
	GetKind() string
	GetAnnotations() map[string]string
	GetLabels() map[string]string
	SetLabels(labels map[string]string)
}

type ObjectFieldSelector

type ObjectFieldSelector struct {
	APIVersion string `json:"apiVersion"`
	FieldPath  string `json:"fieldPath"`
}

type ObjectMeta

type ObjectMeta struct {
	Name              string            `json:"name,omitempty"`
	Namespace         string            `json:"namespace,omitempty"`
	SelfLink          string            `json:"selfLink,omitempty"`
	UID               UID               `json:"uid,omitempty"`
	ResourceVersion   string            `json:"resourceVersion,omitempty"`
	CreationTimestamp *Time             `json:"creationTimestamp,omitempty"`
	DeletionTimestamp *Time             `json:"deletionTimestamp,omitempty"`
	Generation        int64             `json:"generation,omitempty"`
	Labels            map[string]string `json:"labels,omitempty"`
	Annotations       map[string]string `json:"annotations,omitempty"`
}

func NewObjectMeta

func NewObjectMeta(namespace, name string) ObjectMeta

NewObjectMeta creates a new ObjectMeta and initializes the given namespace, name & internal maps.

func (*ObjectMeta) GetAnnotations

func (o *ObjectMeta) GetAnnotations() map[string]string

func (*ObjectMeta) GetLabels

func (o *ObjectMeta) GetLabels() map[string]string

func (*ObjectMeta) GetNamespace

func (o *ObjectMeta) GetNamespace() string

func (*ObjectMeta) SetLabels

func (o *ObjectMeta) SetLabels(labels map[string]string)

type ObjectReference

type ObjectReference struct {
	Kind            string `json:"kind,omitempty"`
	Namespace       string `json:"namespace,omitempty"`
	Name            string `json:"name,omitempty"`
	UID             UID    `json:"uid,omitempty"`
	APIVersion      string `json:"apiVersion,omitempty"`
	ResourceVersion string `json:"resourceVersion,omitempty"`
	FieldPath       string `json:"fieldPath,omitempty"`
}

type Pod

type Pod struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata,omitempty"`
	Spec       *PodSpec   `json:"spec,omitempty"`
	Status     *PodStatus `json:"status,omitempty"`
}

type PodAffinity

type PodAffinity struct {
	// RequiredDuringSchedulingRequiredDuringExecution []PodAffinityTerm  `json:"requiredDuringSchedulingRequiredDuringExecution,omitempty"`
	// If the affinity requirements specified by this field are not met at
	// scheduling time, the pod will not be scheduled onto the node.
	// If the affinity requirements specified by this field cease to be met
	// at some point during pod execution (e.g. due to a pod label update), the
	// system may or may not try to eventually evict the pod from its node.
	// When there are multiple elements, the lists of nodes corresponding to each
	// podAffinityTerm are intersected, i.e. all terms must be satisfied.
	RequiredDuringSchedulingIgnoredDuringExecution []PodAffinityTerm `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"`

	// The scheduler will prefer to schedule pods to nodes that satisfy
	// the affinity expressions specified by this field, but it may choose
	// a node that violates one or more of the expressions. The node that is
	// most preferred is the one with the greatest sum of weights, i.e.
	// for each node that meets all of the scheduling requirements (resource
	// request, requiredDuringScheduling affinity expressions, etc.),
	// compute a sum by iterating through the elements of this field and adding
	// "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
	// node(s) with the highest sum are the most preferred.
	PreferredDuringSchedulingIgnoredDuringExecution []WeightedPodAffinityTerm `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"`
}

PodAffinity is a group of inter pod affinity scheduling rules.

type PodAffinityTerm

type PodAffinityTerm struct {
	// A label query over a set of resources, in this case pods.
	LabelSelector *LabelSelector `json:"labelSelector,omitempty"`

	// namespaces specifies which namespaces the labelSelector applies to (matches against);
	// nil list means "this pod's namespace," empty list means "all namespaces"
	// 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,omitempty"`

	// 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
	// selected pods is running.
	// For PreferredDuringScheduling pod anti-affinity, empty topologyKey is interpreted as "all topologies"
	// ("all topologies" here means all the topologyKeys indicated by scheduler command-line argument --failure-domains);
	// for affinity and for RequiredDuringScheduling pod anti-affinity, empty topologyKey is not allowed.
	TopologyKey string `json:"topologyKey,omitempty"`
}

Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key <topologyKey> tches that of any node on which a pod of the set of pods is running

type PodAntiAffinity

type PodAntiAffinity struct {
	// RequiredDuringSchedulingRequiredDuringExecution []PodAffinityTerm  `json:"requiredDuringSchedulingRequiredDuringExecution,omitempty"`
	// If the anti-affinity requirements specified by this field are not met at
	// scheduling time, the pod will not be scheduled onto the node.
	// If the anti-affinity requirements specified by this field cease to be met
	// at some point during pod execution (e.g. due to a pod label update), the
	// system may or may not try to eventually evict the pod from its node.
	// When there are multiple elements, the lists of nodes corresponding to each
	// podAffinityTerm are intersected, i.e. all terms must be satisfied.
	RequiredDuringSchedulingIgnoredDuringExecution []PodAffinityTerm `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"`

	// The scheduler will prefer to schedule pods to nodes that satisfy
	// the anti-affinity expressions specified by this field, but it may choose
	// a node that violates one or more of the expressions. The node that is
	// most preferred is the one with the greatest sum of weights, i.e.
	// for each node that meets all of the scheduling requirements (resource
	// request, requiredDuringScheduling anti-affinity expressions, etc.),
	// compute a sum by iterating through the elements of this field and adding
	// "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
	// node(s) with the highest sum are the most preferred.
	PreferredDuringSchedulingIgnoredDuringExecution []WeightedPodAffinityTerm `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"`
}

PodAntiAffinity is a group of inter pod anti affinity scheduling rules.

type PodCondition

type PodCondition struct {
	Type               PodConditionType `json:"type"`
	Status             ConditionStatus  `json:"status"`
	LastProbeTime      Time             `json:"lastProbeTime,omitempty"`
	LastTransitionTime Time             `json:"lastTransitionTime,omitempty"`
	Reason             string           `json:"reason,omitempty"`
	Message            string           `json:"message,omitempty"`
}

type PodConditionType

type PodConditionType string

type PodInterface

type PodInterface interface {
	CreatePod(namespace string, item *Pod) (*Pod, error)
	GetPod(namespace, name string) (result *Pod, err error)
	ListPods(namespace string, opts *ListOptions) (*PodList, error)
	WatchPods(namespace string, opts *WatchOptions, events chan PodWatchEvent) error
	DeletePod(namespace, name string) error
	UpdatePod(namespace string, item *Pod) (*Pod, error)
}

type PodList

type PodList struct {
	TypeMeta `json:",inline"`
	ListMeta `json:"metadata,omitempty"`
	Items    []Pod `json:"items"`
}

type PodPhase

type PodPhase string

PodPhase is a label for the condition of a pod at the current time.

type PodSecurityContext

type PodSecurityContext struct {
	// 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.
	SELinuxOptions *SELinuxOptions `json:"seLinuxOptions,omitempty"`
	// The UID to run the entrypoint of the container process.
	// Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext.
	// If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.
	RunAsUser int64 `json:"runAsUser,omitempty"`
	// Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure
	// that it does not run as UID 0 (root) and fail to start the container if it does.
	// If unset or false, no such validation will be performed. May also be set in SecurityContext.
	// If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
	RunAsNonRoot bool `json:"runAsNonRoot,omitempty"`
	// A list of groups applied to the first process run in each container, in addition to the container’s primary GID.
	// If unspecified, no groups will be added to any container.
	SupplementalGroups []int32 `json:"supplementalGroups,omitempty"`
	// A special supplemental group that applies to all containers in a pod.
	// Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:
	// 1. The owning GID will be the FSGroup
	// 2. The setgid bit is set (new files created in the volume will be owned by FSGroup)
	// 3. The permission bits are OR’d with rw-rw
	FSGroup int64 `json:"fsGroup,omitempty"`
}

PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.

type PodSpec

type PodSpec struct {
	// List of volumes that can be mounted by containers belonging to the pod.
	Volumes []Volume `json:"volumes,omitempty"`
	// List of containers belonging to the pod. Containers cannot currently be added or removed.
	// There must be at least one container in a Pod. Cannot be updated.
	Containers []Container `json:"containers"`
	// Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always.
	RestartPolicy RestartPolicy `json:"restartPolicy,omitempty"`
	// Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request.
	// Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil,
	// the default grace period will be used instead.
	//  The grace period is the duration in seconds after the processes running in the pod are sent a termination
	// signal and the time when the processes are forcibly halted with a kill signal.
	// Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.
	TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
	// Optional duration in seconds the pod may be active on the node relative to StartTime before the system will
	// actively try to mark it failed and kill associated containers. Value must be a positive integer.
	ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`
	// Set DNS policy for containers within the pod. One of ClusterFirst or Default. Defaults to "ClusterFirst".
	DNSPolicy DNSPolicy `json:"dnsPolicy,omitempty"`
	// NodeSelector is a selector which must be true for the pod to fit on a node.
	// Selector which must match a node’s labels for the pod to be scheduled on that node.
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
	// ServiceAccountName is the name of the ServiceAccount to use to run this pod.
	ServiceAccountName string `json:"serviceAccountName,omitempty"`
	// 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.
	NodeName string `json:"nodeName,omitempty"`
	// Host networking requested for this pod. Use the host’s network namespace.
	// If this option is set, the ports that will be used must be specified. Default to false.
	HostNetwork bool `json:"hostNetwork,omitempty"`
	// Use the host’s pid namespace. Optional: Default to false.
	HostPID bool `json:"hostPID,omitempty"`
	// Use the host’s ipc namespace. Optional: Default to false.
	HostIPC bool `json:"hostIPC,omitempty"`
	// SecurityContext holds pod-level security attributes and common container settings.
	// Optional: Defaults to empty. See type description for default values of each field.
	SecurityContext *PodSecurityContext `json:"securityContext,omitempty"`
	// ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec.
	// If specified, these secrets will be passed to individual puller implementations for them to use.
	// For example, in the case of docker, only DockerConfig type secrets are honored.
	ImagePullSecrets []LocalObjectReference `json:"imagePullSecrets,omitempty"`
	// Specifies the hostname of the Pod If not specified, the pod’s hostname will be set to a system-defined value.
	Hostname string `json:"hostname,omitempty"`
	// If specified, the fully qualified Pod hostname will be "<hostname>.<subdomain>.<pod namespace>.svc.<cluster domain>".
	// If not specified, the pod will not have a domainname at all.
	Subdomain string `json:"subdomain,omitempty"`
}

PodSpec is a description of a pod.

type PodStatus

type PodStatus struct {
	Phase             PodPhase          `json:"phase,omitempty"`
	Conditions        []PodCondition    `json:"conditions,omitempty"`
	Message           string            `json:"message,omitempty"`
	Reason            string            `json:"reason,omitempty"`
	HostIP            string            `json:"hostIP,omitempty"`
	PodIP             string            `json:"podIP,omitempty"`
	StartTime         *Time             `json:"startTime,omitempty"`
	ContainerStatuses []ContainerStatus `json:"containerStatuses,omitempty"`
}

type PodTemplateSpec

type PodTemplateSpec struct {
	// Metadata of the pods created from this template.
	ObjectMeta `json:"metadata,omitempty"`

	// Spec defines the behavior of a pod.
	Spec *PodSpec `json:"spec,omitempty"`
}

PodTemplateSpec describes the data a pod should have when created from a template

func NewPodTemplateSpec

func NewPodTemplateSpec(namespace, name string) *PodTemplateSpec

NewPodTemplateSpec creates a new PodTemplateSpec struct

type PodWatchEvent

type PodWatchEvent interface {
	Type() WatchEventType
	Object() (*Pod, error)
}

type PreferredSchedulingTerm

type PreferredSchedulingTerm struct {
	// Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.
	Weight int32 `json:"weight,omitempty"`

	// A node selector term, associated with the corresponding weight.
	Preference *NodeSelectorTerm `json:"preference,omitempty"`
}

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 Probe

type Probe struct {
	// The action taken to determine the health of a container
	Handler `json:",inline"`
	// Length of time before health checking is activated.  In seconds.
	InitialDelaySeconds int `json:"initialDelaySeconds,omitempty"`
	// Length of time before health checking times out.  In seconds.
	TimeoutSeconds int `json:"timeoutSeconds,omitempty"`
	// How often (in seconds) to perform the probe.
	PeriodSeconds int `json:"periodSeconds,omitempty"`
	// Minimum consecutive successes for the probe to be considered successful after having failed.
	// Must be 1 for liveness.
	SuccessThreshold int `json:"successThreshold,omitempty"`
	// Minimum consecutive failures for the probe to be considered failed after having succeeded.
	FailureThreshold int `json:"failureThreshold,omitempty"`
}

Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.

type Protocol

type Protocol string

type PullPolicy

type PullPolicy string

PullPolicy describes a policy for if/when to pull a container image

type ReplicaSet

type ReplicaSet struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata,omitempty"`

	// Spec defines the desired behavior of this ReplicaSet.
	Spec *ReplicaSetSpec `json:"spec,omitempty"`

	// Status is the current status of this ReplicaSet. This data may be
	// out of date by some window of time.
	Status *ReplicaSetStatus `json:"status,omitempty"`
}

ReplicaSet represents the configuration of a replica set.

func NewReplicaSet

func NewReplicaSet(namespace, name string) *ReplicaSet

NewReplicaSet creates a new ReplicaSet struct

type ReplicaSetInterface

type ReplicaSetInterface interface {
	CreateReplicaSet(namespace string, item *ReplicaSet) (*ReplicaSet, error)
	GetReplicaSet(namespace, name string) (result *ReplicaSet, err error)
	ListReplicaSets(namespace string, opts *ListOptions) (*ReplicaSetList, error)
	WatchReplicaSets(namespace string, opts *WatchOptions, events chan ReplicaSetWatchEvent) error
	DeleteReplicaSet(namespace, name string) error
	UpdateReplicaSet(namespace string, item *ReplicaSet) (*ReplicaSet, error)
}

ReplicaSetInterface has methods to work with ReplicaSet resources.

type ReplicaSetList

type ReplicaSetList struct {
	TypeMeta `json:",inline"`
	ListMeta `json:"metadata,omitempty"`
	Items    []ReplicaSet `json:"items"`
}

ReplicaSetList is a collection of ReplicaSets.

type ReplicaSetSpec

type ReplicaSetSpec struct {
	// Replicas is the number of desired replicas.
	Replicas int32 `json:"replicas"`

	// 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://releases.k8s.io/release-1.3/docs/user-guide/labels.md#label-selectors
	Selector *LabelSelector `json:"selector,omitempty"`

	// Template is the object that describes the pod that will be created if
	// insufficient replicas are detected.
	Template *PodTemplateSpec `json:"template,omitempty"`
}

ReplicaSetSpec is the specification of a replication set.

type ReplicaSetStatus

type ReplicaSetStatus struct {
	// Replicas is the number of actual replicas.
	Replicas int32 `json:"replicas"`

	// The number of pods that have labels matching the labels of the pod template of the replicaset.
	FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty"`

	// ObservedGeneration is the most recent generation observed by the controller.
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

ReplicaSetStatus represents the current status of a ReplicaSet.

type ReplicaSetWatchEvent

type ReplicaSetWatchEvent interface {
	Type() WatchEventType
	Object() (*ReplicaSet, error)
}

type ResourceList

type ResourceList map[ResourceName]string

ResourceList is a set of (resource name, quantity) pairs.

type ResourceName

type ResourceName string

ResourceName is the name identifying various resources in a ResourceList.

type ResourceRequirements

type ResourceRequirements struct {
	// Limits describes the maximum amount of compute resources allowed.
	Limits ResourceList `json:"limits,omitempty"`
	// Requests describes the minimum amount of compute resources required.
	// If Request is omitted for a container, it defaults to Limits if that is explicitly specified,
	// otherwise to an implementation-defined value
	Requests ResourceList `json:"requests,omitempty"`
}

ResourceRequirements describes the compute resource requirements.

type RestartPolicy

type RestartPolicy string

type RollbackConfig

type RollbackConfig struct {
	// The revision to rollback to. If set to 0, rollbck to the last revision.
	Revision int64 `json:"revision,omitempty"`
}

type RollingUpdateDeployment

type RollingUpdateDeployment struct {
	// The maximum number of pods that can be unavailable during the update.
	// Value can be an absolute number (ex: 5) or a percentage of total pods at the start of update (ex: 10%).
	// Absolute number is calculated from percentage by rounding up.
	// This can not be 0 if MaxSurge is 0.
	// By default, a fixed value of 1 is used.
	// Example: when this is set to 30%, the old RC can be scaled down by 30%
	// immediately when the rolling update starts. Once new pods are ready, old RC
	// can be scaled down further, followed by scaling up the new RC, ensuring
	// that at least 70% of original number of pods are available at all times
	// during the update.
	MaxUnavailable intstr.IntOrString `json:"maxUnavailable,omitempty"`

	// The maximum number of pods that can be scheduled above the original number of
	// pods.
	// Value can be an absolute number (ex: 5) or a percentage of total pods at
	// the start of the update (ex: 10%). This can not be 0 if MaxUnavailable is 0.
	// Absolute number is calculated from percentage by rounding up.
	// By default, a value of 1 is used.
	// Example: when this is set to 30%, the new RC can be scaled up by 30%
	// immediately when the rolling update starts. Once old pods have been killed,
	// new RC can be scaled up further, ensuring that total number of pods running
	// at any time during the update is atmost 130% of original pods.
	MaxSurge intstr.IntOrString `json:"maxSurge,omitempty"`
}

Spec to control the desired behavior of rolling update.

type SELinuxOptions

type SELinuxOptions struct {
	// User is a SELinux user label that applies to the container.
	User string `json:"user,omitempty"`
	// Role is a SELinux role label that applies to the container.
	Role string `json:"role,omitempty"`
	// Type is a SELinux type label that applies to the container.
	Type string `json:"type,omitempty"`
	// Level is SELinux level label that applies to the container.
	Level string `json:"level,omitempty"`
}

SELinuxOptions are the labels to be applied to the container

type Secret

type Secret struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata,omitempty"`
	Data       map[string][]byte `json:"data,omitempty"`

	// Used to facilitate programmatic handling of secret data.
	Type SecretType `json:"type,omitempty"`
}

Secret holds secret data of a certain type.

func NewSecret

func NewSecret(namespace, name string) *Secret

NewSecret creates a new Secret struct

type SecretInterface

type SecretInterface interface {
	CreateSecret(namespace string, item *Secret) (*Secret, error)
	GetSecret(namespace, name string) (result *Secret, err error)
	ListSecrets(namespace string, opts *ListOptions) (*SecretList, error)
	WatchSecrets(namespace string, opts *WatchOptions, events chan SecretWatchEvent) error
	DeleteSecret(namespace, name string) error
	UpdateSecret(namespace string, item *Secret) (*Secret, error)
}

SecretInterface has methods to work with Secret resources.

type SecretKeySelector

type SecretKeySelector struct {
	LocalObjectReference `json:",inline"`
	Key                  string `json:"key"`
}

type SecretList

type SecretList struct {
	TypeMeta `json:",inline"`
	ListMeta `json:"metadata,omitempty"`

	Items []Secret `json:"items"`
}

SecretList holds a list of secrets.

type SecretType

type SecretType string

SecretType is the type of secret.

type SecretVolumeSource

type SecretVolumeSource struct {
	// Name of the secret in the pod’s namespace to use.
	SecretName string `json:"secretName,omitempty"`
	// If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume
	// as a file whose name is the key and content is the value.
	// If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present.
	// If a key is specified which is not present in the Secret, the volume setup will error.
	// Paths must be relative and may not contain the .. path or start with ...
	Items []KeyToPath `json:"items,omitempty"`
	// Optional: mode bits to use on created files by default. Must be a value between 0 and 0777.
	// Defaults to 0644. Directories within the path are not affected by this setting.
	// This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.
	DefaultMode int32 `json:"defaultMode,omitempty"`
}

Adapts a Secret into a volume. The contents of the target Secret’s Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling.

type SecretWatchEvent

type SecretWatchEvent interface {
	Type() WatchEventType
	Object() (*Secret, error)
}

type Service

type Service struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata,omitempty"`

	// Spec defines the behavior of a service
	Spec *ServiceSpec `json:"spec,omitempty"`

	// Status represents the current status of a service.
	Status *ServiceStatus `json:"status,omitempty"`
}

Service is a named abstraction of software service (for example, mysql) consisting of local port (for example 3306) that the proxy listens on, and the selector that determines which pods will answer requests sent through the proxy.

func NewService

func NewService(namespace, name string) *Service

NewService creates a new service struct

type ServiceAccount

type ServiceAccount struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata,omitempty"`

	// Secrets is the list of secrets allowed to be used by pods running using this ServiceAccount
	Secrets []ObjectReference `json:"secrets"`

	// ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images
	// in pods that reference this ServiceAccount.  ImagePullSecrets are distinct from Secrets because Secrets
	// can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet.
	ImagePullSecrets []LocalObjectReference `json:"imagePullSecrets,omitempty"`
}

ServiceAccount binds together: * a name, understood by users, and perhaps by peripheral systems, for an identity * a principal that can be authenticated and authorized * a set of secrets

func NewServiceAccount

func NewServiceAccount(namespace, name string) *ServiceAccount

NewServiceAccount creates a new ServiceAccount struct

type ServiceAccountInterface

type ServiceAccountInterface interface {
	CreateServiceAccount(namespace string, item *ServiceAccount) (*ServiceAccount, error)
	GetServiceAccount(namespace, name string) (result *ServiceAccount, err error)
	ListServiceAccounts(namespace string, opts *ListOptions) (*ServiceAccountList, error)
	WatchServiceAccounts(namespace string, opts *WatchOptions, events chan ServiceAccountWatchEvent) error
	DeleteServiceAccount(namepsace, name string) error
	UpdateServiceAccount(namespace string, item *ServiceAccount) (*ServiceAccount, error)
}

ServiceAccountInterface is the interface that defines ServiceAccount functions.

type ServiceAccountList

type ServiceAccountList struct {
	TypeMeta `json:",inline"`
	ListMeta `json:"metadata,omitempty"`
	Items    []ServiceAccount `json:"items"`
}

ServiceAccountList is a list of ServiceAccount objects

type ServiceAccountWatchEvent

type ServiceAccountWatchEvent interface {
	Type() WatchEventType
	Object() (*ServiceAccount, error)
}

type ServiceAffinity

type ServiceAffinity string

ServiceAffinity is the type of affinity for the service

type ServiceInterface

type ServiceInterface interface {
	CreateService(namespace string, item *Service) (*Service, error)
	GetService(namespace, name string) (result *Service, err error)
	ListServices(namespace string, opts *ListOptions) (*ServiceList, error)
	WatchServices(namespace string, opts *WatchOptions, events chan ServiceWatchEvent) error
	DeleteService(namespace, name string) error
	UpdateService(namespace string, item *Service) (*Service, error)
}

ServiceInterface has methods to work with Service resources.

type ServiceList

type ServiceList struct {
	TypeMeta `json:",inline"`
	ListMeta `json:"metadata,omitempty"`

	Items []Service `json:"items"`
}

ServiceList holds a list of services.

type ServicePort

type ServicePort struct {
	// Optional if only one ServicePort is defined on this service: The
	// 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"`

	// The IP protocol for this port.  Supports "TCP" and "UDP".
	Protocol Protocol `json:"protocol"`

	// The port that will be exposed on the service.
	Port int32 `json:"port"`

	// 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
	// Pod's container ports.  If this is not specified, the value
	// 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"`

	// 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"`
}

ServicePort is a single exposed port.

type ServiceSpec

type ServiceSpec struct {
	// Type determines how the service will be exposed.  Valid options: ClusterIP, NodePort, LoadBalancer
	Type ServiceType `json:"type,omitempty"`

	// Required: The list of ports that are exposed by this service.
	Ports []ServicePort `json:"ports"`

	// This service will route traffic to pods having labels matching this selector. If empty or not present,
	// the service is assumed to have endpoints set by an external process and Kubernetes will not modify
	// those endpoints.
	Selector map[string]string `json:"selector"`

	// ClusterIP is usually assigned by the master.  If specified by the user
	// we will try to respect it or else fail the request.  This field can
	// not be changed by updates.
	// Valid values are None, empty string (""), or a valid IP address
	// None can be specified for headless services when proxying is not required
	ClusterIP string `json:"clusterIP,omitempty"`

	// ExternalIPs are used by external load balancers, or can be set by
	// users to handle external traffic that arrives at a node.
	ExternalIPs []string `json:"externalIPs,omitempty"`

	// ExternalName is the external reference that kubedns or equivalent will return as a CNAME record for this service.
	// No proxying will be involved. Must be a valid DNS name and requires Type to be ExternalName
	ExternalName string `json:"externalName,omitempty"`

	// Only applies to Service Type: LoadBalancer
	// LoadBalancer will get created with the IP specified in this field.
	// This feature depends on whether the underlying cloud-provider supports specifying
	// the loadBalancerIP when a load balancer is created.
	// This field will be ignored if the cloud-provider does not support the feature.
	LoadBalancerIP string `json:"loadBalancerIP,omitempty"`

	// Optional: Supports "ClientIP" and "None".  Used to maintain session affinity.
	SessionAffinity ServiceAffinity `json:"sessionAffinity,omitempty"`

	// Optional: If specified and supported by the platform, this will restrict traffic through the cloud-provider
	// load-balancer will be restricted to the specified client IPs. This field will be ignored if the
	// cloud-provider does not support the feature."
	LoadBalancerSourceRanges []string `json:"loadBalancerSourceRanges,omitempty"`
}

ServiceSpec describes the attributes that a user creates on a service

type ServiceStatus

type ServiceStatus struct {
	// LoadBalancer contains the current status of the load-balancer,
	// if one is present.
	LoadBalancer *LoadBalancerStatus `json:"loadBalancer,omitempty"`
}

ServiceStatus represents the current status of a service

type ServiceType

type ServiceType string

ServiceType describes ingress methods for a service

type ServiceWatchEvent

type ServiceWatchEvent interface {
	Type() WatchEventType
	Object() (*Service, error)
}

type Status

type Status struct {
	TypeMeta `json:",inline"`
	// Standard list metadata.
	// More info: http://releases.k8s.io/release-1.3/docs/devel/api-conventions.md#types-kinds
	ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

	// Status of the operation.
	// One of: "Success" or "Failure".
	// More info: http://releases.k8s.io/release-1.3/docs/devel/api-conventions.md#spec-and-status
	Status string `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"`
	// A human-readable description of the status of this operation.
	Message string `json:"message,omitempty" protobuf:"bytes,3,opt,name=message"`
	// A machine-readable description of why this operation is in the
	// "Failure" status. If this value is empty there
	// is no information available. A Reason clarifies an HTTP status
	// code but does not override it.
	Reason StatusReason `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason,casttype=StatusReason"`
	// Extended data associated with the reason.  Each reason may define its
	// own extended details. This field is optional and the data returned
	// is not guaranteed to conform to any schema except that defined by
	// the reason type.
	Details *StatusDetails `json:"details,omitempty" protobuf:"bytes,5,opt,name=details"`
	// Suggested HTTP return code for this status, 0 if not set.
	Code int32 `json:"code,omitempty" protobuf:"varint,6,opt,name=code"`
}

Status is a return value for calls that don't return other objects.

func (*Status) Error

func (s *Status) Error() string

type StatusCause

type StatusCause struct {
	// A machine-readable description of the cause of the error. If this value is
	// empty there is no information available.
	Type CauseType `json:"reason,omitempty" protobuf:"bytes,1,opt,name=reason,casttype=CauseType"`
	// A human-readable description of the cause of the error.  This field may be
	// presented as-is to a reader.
	Message string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"`
	// The field of the resource that has caused this error, as named by its JSON
	// serialization. May include dot and postfix notation for nested attributes.
	// Arrays are zero-indexed.  Fields may appear more than once in an array of
	// causes due to fields having multiple errors.
	// Optional.
	//
	// Examples:
	//   "name" - the field "name" on the current resource
	//   "items[0].name" - the field "name" on the first array entry in "items"
	Field string `json:"field,omitempty" protobuf:"bytes,3,opt,name=field"`
}

StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.

type StatusDetails

type StatusDetails struct {
	// The name attribute of the resource associated with the status StatusReason
	// (when there is a single name which can be described).
	Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
	// The group attribute of the resource associated with the status StatusReason.
	Group string `json:"group,omitempty" protobuf:"bytes,2,opt,name=group"`
	// The kind attribute of the resource associated with the status StatusReason.
	// On some operations may differ from the requested resource Kind.
	// More info: http://releases.k8s.io/release-1.3/docs/devel/api-conventions.md#types-kinds
	Kind string `json:"kind,omitempty" protobuf:"bytes,3,opt,name=kind"`
	// The Causes array includes more details associated with the StatusReason
	// failure. Not all StatusReasons may provide detailed causes.
	Causes []StatusCause `json:"causes,omitempty" protobuf:"bytes,4,rep,name=causes"`
	// If specified, the time in seconds before the operation should be retried.
	RetryAfterSeconds int32 `json:"retryAfterSeconds,omitempty" protobuf:"varint,5,opt,name=retryAfterSeconds"`
}

StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.

type StatusReason

type StatusReason string

StatusReason is an enumeration of possible failure causes. Each StatusReason must map to a single HTTP status code, but multiple reasons may map to the same HTTP status code.

type StorageMedium

type StorageMedium string

type TCPSocketAction

type TCPSocketAction struct {
	// Required: Port to connect to.
	Port intstr.IntOrString `json:"port,omitempty"`
}

TCPSocketAction describes an action based on opening a socket

type Time

type Time struct {
	time.Time
}

func Date

func Date(year int, month time.Month, day, hour, min, sec, nsec int, loc *time.Location) Time

Date returns the Time corresponding to the supplied parameters by wrapping time.Date.

func Now

func Now() Time

Now returns the current local time.

func Unix

func Unix(sec int64, nsec int64) Time

Unix returns the local time corresponding to the given Unix time by wrapping time.Unix.

func (Time) Before

func (t Time) Before(u Time) bool

Before reports whether the time instant t is before u.

func (Time) Equal

func (t Time) Equal(u Time) bool

Equal reports whether the time instant t is equal to u.

func (*Time) IsZero

func (t *Time) IsZero() bool

IsZero returns true if the value is nil or time is zero.

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (Time) MarshalQueryParameter

func (t Time) MarshalQueryParameter() (string, error)

MarshalQueryParameter converts to a URL query parameter value

func (Time) Rfc3339Copy

func (t Time) Rfc3339Copy() Time

Rfc3339Copy returns a copy of the Time at second-level precision.

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaller interface.

func (*Time) UnmarshalQueryParameter

func (t *Time) UnmarshalQueryParameter(str string) error

UnmarshalQueryParameter converts from a URL query parameter value to an object

type TypeMeta

type TypeMeta struct {
	Kind       string `json:"kind,omitempty"`
	APIVersion string `json:"apiVersion,omitempty"`
}

func NewTypeMeta

func NewTypeMeta(kind, apiVersion string) TypeMeta

NewTypeMeta creates a new TypeMeta and initializes the given kind & apiVersion

func (*TypeMeta) GetKind

func (t *TypeMeta) GetKind() string

type UID

type UID string

type URIScheme

type URIScheme string

type Volume

type Volume struct {
	Name         string `json:"name"`
	VolumeSource `json:",inline,omitempty"`
}

type VolumeMount

type VolumeMount struct {
	// Required: This must match the Name of a Volume [above].
	Name string `json:"name"`
	// Optional: Defaults to false (read-write).
	ReadOnly bool `json:"readOnly,omitempty"`
	// Required. Must not contain ':'.
	MountPath string `json:"mountPath"`
}

VolumeMount describes a mounting of a Volume within a container.

type VolumeSource

type VolumeSource struct {
	EmptyDir *EmptyDirVolumeSource `json:"emptyDir,omitempty"`
	HostPath *HostPathVolumeSource `json:"hostPath,omitempty"`
	Secret   *SecretVolumeSource   `json:"secret,omitempty"`
}

type WatchEvent

type WatchEvent struct {
	// the type of watch event; may be ADDED, MODIFIED, DELETED, or ERROR
	Type WatchEventType `json:"type,omitempty"`
	// For added or modified objects, this is the new object; for deleted objects,
	// it's the state of the object immediately prior to its deletion.
	// For errors, it's an api.Status.
	Object json.RawMessage `json:"object,omitempty"`
}

WatchEvent objects are streamed from the api server in response to a watch request. These are not API objects and may not be changed in a backward-incompatible way.

func (*WatchEvent) UnmarshalObject

func (e *WatchEvent) UnmarshalObject(object interface{}) error

UnmarshalObject tries to unmarshal the Object field of the given event into the given object.

type WatchEventType

type WatchEventType string
const (
	// WatchEvent.Type constants
	WatchEventTypeAdded    WatchEventType = "ADDED"
	WatchEventTypeModified WatchEventType = "MODIFIED"
	WatchEventTypeDeleted  WatchEventType = "DELETED"
	WatchEventTypeError    WatchEventType = "ERROR"
)

type WatchOptions

type WatchOptions struct {
	ListOptions
	ResourceVersion string
}

type WeightedPodAffinityTerm

type WeightedPodAffinityTerm struct {
	// weight associated with matching the corresponding podAffinityTerm, in the range 1-100.
	Weight int32 `json:"weight,omitempty"`

	// Required. A pod affinity term, associated with the corresponding weight.
	PodAffinityTerm PodAffinityTerm `json:"podAffinityTerm"`
}

The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)

Directories

Path Synopsis
Package http provides an HTTP client for kubernetes
Package http provides an HTTP client for kubernetes

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL