kubernetes

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2016 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NamespaceAll is the default argument to specify on a context when you want to list or filter resources across all namespaces
	NamespaceAll string = ""
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ByContainerName

type ByContainerName []Container

func (ByContainerName) Len

func (a ByContainerName) Len() int

func (ByContainerName) Less

func (a ByContainerName) Less(i, j int) bool

func (ByContainerName) Swap

func (a ByContainerName) Swap(i, j int)

type ByContainerPort

type ByContainerPort []ContainerPort

func (ByContainerPort) Len

func (a ByContainerPort) Len() int

func (ByContainerPort) Less

func (a ByContainerPort) Less(i, j int) bool

func (ByContainerPort) Swap

func (a ByContainerPort) Swap(i, j int)

type Container

type Container struct {
	// Required: This must be a DNS_LABEL.  Each container in a pod must
	// have a unique name.
	Name string `json:"name" description:"name of the container; must be a DNS_LABEL and unique within the pod; cannot be updated"`
	// Optional.
	Image string `json:"image,omitempty" description:"Docker image name; see http://releases.k8s.io/HEAD/docs/user-guide/images.md"`

	Ports []ContainerPort `json:"ports"`
}

Container represents a single container that is expected to be run on the host.

type ContainerPort

type ContainerPort struct {
	Name          string `json:"name"`
	ContainerPort int32  `json:"containerPort"`
	Protocol      string `json:"protocol"`
}

type DaemonEndpoint

type DaemonEndpoint struct {

	// Port number of the given endpoint.
	Port int32 `json:"Port"`
}

DaemonEndpoint contains information about a single Daemon endpoint.

type Discovery

type Discovery struct {
	Conf *config.KubernetesSDConfig
	// contains filtered or unexported fields
}

Discovery implements a TargetProvider for Kubernetes services.

func (*Discovery) Initialize

func (kd *Discovery) Initialize() error

Initialize sets up the discovery for usage.

func (*Discovery) Run

func (kd *Discovery) Run(ctx context.Context, ch chan<- []*config.TargetGroup)

Run implements the TargetProvider interface.

type EndpointAddress

type EndpointAddress struct {
	// The IP of this endpoint.
	// TODO: This should allow hostname or IP, see #4447.
	IP string `json:"ip" description:"IP address of the endpoint"`
}

EndpointAddress is a tuple that describes single IP address.

type EndpointPort

type EndpointPort struct {
	// The port number.
	Port int `json:"port" description:"port number of the endpoint"`

	// The IP protocol for this port.
	Protocol Protocol `json:"protocol,omitempty" description:"protocol for this port; must be UDP or TCP; TCP if unspecified"`
}

EndpointPort is a tuple that describes a single port.

type EndpointSubset

type EndpointSubset struct {
	Addresses []EndpointAddress `json:"addresses,omitempty" description:"IP addresses which offer the related ports"`
	Ports     []EndpointPort    `json:"ports,omitempty" description:"port numbers available on the related IP addresses"`
}

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. For example, given:

{
  Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}],
  Ports:     [{"name": "a", "port": 8675}, {"name": "b", "port": 309}]
}

The resulting set of endpoints can be viewed as:

a: [ 10.10.1.1:8675, 10.10.2.2:8675 ],
b: [ 10.10.1.1:309, 10.10.2.2:309 ]

type Endpoints

type Endpoints struct {
	ObjectMeta `` /* 136-byte string literal not displayed */

	// The set of all endpoints is the union of all subsets.
	Subsets []EndpointSubset `json:"subsets" description:"sets of addresses and ports that comprise a service"`
}

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

 Name: "mysvc",
 Subsets: [
   {
     Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}],
     Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}]
   },
   {
     Addresses: [{"ip": "10.10.3.3"}],
     Ports: [{"name": "a", "port": 93}, {"name": "b", "port": 76}]
   },
]

type EndpointsList

type EndpointsList struct {
	ListMeta `` /* 134-byte string literal not displayed */

	Items []Endpoints `json:"items" description:"list of endpoints"`
}

EndpointsList is a list of endpoints.

type EventType

type EventType string

EventType can legally only have the values defined as constants below.

const (
	Added    EventType = "ADDED"
	Modified EventType = "MODIFIED"
	Deleted  EventType = "DELETED"
)

Possible values for EventType.

type ListMeta

type ListMeta struct {
	// An opaque value that represents the version of this response for use with optimistic
	// concurrency and change monitoring endpoints.  Clients must treat these values as opaque
	// and values may only be valid for a particular resource or set of resources. Only servers
	// will generate resource versions.
	ResourceVersion string `` /* 388-byte string literal not displayed */
}

ListMeta describes metadata that synthetic resources must have, including lists and various status objects.

type Node

type Node struct {
	ObjectMeta `` /* 136-byte string literal not displayed */

	// Status describes the current status of a Node
	Status NodeStatus `` /* 190-byte string literal not displayed */
}

Node is a worker node in Kubernetes, formerly known as minion. Each node will have a unique identifier in the cache (i.e. in etcd).

type NodeAddress

