kubelink

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2020 License: Apache-2.0, BSD-3-Clause, MIT Imports: 16 Imported by: 9

Documentation

Index

Constants

View Source
const DEFAULT_PORT = 80

Variables

This section is empty.

Functions

func ShowRoutes

func ShowRoutes(name string) error

Types

type CIDR

type CIDR struct {
	Broadcast net.IP
	*net.IPNet
}

func ParseCIDR

func ParseCIDR(s string) (*CIDR, error)
type Link struct {
	Name           string
	ServiceCIDR    *net.IPNet
	Egress         tcp.CIDRList
	Ingress        tcp.CIDRList
	ClusterAddress *net.IPNet
	Gateway        net.IP
	Host           string
	Endpoint       string
	LinkForeignData
}

func (*Link) AllowIngress

func (this *Link) AllowIngress(ip net.IP) (granted bool, set bool)

func (*Link) String

func (this *Link) String() string

type LinkAccessInfo

type LinkAccessInfo struct {
	CACert string
	Token  string
}

func (LinkAccessInfo) Equal

func (this LinkAccessInfo) Equal(other LinkAccessInfo) bool

func (LinkAccessInfo) String

func (this LinkAccessInfo) String() string

type LinkDNSInfo

type LinkDNSInfo struct {
	ClusterDomain string
	DnsIP         net.IP
}

func (LinkDNSInfo) Equal

func (this LinkDNSInfo) Equal(other LinkDNSInfo) bool

func (LinkDNSInfo) String

func (this LinkDNSInfo) String() string

type LinkForeignData

type LinkForeignData struct {
	UpdatePending bool
	LinkAccessInfo
	LinkDNSInfo
}
type Links struct {
	// contains filtered or unexported fields
}
func GetSharedLinks(controller controller.Interface) *Links
func NewLinks(resc resources.Interface) *Links
func (this *Links) GetLink(name string) *Link

func (*Links) GetLinkForClusterAddress

func (this *Links) GetLinkForClusterAddress(ip net.IP) *Link

func (*Links) GetLinkForEndpoint

func (this *Links) GetLinkForEndpoint(dnsname string) *Link

func (*Links) GetLinkForIP

func (this *Links) GetLinkForIP(ip net.IP) *Link

func (*Links) GetRoutes

func (this *Links) GetRoutes(ifce *NodeInterface) Routes
func (this *Links) GetRoutesToLink(ifce *NodeInterface, link netlink.Link) Routes

func (*Links) GetSNATRules

func (this *Links) GetSNATRules(ifce *NodeInterface) iptables.Requests

func (*Links) LinkFor

func (this *Links) LinkFor(link *v1alpha1.KubeLink) (*Link, error)

func (*Links) LinkInfoUpdated

func (this *Links) LinkInfoUpdated(logger logger.LogContext, name string, access *LinkAccessInfo, dns *LinkDNSInfo) *Link
func (this *Links) RegisterLink(name string, clusterCIDR *net.IPNet, fqdn string, cidr *net.IPNet) (*Link, error)
func (this *Links) RemoveLink(name string)

func (*Links) Setup

func (this *Links) Setup(logger logger.LogContext, cluster cluster.Interface)
func (this *Links) UpdateLink(klink *v1alpha1.KubeLink) (*Link, error)

func (*Links) UpdateLinkInfo

func (this *Links) UpdateLinkInfo(logger logger.LogContext, name string, access *LinkAccessInfo, dns *LinkDNSInfo, pending bool) (*Link, bool)

func (*Links) Visit

func (this *Links) Visit(visitor func(l *Link) bool)

type NodeInterface

type NodeInterface struct {
	Name  string
	Index int
	IP    net.IP
}

func LookupNodeIP

func LookupNodeIP(logger logger.LogContext, cidr *net.IPNet) (*NodeInterface, error)

type Routes

type Routes []netlink.Route

func ListRoutes

func ListRoutes() (Routes, error)

func ListRoutesForInterface

func ListRoutesForInterface(name string) (Routes, error)

func (*Routes) Add

func (this *Routes) Add(route netlink.Route) Routes

func (Routes) Lookup

func (this Routes) Lookup(route netlink.Route) int

func (Routes) LookupAndLogMismatchReason

func (this Routes) LookupAndLogMismatchReason(logger logger.LogContext, route netlink.Route) int

type StringList

type StringList []string

func (StringList) Equals

func (this StringList) Equals(r StringList) bool

func (StringList) Index

func (this StringList) Index(val string) int

type StringLists

type StringLists []StringList

func (StringLists) Index

func (this StringLists) Index(l StringList) int

Jump to

Keyboard shortcuts

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