util

package
v0.0.0-...-c7e85b4 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2019 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KUBE_TUNNEL_IF    = "tunl0"
	KUBE_DUMMY_IF     = "dummy-vip-if"
	KUBE_MAIN_IF      = "eth0"
	IFACE_NOT_FOUND   = "Link not found"
	IFACE_HAS_ADDR    = "file exists"
	IFACE_HAS_NO_ADDR = "cannot assign requested address"

	DEFAULT_KUBE_MAIN_IF_MTU = 1500
	KUBE_TUNNEL_IF_OVERHEAD  = 20
	TCP_MSS_DIFF             = 40
)

Variables

View Source
var (
	Hostname        string
	ResyncPeriod    time.Duration
	BindAddress     string
	MetricsPath     string
	MetricsPort     string
	MetricsInterval time.Duration
	HealthPath      string
	HealthPort      string
	WatcherSyncDur  time.Duration
)

Functions

func AddIPtoInterface

func AddIPtoInterface(ip net.IP, iface netlink.Link) (bool, error)

func DeleteIPfromInterface

func DeleteIPfromInterface(ip net.IP, iface netlink.Link) error

func DeleteNonSuppliedIPsFromInterface

func DeleteNonSuppliedIPsFromInterface(addresses []net.IP, iface netlink.Link) ([]string, error)

func Difference

func Difference(a, b []string) []string

Difference returns the elements in a that aren't in b

func GetDummyVipInterface

func GetDummyVipInterface() (netlink.Link, error)

func GetFunctionName

func GetFunctionName(i interface{}) string

func GetNetAddrsfromInterface

func GetNetAddrsfromInterface(iface netlink.Link) ([]netlink.Addr, error)

func LoadKernelModule

func LoadKernelModule(name string) error

func Main

func Main(f MainFunc, cfg interface{})

func NewEventRecorder

func NewEventRecorder(client clientset.Interface, componentName string) record.EventRecorder

func Sysctl

func Sysctl(name, value string) (string, error)

sysctl sets the named sysctl to the value specified and returns its original value as a string. Note that this cannot be used if a sysctl component includes a period it its name - in that case use sysctlByComponents instead.

Types

type Logger

type Logger interface {
	Infof(format string, args ...interface{})
}

type MainFunc

type MainFunc func(*rest.Config, interface{}, *metrics.MetricsPublisher, *health.HealthManager) ([]RunFunc, error)

type NamedLogger

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

func NewNamedLogger

func NewNamedLogger(name string, level glog.Level) *NamedLogger

func (*NamedLogger) Infof

func (nl *NamedLogger) Infof(format string, args ...interface{})

type RunFunc

type RunFunc func(<-chan struct{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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