type NodeAddress struct {
	Type    NodeAddressType `json:"type" description:"node address type, one of Hostname, ExternalIP or InternalIP"`
	Address string          `json:"address" description:"the node address"`
}

NodeAddress defines the address of a node.

type NodeAddressType

type NodeAddressType string

NodeAddressType can legally only have the values defined as constants below.

const (
	NodeLegacyHostIP NodeAddressType = "LegacyHostIP"
	NodeHostName     NodeAddressType = "Hostname"
	NodeExternalIP   NodeAddressType = "ExternalIP"
	NodeInternalIP   NodeAddressType = "InternalIP"
)

These are valid address types of node. NodeLegacyHostIP is used to transit from out-dated HostIP field to NodeAddress.

type NodeDaemonEndpoints

type NodeDaemonEndpoints struct {
	// Endpoint on which Kubelet is listening.
	KubeletEndpoint DaemonEndpoint `json:"kubeletEndpoint,omitempty"`
}

NodeDaemonEndpoints lists ports opened by daemons running on the Node.

type NodeList

type NodeList struct {
	ListMeta `` /* 134-byte string literal not displayed */

	Items []Node `json:"items" description:"list of nodes"`
}

NodeList is the whole list of all Nodes which have been registered with master.

type NodeStatus

type NodeStatus struct {
	// Queried from cloud provider, if available.
	Addresses []NodeAddress `` /* 190-byte string literal not displayed */
	// Endpoints of daemons running on the Node.
	DaemonEndpoints NodeDaemonEndpoints `json:"daemonEndpoints,omitempty"`
}

NodeStatus is information about the current status of a node.

type ObjectMeta

type ObjectMeta struct {
	// Name is unique within a namespace.  Name is required when creating resources, although
	// some resources may allow a client to request the generation of an appropriate name
	// automatically. Name is primarily intended for creation idempotence and configuration
	// definition.
	Name string `` /* 192-byte string literal not displayed */

	// Namespace defines the space within which name must be unique. An empty namespace is
	// equivalent to the "default" namespace, but "default" is the canonical representation.
	// Not all objects are required to be scoped to a namespace - the value of this field for
	// those objects will be empty.
	Namespace string `` /* 167-byte string literal not displayed */

	ResourceVersion string `` /* 388-byte string literal not displayed */

	// TODO: replace map[string]string with labels.LabelSet type
	Labels map[string]string `` /* 239-byte string literal not displayed */

	// Annotations are unstructured key value data stored with a resource that may be set by
	// external tooling. They are not queryable and should be preserved when modifying
	// objects.
	Annotations map[string]string `` /* 228-byte string literal not displayed */
}

ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.

type Pod

type Pod struct {
	ObjectMeta `` /* 136-byte string literal not displayed */
	PodStatus  `` /* 141-byte string literal not displayed */
	PodSpec    `` /* 137-byte string literal not displayed */
}

type PodCondition

type PodCondition struct {
	Type   string `json:"type" description:"Type is the type of the condition. Currently only Ready."`
	Status string `json:"status" description:"Status is the status of the condition. Can be True, False, Unknown."`
}

type PodList

type PodList struct {
	ListMeta `` /* 134-byte string literal not displayed */

	Items []Pod `json:"items" description:"list of pods"`
}

type PodSpec

type PodSpec struct {
	Containers []Container `` /* 134-byte string literal not displayed */
	NodeName   string      `` /* 225-byte string literal not displayed */
}

type PodStatus

type PodStatus struct {
	Phase      string         `` /* 135-byte string literal not displayed */
	PodIP      string         `json:"podIP" description:"IP address allocated to the pod. Routable at least within the cluster. Empty if not yet allocated."`
	Conditions []PodCondition `json:"conditions" description:"Current service state of pod."`
	HostIP     string         `json:"hostIP,omitempty" description:"IP address of the host to which the pod is assigned. Empty if not yet scheduled."`
}

type Protocol

type Protocol string

Protocol defines network protocols supported for things like container ports.

const (
	// ProtocolTCP is the TCP protocol.
	ProtocolTCP Protocol = "TCP"
	// ProtocolUDP is the UDP protocol.
	ProtocolUDP Protocol = "UDP"
)

type Service

type Service struct {
	ObjectMeta `` /* 136-byte string literal not displayed */

	// Spec defines the behavior of a service.
	// http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
	Spec ServiceSpec `json:"spec,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.

type ServiceList

type ServiceList struct {
	ListMeta `` /* 134-byte string literal not displayed */

	Items []Service `json:"items" description:"list of services"`
}

ServiceList holds a list of services.

type ServicePort

type ServicePort struct {
	// The IP protocol for this port. Supports "TCP" and "UDP".
	// Default is TCP.
	Protocol Protocol `json:"protocol,omitempty"`

	// The port that will be exposed by this service.
	Port int32 `json:"port"`
}

ServicePort contains information on service's port.

type ServiceSpec

type ServiceSpec struct {
	// The list of ports that are exposed by this service.
	// More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#virtual-ips-and-service-proxies
	Ports []ServicePort `json:"ports"`
}

ServiceSpec describes the attributes that a user creates on a service.

Jump to

Keyboard shortcuts

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