pod

package
v1.5.1-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2018 License: Apache-2.0 Imports: 4 Imported by: 105

Documentation

Index

Constants

View Source
const (
	// PodKeyword defines the keyword identifying Pod data.
	PodKeyword = "pod"
)

Variables

View Source
var Pod_Container_Port_Protocol_name = map[int32]string{
	0: "TCP",
	1: "UDP",
}
View Source
var Pod_Container_Port_Protocol_value = map[string]int32{
	"TCP": 0,
	"UDP": 1,
}

Functions

func Key

func Key(name string, namespace string) string

Key returns the key under which a given K8s pod is stored in the data store.

func KeyPrefix

func KeyPrefix() string

KeyPrefix returns the key prefix identifying all K8s Pods in the data store.

func ParsePodFromKey

func ParsePodFromKey(key string) (pod string, namespace string, err error)

ParsePodFromKey parses pod and namespace ids from the associated data-store key.

Types

type ID

type ID struct {
	Name      string
	Namespace string
}

ID used to uniquely represent a K8s Pod.

func GetID

func GetID(pod *Pod) ID

GetID returns ID of a pod.

func (ID) String

func (id ID) String() string

String returns a string representation of a pod ID.

type Pod

type Pod struct {
	// Name of the pod unique within the namespace.
	// Cannot be updated.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Namespace the pod is inserted into.
	// An empty namespace is equivalent to the "default" namespace, but "default"
	// is the canonical representation.
	// Cannot be updated.
	Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// A list of labels attached to this pod.
	// +optional
	Label []*Pod_Label `protobuf:"bytes,3,rep,name=label" json:"label,omitempty"`
	// IP address allocated to the pod. Routable at least within the cluster.
	// Empty if not yet allocated.
	// +optional
	IpAddress string `protobuf:"bytes,4,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty"`
	// IP address of the host to which the pod is assigned.
	// Empty if not yet scheduled.
	// +optional
	HostIpAddress string `protobuf:"bytes,5,opt,name=host_ip_address,json=hostIpAddress,proto3" json:"host_ip_address,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.
	Container            []*Pod_Container `protobuf:"bytes,6,rep,name=container" json:"container,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

Pod is a collection of containers that can run on a host. This resource is created by clients and scheduled onto hosts.

func (*Pod) Descriptor

func (*Pod) Descriptor() ([]byte, []int)

func (*Pod) GetContainer

func (m *Pod) GetContainer() []*Pod_Container

func (*Pod) GetHostIpAddress

func (m *Pod) GetHostIpAddress() string

func (*Pod) GetIpAddress

func (m *Pod) GetIpAddress() string

func (*Pod) GetLabel

func (m *Pod) GetLabel() []*Pod_Label

func (*Pod) GetName

func (m *Pod) GetName() string

func (*Pod) GetNamespace

func (m *Pod) GetNamespace() string

func (*Pod) ProtoMessage

func (*Pod) ProtoMessage()

func (*Pod) Reset

func (m *Pod) Reset()

func (*Pod) String

func (m *Pod) String() string

func (*Pod) XXX_DiscardUnknown added in v1.4.0

func (m *Pod) XXX_DiscardUnknown()

func (*Pod) XXX_Marshal added in v1.4.0

func (m *Pod) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Pod) XXX_Merge added in v1.4.0

func (dst *Pod) XXX_Merge(src proto.Message)

func (*Pod) XXX_Size added in v1.4.0

func (m *Pod) XXX_Size() int

func (*Pod) XXX_Unmarshal added in v1.4.0

func (m *Pod) XXX_Unmarshal(b []byte) error

type Pod_Container

type Pod_Container struct {
	// Name of the container.
	// Each container in a pod has a unique name.
	// Cannot be updated.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// List of ports to expose from the container. Exposing a port here gives
	// the system additional information about the network connections a
	// container uses, but it is primarily informational. Not specifying a port
	// here DOES NOT prevent that port from being exposed. Any port which is
	// listening on the default "0.0.0.0" address inside a container will be
	// accessible from the network.
	// Cannot be updated.
	// +optional
	Port                 []*Pod_Container_Port `protobuf:"bytes,2,rep,name=port" json:"port,omitempty"`
	XXX_NoUnkeyedLiteral struct{}              `json:"-"`
	XXX_unrecognized     []byte                `json:"-"`
	XXX_sizecache        int32                 `json:"-"`
}

A single application container run within a pod.

func (*Pod_Container) Descriptor

func (*Pod_Container) Descriptor() ([]byte, []int)

func (*Pod_Container) GetName

func (m *Pod_Container) GetName() string

func (*Pod_Container) GetPort

func (m *Pod_Container) GetPort() []*Pod_Container_Port

func (*Pod_Container) ProtoMessage

func (*Pod_Container) ProtoMessage()

func (*Pod_Container) Reset

func (m *Pod_Container) Reset()

func (*Pod_Container) String

func (m *Pod_Container) String() string

func (*Pod_Container) XXX_DiscardUnknown added in v1.4.0

func (m *Pod_Container) XXX_DiscardUnknown()

func (*Pod_Container) XXX_Marshal added in v1.4.0

