endpoints

package
v3.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EndpointsKeyword defines the keyword identifying Endpoints data.
	EndpointsKeyword = "endpoints"
)

Variables

This section is empty.

Functions

func Key

func Key(name string, namespace string) string

Key returns the key under which the endpoints belonging to given K8s service are stored in the data-store.

func KeyPrefix

func KeyPrefix() string

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

func ParseEndpointsFromKey

func ParseEndpointsFromKey(key string) (endpoints string, namespace string, err error)

ParseEndpointsFromKey parses endpoints and namespace ids from the associated data-store key.

Types

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.
	// +optional
	Addresses []*EndpointSubset_EndpointAddress `protobuf:"bytes,1,rep,name=addresses" 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.
	// +optional
	NotReadyAddresses []*EndpointSubset_EndpointAddress `protobuf:"bytes,2,rep,name=not_ready_addresses,json=notReadyAddresses" json:"not_ready_addresses,omitempty"`
	// Port numbers available on the related IP addresses.
	// +optional
	Ports                []*EndpointSubset_EndpointPort `protobuf:"bytes,3,rep,name=ports" json:"ports,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                       `json:"-"`
	XXX_unrecognized     []byte                         `json:"-"`
	XXX_sizecache        int32                          `json:"-"`
}

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 ]

func (*EndpointSubset) Descriptor

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

func (*EndpointSubset) GetAddresses

func (m *EndpointSubset) GetAddresses() []*EndpointSubset_EndpointAddress

func (*EndpointSubset) GetNotReadyAddresses

func (m *EndpointSubset) GetNotReadyAddresses() []*EndpointSubset_EndpointAddress

func (*EndpointSubset) GetPorts

func (*EndpointSubset) ProtoMessage

func (*EndpointSubset) ProtoMessage()

func (*EndpointSubset) Reset

func (m *EndpointSubset) Reset()

func (*EndpointSubset) String

func (m *EndpointSubset) String() string

func (*EndpointSubset) XXX_DiscardUnknown added in v1.4.0

func (m *EndpointSubset) XXX_DiscardUnknown()

func (*EndpointSubset) XXX_Marshal added in v1.4.0

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

func (*EndpointSubset) XXX_Merge added in v1.4.0

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

func (*EndpointSubset) XXX_Size added in v1.4.0

func (m *EndpointSubset) XXX_Size() int

func (*EndpointSubset) XXX_Unmarshal added in v1.4.0

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

type EndpointSubset_EndpointAddress

type EndpointSubset_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 `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"`
	// The Hostname of this endpoint
	// +optional
	HostName string `protobuf:"bytes,2,opt,name=host_name,json=hostName,proto3" json:"host_name,omitempty"`
	// Optional: Node hosting this endpoint. This can be used to
	// determine endpoints local to a node.
	// +optional
	NodeName string `protobuf:"bytes,3,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"`
	// Reference to object providing the endpoint.
	TargetRef            *ObjectReference `protobuf:"bytes,4,opt,name=target_ref,json=targetRef" json:"target_ref,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

EndpointAddress is a tuple that describes single IP address.

func (*EndpointSubset_EndpointAddress) Descriptor

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

func (*EndpointSubset_EndpointAddress) GetHostName

func (m *EndpointSubset_EndpointAddress) GetHostName() string

func (*EndpointSubset_EndpointAddress) GetIp

func (*EndpointSubset_EndpointAddress) GetNodeName

func (m *EndpointSubset_EndpointAddress) GetNodeName() string

func (*EndpointSubset_EndpointAddress) GetTargetRef

func (*EndpointSubset_EndpointAddress) ProtoMessage

func (*EndpointSubset_EndpointAddress) ProtoMessage()

func (*EndpointSubset_EndpointAddress) Reset

func (m *EndpointSubset_EndpointAddress) Reset()

func (*EndpointSubset_EndpointAddress) String

func (*EndpointSubset_EndpointAddress) XXX_DiscardUnknown added in v1.4.0

func (m *EndpointSubset_EndpointAddress) XXX_DiscardUnknown()

func (*EndpointSubset_EndpointAddress) XXX_Marshal added in v1.4.0

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

func (*EndpointSubset_EndpointAddress) XXX_Merge added in v1.4.0

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

func (*EndpointSubset_EndpointAddress) XXX_Size added in v1.4.0

func (m *EndpointSubset_EndpointAddress) XXX_Size() int

func (*EndpointSubset_EndpointAddress) XXX_Unmarshal added in v1.4.0

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

type EndpointSubset_EndpointPort

type EndpointSubset_EndpointPort struct {
	// The name of this port (corresponds to ServicePort.Name).
	// Must be a DNS_LABEL.
	// Optional only if one port is defined.
	// +optional
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The port number of the endpoint.
	Port int32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"`
	// The IP protocol for this port.
	// Must be UDP or TCP.
	// Default is TCP.
	// +optional
	Protocol             string   `protobuf:"bytes,3,opt,name=protocol,proto3" json:"protocol,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

EndpointPort is a tuple that describes a single port.

func (*EndpointSubset_EndpointPort) Descriptor

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

func (*EndpointSubset_EndpointPort) GetName

func (m *EndpointSubset_EndpointPort) GetName() string

func (*EndpointSubset_EndpointPort) GetPort

func (m *EndpointSubset_EndpointPort) GetPort() int32

func (*EndpointSubset_EndpointPort) GetProtocol

func (m *EndpointSubset_EndpointPort) GetProtocol() string

func (*EndpointSubset_EndpointPort) ProtoMessage

func (*EndpointSubset_EndpointPort) ProtoMessage()

func (*EndpointSubset_EndpointPort) Reset

func (m *EndpointSubset_EndpointPort) Reset()

func (*EndpointSubset_EndpointPort) String

func (m *EndpointSubset_EndpointPort) String() string

func (*EndpointSubset_EndpointPort) XXX_DiscardUnknown added in v1.4.0

func (m *EndpointSubset_EndpointPort) XXX_DiscardUnknown()

func (*EndpointSubset_EndpointPort) XXX_Marshal added in v1.4.0

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

func (*EndpointSubset_EndpointPort) XXX_Merge added in v1.4.0

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

func (*EndpointSubset_EndpointPort) XXX_Size added in v1.4.0

func (m *EndpointSubset_EndpointPort) XXX_Size() int

func (*EndpointSubset_EndpointPort) XXX_Unmarshal added in v1.4.0

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

type Endpoints

type Endpoints struct {
	// Name of the service unique within the namespace for which these
	// Endpoint Subsets apply to.
	// Cannot be updated.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Namespace for service for which these endpoint subsets apply to.
	// An empty namespace is equivalent to the "default" namespace, but
	// "default" is the canonical representation used in the key for a
	// key-value store.
	// Cannot be updated.
	Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,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.
	EndpointSubsets      []*EndpointSubset `protobuf:"bytes,3,rep,name=endpoint_subsets,json=endpointSubsets" json:"endpoint_subsets,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

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}]
   },
]

