Documentation ¶
Index ¶
- Constants
- func ShowRoutes(name string) error
- type CIDR
- type FirewallRule
- type Link
- func (this *Link) AcceptIP(ip net.IP) bool
- func (this *Link) AllowIngress(ip net.IP) (granted bool, set bool)
- func (this *Link) GetIngressChain() *iptables.ChainRequest
- func (this *Link) GetRequired() LinkNameSet
- func (this *Link) HasEndpoint() bool
- func (this *Link) IsInbound() bool
- func (this *Link) IsLocalLink() bool
- func (this *Link) IsWireguard() bool
- func (this *Link) MatchMesh(cidr *net.IPNet) bool
- func (this *Link) String() string
- type LinkAccessInfo
- type LinkDNSInfo
- type LinkForeignData
- type LinkIndex
- func (this *LinkIndex) Add(link *Link)
- func (this *LinkIndex) All() map[LinkName]*Link
- func (this *LinkIndex) ByClusterAddress(ip net.IP) *Link
- func (this *LinkIndex) ByEndpointHost(name string) *Link
- func (this *LinkIndex) ByMesh(name string) LinkNameSet
- func (this *LinkIndex) ByName(name LinkName) *Link
- func (this *LinkIndex) HasWireguard() bool
- func (this *LinkIndex) IsGatewayLink(name LinkName) bool
- func (this *LinkIndex) IsGatewayNode(ip net.IP) bool
- func (this *LinkIndex) LookupByEgressIP(ip net.IP) *Link
- func (this *LinkIndex) LookupGatewaysForMeshIP(ip net.IP) tcp.IPList
- func (this *LinkIndex) MeshLinksFor(name string) LinkNameSet
- func (this *LinkIndex) Remove(name LinkName)
- func (this *LinkIndex) ServedLinksFor(name LinkName) LinkNameSet
- func (this *LinkIndex) Visit(visitor func(l *Link) bool)
- type LinkName
- type LinkNameSet
- type LinkSpec
- type Links
- type Mesh
- func (this *Mesh) CIDR() *net.IPNet
- func (this *Mesh) ClusterAddress() *net.IPNet
- func (this *Mesh) ClusterDomain() string
- func (this *Mesh) ClusterName() string
- func (this *Mesh) DNSIP() net.IP
- func (this *Mesh) DeletePending() bool
- func (this *Mesh) LinkName() LinkName
- func (this *Mesh) Name() string
- func (this *Mesh) PropagateDNS() bool
- type MeshIndex
- func (this *MeshIndex) Add(link *Link)
- func (this *MeshIndex) All() map[string]*Mesh
- func (this *MeshIndex) ByCIDR(cidr *net.IPNet) *Mesh
- func (this *MeshIndex) ByLinkName(name LinkName) *Mesh
- func (this *MeshIndex) ByLocalAddress(ip net.IP) *Mesh
- func (this *MeshIndex) ByName(name string) *Mesh
- func (this *MeshIndex) GetMeshCIDRs() tcp.CIDRList
- func (this *MeshIndex) GetMeshInfos() map[string]*Mesh
- func (this *MeshIndex) GetMeshLinks() map[LinkName]*Link
- func (this *MeshIndex) IsDeletePending(name string) bool
- func (this *MeshIndex) LinkByCIDR(cidr *net.IPNet) *Link
- func (this *MeshIndex) LinkByLinkName(name LinkName) *Link
- func (this *MeshIndex) LinkByName(name string) *Link
- func (this *MeshIndex) LookupByIP(ip net.IP) *Mesh
- func (this *MeshIndex) MarkLinkForDeletion(name LinkName)
- func (this *MeshIndex) Remove(name LinkName)
- func (this *MeshIndex) RemoveByName(name string)
- func (this *MeshIndex) SetDefaultMesh(link *Link)
- func (this *MeshIndex) Visit(visitor func(m *Mesh, l *Link) bool)
- type NodeInterface
- type Routes
- type RuleDef
- type StringList
- type StringLists
Constants ¶
View Source
const CHAIN_PREFIX = "KUBELINK-"
View Source
const CLUSTER_DNS_IP = 10
View Source
const DEFAULT_MESH = "<default>"
View Source
const DEFAULT_PORT = 80
View Source
const DNSMODE_DNS = "dns"
View Source
const DNSMODE_KUBERNETES = "kubernetes"
View Source
const DNSMODE_NONE = "none"
View Source
const DROP_ACTION = "DROP" // MARK_DROP_CHAIN
View Source
const DROP_CHAIN = CHAIN_PREFIX + "DROP"
View Source
const EP_INBOUND = "Inbound"
View Source
const EP_LOCAL = "LocalLink"
View Source
const EP_NONE = "None"
View Source
const FIREWALL_CHAIN = CHAIN_PREFIX + "FIREWALL"
View Source
const FW_LINK_CHAIN_PREFIX = CHAIN_PREFIX + "FW-"
View Source
const GW_LINK_CHAIN_PREFIX = CHAIN_PREFIX + "GW-"
View Source
const KUBELINK_DNS_IP = 11
View Source
const LINKNAME_SEP = "--"
View Source
const LINKS_CHAIN = CHAIN_PREFIX + "LINKS"
View Source
const MARK_BIT = "0x1000"
View Source
const MARK_DROP_CHAIN = CHAIN_PREFIX + "MARK-DROP"
View Source
const NAT_CHAIN = CHAIN_PREFIX + "NAT"
View Source
const NAT_MESH_CHAIN_PREFIX = CHAIN_PREFIX + "NT-"
View Source
const TABLE_DROP_CHAIN = TABLE_FIREWALL_CHAIN
View Source
const TABLE_FIREWALL_CHAIN = "filter"
View Source
const TABLE_LINKS_CHAIN = "mangle"
View Source
const TABLE_LINK_CHAIN = TABLE_MARK_DROP_CHAIN
View Source
const TABLE_MARK_DROP_CHAIN = TABLE_LINKS_CHAIN
View Source
const TABLE_NAT = "nat"
Variables ¶
This section is empty.
Functions ¶
func ShowRoutes ¶
Types ¶
type FirewallRule ¶
func ParseFirewallRule ¶
func ParseFirewallRule(list []string) (*FirewallRule, error)
func (*FirewallRule) IsSet ¶
func (this *FirewallRule) IsSet() bool
type Link ¶
type Link struct { Name LinkName ServiceCIDR *net.IPNet Egress tcp.CIDRList Ingress *FirewallRule ClusterAddress *net.IPNet GatewayLink *LinkName GatewayFor LinkNameSet Gateway net.IP Host string Port int Endpoint string PublicKey *wgtypes.Key LinkForeignData }
func LinkForSpec ¶
func (*Link) GetIngressChain ¶
func (this *Link) GetIngressChain() *iptables.ChainRequest
func (*Link) GetRequired ¶
func (this *Link) GetRequired() LinkNameSet
func (*Link) HasEndpoint ¶
func (*Link) IsLocalLink ¶
func (*Link) IsWireguard ¶
type LinkAccessInfo ¶
func (LinkAccessInfo) Equal ¶
func (this LinkAccessInfo) Equal(other LinkAccessInfo) bool
func (LinkAccessInfo) String ¶
func (this LinkAccessInfo) String() string
type LinkDNSInfo ¶
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 LinkIndex ¶
type LinkIndex struct {
// contains filtered or unexported fields
}
func NewLinkIndex ¶
func NewLinkIndex() *LinkIndex
func (*LinkIndex) ByEndpointHost ¶
func (*LinkIndex) ByMesh ¶
func (this *LinkIndex) ByMesh(name string) LinkNameSet
func (*LinkIndex) HasWireguard ¶
func (*LinkIndex) IsGatewayLink ¶
func (*LinkIndex) LookupGatewaysForMeshIP ¶
func (*LinkIndex) MeshLinksFor ¶
func (this *LinkIndex) MeshLinksFor(name string) LinkNameSet
func (*LinkIndex) ServedLinksFor ¶
func (this *LinkIndex) ServedLinksFor(name LinkName) LinkNameSet
type LinkName ¶
type LinkName struct {
// contains filtered or unexported fields
}
func NewLinkName ¶
type LinkNameSet ¶
type LinkNameSet map[LinkName]struct{}
func NewLinkNameSet ¶
func NewLinkNameSet(names ...LinkName) LinkNameSet
func (LinkNameSet) Add ¶
func (this LinkNameSet) Add(names ...LinkName)
func (LinkNameSet) AddAll ¶
func (this LinkNameSet) AddAll(sets ...LinkNameSet) LinkNameSet
func (LinkNameSet) Contains ¶
func (this LinkNameSet) Contains(n LinkName) bool
func (LinkNameSet) Copy ¶
func (this LinkNameSet) Copy() LinkNameSet
func (LinkNameSet) Remove ¶
func (this LinkNameSet) Remove(n LinkName)
type LinkSpec ¶
type LinkSpec = api.KubeLinkSpec
type Links ¶
type Links interface { Setup(logger logger.LogContext, list []resources.Object) SetDefaultMesh(clusterName string, clusterAddress *net.IPNet, meshDNS LinkDNSInfo) SetGateway(ip net.IP) GetGateway() net.IP IsGateway(ifce *NodeInterface) bool IsGatewayLink(name LinkName) bool HasWireguard() bool RegisterLink(name LinkName, clusterCIDR *net.IPNet, fqdn string, cidr *net.IPNet) (*Link, error) GetLinks() map[LinkName]*Link GetLink(name LinkName) *Link LinkInfoUpdated(logger logger.LogContext, name LinkName, access *LinkAccessInfo, dns *LinkDNSInfo) *Link UpdateLinkInfo(logger logger.LogContext, name LinkName, access *LinkAccessInfo, dns *LinkDNSInfo, pending bool) (*Link, bool) ReplaceLink(link *Link) *Link UpdateLink(klink *api.KubeLink) (*Link, bool, error) RemoveLink(name LinkName) VisitLinks(visitor func(l *Link) bool) GetLinkForClusterAddress(ip net.IP) *Link GetLinkForIP(ip net.IP) *Link // TODO Rename GetLinkForEndpointHost(dnsname string) *Link ServedLinksFor(name LinkName) LinkNameSet GetMesh(name string) *Mesh GetMeshByLinkName(name LinkName) *Mesh GetMeshLink(name LinkName) *Link GetMeshLinks() map[LinkName]*Link GetMeshInfos() map[string]*Mesh GetMeshMembersFor(name string) LinkNameSet RemoveMesh(name string) MarkForDeletion(name LinkName) VisitMeshes(visitor func(m *Mesh, l *Link) bool) LookupMeshGatewaysFor(ip net.IP) tcp.IPList LookupClusterAddressByMeshAddress(ip net.IP) *net.IPNet LookupMeshByMeshAddress(ip net.IP) *Mesh GetRoutesToLink(ifce *NodeInterface, link netlink.Link) Routes GetRoutes(ifce *NodeInterface) Routes GetGatewayEgress(ifce *NodeInterface, meshCIDR *net.IPNet) tcp.CIDRList GetFirewallChains() iptables.Requests GetEgressChain(mesh *net.IPNet) *iptables.ChainRequest GetNatChains(clusterAddresses tcp.CIDRList, linkName string) iptables.Requests GetGatewayAddrs() tcp.CIDRList Locked(func(Links) error) error }
func GetSharedLinks ¶
func GetSharedLinks(controller controller.Interface, defaultport int) Links
type Mesh ¶
type Mesh struct {
// contains filtered or unexported fields
}
func NewMeshInfo ¶
func (*Mesh) ClusterAddress ¶
func (*Mesh) ClusterDomain ¶
func (*Mesh) ClusterName ¶
func (*Mesh) DeletePending ¶
func (*Mesh) PropagateDNS ¶
type MeshIndex ¶
type MeshIndex struct {
// contains filtered or unexported fields
}
func NewMeshIndex ¶
func NewMeshIndex() *MeshIndex
func (*MeshIndex) ByLinkName ¶
func (*MeshIndex) GetMeshCIDRs ¶
func (*MeshIndex) GetMeshInfos ¶
func (*MeshIndex) GetMeshLinks ¶
func (*MeshIndex) IsDeletePending ¶
func (*MeshIndex) LinkByLinkName ¶
func (*MeshIndex) LinkByName ¶
func (*MeshIndex) MarkLinkForDeletion ¶
func (*MeshIndex) RemoveByName ¶
func (*MeshIndex) SetDefaultMesh ¶
type NodeInterface ¶
func LookupNodeIP ¶
func LookupNodeIP(logger logger.LogContext, cidr *net.IPNet) (*NodeInterface, error)
type Routes ¶
func ListRoutes ¶
func ListRoutesForInterface ¶
func (Routes) LookupAndLogMismatchReason ¶
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
Click to show internal directories.
Click to hide internal directories.