func (m *Pod_Container) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Pod_Container) XXX_Merge added in v1.4.0

func (dst *Pod_Container) XXX_Merge(src proto.Message)

func (*Pod_Container) XXX_Size added in v1.4.0

func (m *Pod_Container) XXX_Size() int

func (*Pod_Container) XXX_Unmarshal added in v1.4.0

func (m *Pod_Container) XXX_Unmarshal(b []byte) error

type Pod_Container_Port

type Pod_Container_Port struct {
	// An IANA_SVC_NAME formatted port name, unique within the pod.
	// The name can be referred to by services, policies, ...
	// +optional
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Port number to expose on the host.
	// The port number is in the range: 0 < x < 65536.
	// If pod is in the host network namespace, this must match container_port.
	// Most containers do not need this.
	// +optional
	HostPort int32 `protobuf:"varint,2,opt,name=host_port,json=hostPort,proto3" json:"host_port,omitempty"`
	// Port number to expose on the pod's IP address.
	// The port number is in the range: 0 < x < 65536.
	ContainerPort int32 `protobuf:"varint,3,opt,name=container_port,json=containerPort,proto3" json:"container_port,omitempty"`
	// Protocol for port. Must be UDP or TCP.
	// Defaults to "TCP".
	// +optional
	Protocol Pod_Container_Port_Protocol `protobuf:"varint,4,opt,name=protocol,proto3,enum=pod.Pod_Container_Port_Protocol" json:"protocol,omitempty"`
	// What host IP to bind the external port to.
	// +optional
	HostIpAddress        string   `protobuf:"bytes,5,opt,name=host_ip_address,json=hostIpAddress,proto3" json:"host_ip_address,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Port represents a network port in a single container.

func (*Pod_Container_Port) Descriptor

func (*Pod_Container_Port) Descriptor() ([]byte, []int)

func (*Pod_Container_Port) GetContainerPort

func (m *Pod_Container_Port) GetContainerPort() int32

func (*Pod_Container_Port) GetHostIpAddress

func (m *Pod_Container_Port) GetHostIpAddress() string

func (*Pod_Container_Port) GetHostPort

func (m *Pod_Container_Port) GetHostPort() int32

func (*Pod_Container_Port) GetName

func (m *Pod_Container_Port) GetName() string

func (*Pod_Container_Port) GetProtocol

func (*Pod_Container_Port) ProtoMessage

func (*Pod_Container_Port) ProtoMessage()

func (*Pod_Container_Port) Reset

func (m *Pod_Container_Port) Reset()

func (*Pod_Container_Port) String

func (m *Pod_Container_Port) String() string

func (*Pod_Container_Port) XXX_DiscardUnknown added in v1.4.0

func (m *Pod_Container_Port) XXX_DiscardUnknown()

func (*Pod_Container_Port) XXX_Marshal added in v1.4.0

func (m *Pod_Container_Port) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Pod_Container_Port) XXX_Merge added in v1.4.0

func (dst *Pod_Container_Port) XXX_Merge(src proto.Message)

func (*Pod_Container_Port) XXX_Size added in v1.4.0

func (m *Pod_Container_Port) XXX_Size() int

func (*Pod_Container_Port) XXX_Unmarshal added in v1.4.0

func (m *Pod_Container_Port) XXX_Unmarshal(b []byte) error

type Pod_Container_Port_Protocol

type Pod_Container_Port_Protocol int32

Protocol defines network protocols supported for container ports.

const (
	Pod_Container_Port_TCP Pod_Container_Port_Protocol = 0
	Pod_Container_Port_UDP Pod_Container_Port_Protocol = 1
)

func (Pod_Container_Port_Protocol) EnumDescriptor

func (Pod_Container_Port_Protocol) EnumDescriptor() ([]byte, []int)

func (Pod_Container_Port_Protocol) String

type Pod_Label

type Pod_Label struct {
	Key                  string   `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value                string   `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Label is a key/value pair attached to an object (pod in this case). Labels are used to organize and to select subsets of objects.

func (*Pod_Label) Descriptor

func (*Pod_Label) Descriptor() ([]byte, []int)

func (*Pod_Label) GetKey

func (m *Pod_Label) GetKey() string

func (*Pod_Label) GetValue

func (m *Pod_Label) GetValue() string

func (*Pod_Label) ProtoMessage

func (*Pod_Label) ProtoMessage()

func (*Pod_Label) Reset

func (m *Pod_Label) Reset()

func (*Pod_Label) String

func (m *Pod_Label) String() string

func (*Pod_Label) XXX_DiscardUnknown added in v1.4.0

func (m *Pod_Label) XXX_DiscardUnknown()

func (*Pod_Label) XXX_Marshal added in v1.4.0

func (m *Pod_Label) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Pod_Label) XXX_Merge added in v1.4.0

func (dst *Pod_Label) XXX_Merge(src proto.Message)

func (*Pod_Label) XXX_Size added in v1.4.0

func (m *Pod_Label) XXX_Size() int

func (*Pod_Label) XXX_Unmarshal added in v1.4.0

func (m *Pod_Label) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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