func (*Endpoints) Descriptor

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

func (*Endpoints) GetEndpointSubsets

func (m *Endpoints) GetEndpointSubsets() []*EndpointSubset

func (*Endpoints) GetName

func (m *Endpoints) GetName() string

func (*Endpoints) GetNamespace

func (m *Endpoints) GetNamespace() string

func (*Endpoints) ProtoMessage

func (*Endpoints) ProtoMessage()

func (*Endpoints) Reset

func (m *Endpoints) Reset()

func (*Endpoints) String

func (m *Endpoints) String() string

func (*Endpoints) XXX_DiscardUnknown added in v1.4.0

func (m *Endpoints) XXX_DiscardUnknown()

func (*Endpoints) XXX_Marshal added in v1.4.0

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

func (*Endpoints) XXX_Merge added in v1.4.0

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

func (*Endpoints) XXX_Size added in v1.4.0

func (m *Endpoints) XXX_Size() int

func (*Endpoints) XXX_Unmarshal added in v1.4.0

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

type ID

type ID struct {
	Name      string
	Namespace string
}

ID used to uniquely represent a K8s Policy.

func GetID

func GetID(endpoints *Endpoints) ID

GetID returns ID of a policy.

func (ID) String

func (id ID) String() string

String returns a string representation of a policy ID.

type ObjectReference

type ObjectReference struct {
	// Kind of the referent.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
	// +optional
	Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"`
	// Namespace of the referent.
	// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
	// +optional
	Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// Name of the referent.
	// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
	// +optional
	Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	// UID of the referent.
	// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
	// +optional
	Uid string `protobuf:"bytes,4,opt,name=uid,proto3" json:"uid,omitempty"`
	// API version of the referent.
	// +optional
	ApiVersion string `protobuf:"bytes,5,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"`
	// Specific resourceVersion to which this reference is made, if any.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency
	// +optional
	ResourceVersion      string   `protobuf:"bytes,6,opt,name=resource_version,json=resourceVersion,proto3" json:"resource_version,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ObjectReference contains enough information to let you inspect or modify the referred object. +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*ObjectReference) Descriptor

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

func (*ObjectReference) GetApiVersion

func (m *ObjectReference) GetApiVersion() string

func (*ObjectReference) GetKind

func (m *ObjectReference) GetKind() string

func (*ObjectReference) GetName

func (m *ObjectReference) GetName() string

func (*ObjectReference) GetNamespace

func (m *ObjectReference) GetNamespace() string

func (*ObjectReference) GetResourceVersion

func (m *ObjectReference) GetResourceVersion() string

func (*ObjectReference) GetUid

func (m *ObjectReference) GetUid() string

func (*ObjectReference) ProtoMessage

func (*ObjectReference) ProtoMessage()

func (*ObjectReference) Reset

func (m *ObjectReference) Reset()

func (*ObjectReference) String

func (m *ObjectReference) String() string

func (*ObjectReference) XXX_DiscardUnknown added in v1.4.0

func (m *ObjectReference) XXX_DiscardUnknown()

func (*ObjectReference) XXX_Marshal added in v1.4.0

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

func (*ObjectReference) XXX_Merge added in v1.4.0

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

func (*ObjectReference) XXX_Size added in v1.4.0

func (m *ObjectReference) XXX_Size() int

func (*ObjectReference) XXX_Unmarshal added in v1.4.0

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

Jump to

Keyboard shortcuts

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