node

package
v3.8.0-alpha.0+incompa... Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2017 License: Apache-2.0 Imports: 68 Imported by: 0

Documentation

Overview

Package node contains the OpenShift SDN networking code that runs on the nodes

Index

Constants

View Source
const (
	SDNNamespace = "openshift"
	SDNSubsystem = "sdn"

	OVSFlowsKey                 = "ovs_flows"
	ARPCacheAvailableEntriesKey = "arp_cache_entries"
	PodIPsKey                   = "pod_ips"
	PodSetupErrorsKey           = "pod_setup_errors"
	PodSetupLatencyKey          = "pod_setup_latency"
	PodTeardownErrorsKey        = "pod_teardown_errors"
	PodTeardownLatencyKey       = "pod_teardown_latency"
	VnidNotFoundErrorsKey       = "vnid_not_found_errors"
)
View Source
const (
	Br0    = "br0"
	Tun0   = "tun0"
	Vxlan0 = "vxlan0"
)

Variables

View Source
var (
	OVSFlows = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Namespace: SDNNamespace,
			Subsystem: SDNSubsystem,
			Name:      OVSFlowsKey,
			Help:      "Number of Open vSwitch flows",
		},
	)

	ARPCacheAvailableEntries = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Namespace: SDNNamespace,
			Subsystem: SDNSubsystem,
			Name:      ARPCacheAvailableEntriesKey,
			Help:      "Number of available entries in the ARP cache",
		},
	)

	PodIPs = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Namespace: SDNNamespace,
			Subsystem: SDNSubsystem,
			Name:      PodIPsKey,
			Help:      "Number of allocated pod IPs",
		},
	)

	PodSetupErrors = prometheus.NewCounter(
		prometheus.CounterOpts{
			Namespace: SDNNamespace,
			Subsystem: SDNSubsystem,
			Name:      PodSetupErrorsKey,
			Help:      "Number pod setup errors",
		},
	)

	PodSetupLatency = prometheus.NewSummaryVec(
		prometheus.SummaryOpts{
			Namespace: SDNNamespace,
			Subsystem: SDNSubsystem,
			Name:      PodSetupLatencyKey,
			Help:      "Latency of pod network setup in microseconds",
		},
		[]string{"pod_namespace", "pod_name", "sandbox_id"},
	)

	PodTeardownErrors = prometheus.NewCounter(
		prometheus.CounterOpts{
			Namespace: SDNNamespace,
			Subsystem: SDNSubsystem,
			Name:      PodTeardownErrorsKey,
			Help:      "Number pod teardown errors",
		},
	)

	PodTeardownLatency = prometheus.NewSummaryVec(
		prometheus.SummaryOpts{
			Namespace: SDNNamespace,
			Subsystem: SDNSubsystem,
			Name:      PodTeardownLatencyKey,
			Help:      "Latency of pod network teardown in microseconds",
		},
		[]string{"pod_namespace", "pod_name", "sandbox_id"},
	)

	VnidNotFoundErrors = prometheus.NewCounter(
		prometheus.CounterOpts{
			Namespace: SDNNamespace,
			Subsystem: SDNSubsystem,
			Name:      VnidNotFoundErrorsKey,
			Help:      "Number of VNID-not-found errors",
		},
	)
)
View Source
var (
	ErrorNetworkInterfaceNotFound = fmt.Errorf("could not find network interface")
)

Functions

func GetLinkDetails

func GetLinkDetails(ip string) (netlink.Link, *net.IPNet, error)

func New

Called by higher layers to create the plugin SDN node instance

func NewMultiTenantPlugin

func NewMultiTenantPlugin() osdnPolicy

func NewNetworkPolicyPlugin

func NewNetworkPolicyPlugin() osdnPolicy

func NewOVSController

func NewOVSController(ovsif ovs.Interface, pluginId int, useConnTrack bool, localIP string) *ovsController

func NewSingleTenantPlugin

func NewSingleTenantPlugin() osdnPolicy

func RegisterMetrics

func RegisterMetrics()

Register all node metrics.

Types

type Chain

type Chain struct {
	// contains filtered or unexported fields
}

type NodeIPTables

type NodeIPTables struct {
	// contains filtered or unexported fields
}

func (*NodeIPTables) AddEgressIPRules

func (n *NodeIPTables) AddEgressIPRules(egressIP, egressHex string) error

func (*NodeIPTables) DeleteEgressIPRules

func (n *NodeIPTables) DeleteEgressIPRules(egressIP, egressHex string) error

func (*NodeIPTables) Setup

func (n *NodeIPTables) Setup() error

type OsdnNode

type OsdnNode struct {
	// contains filtered or unexported fields
}

func (*OsdnNode) AddHostSubnetRules

func (plugin *OsdnNode) AddHostSubnetRules(subnet *networkapi.HostSubnet)

func (*OsdnNode) AddServiceRules

func (plugin *OsdnNode) AddServiceRules(service *kapi.Service, netID uint32)

func (*OsdnNode) DeleteHostSubnetRules

func (plugin *OsdnNode) DeleteHostSubnetRules(subnet *networkapi.HostSubnet)

func (*OsdnNode) DeleteServiceRules

func (plugin *OsdnNode) DeleteServiceRules(service *kapi.Service)

func (*OsdnNode) GetLocalPods

func (node *OsdnNode) GetLocalPods(namespace string) ([]kapi.Pod, error)

func (*OsdnNode) SetupEgressNetworkPolicy

func (plugin *OsdnNode) SetupEgressNetworkPolicy() error

func (*OsdnNode) SetupSDN

func (plugin *OsdnNode) SetupSDN() (bool, error)

func (*OsdnNode) Start

func (node *OsdnNode) Start() error

func (*OsdnNode) SubnetStartNode

func (node *OsdnNode) SubnetStartNode() error

func (*OsdnNode) UpdateEgressNetworkPolicyVNID

func (plugin *OsdnNode) UpdateEgressNetworkPolicyVNID(namespace string, oldVnid, newVnid uint32)

func (*OsdnNode) UpdatePod

func (node *OsdnNode) UpdatePod(pod kapi.Pod) error

FIXME: this should eventually go into kubelet via a CNI UPDATE/CHANGE action See https://github.com/containernetworking/cni/issues/89

type OsdnNodeConfig

type OsdnNodeConfig struct {
	PluginName      string
	Hostname        string
	SelfIP          string
	RuntimeEndpoint string
	MTU             uint32
	EnableHostports bool

	NetworkClient networkclient.Interface
	KClient       kclientset.Interface
	Recorder      record.EventRecorder

	KubeInformers kinternalinformers.SharedInformerFactory

	IPTablesSyncPeriod time.Duration
	ProxyMode          componentconfig.ProxyMode
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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