daemon

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2018 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IPMASQ_CHAIN = "eni-masq"

	DELEGATE_PLUGIN = "host-local"
	DELEGATE_CONF   = `
{
	"ipam": {
		"type": "host-local",
		"subnet": "%s",
		"routes": [
			{ "dst": "0.0.0.0/0" }
		]
	}
}
`
)
View Source
const K8S_KUBEADM_CONFIGMAP = "kubeadm-config"
View Source
const K8S_KUBEADM_CONFIGMAP_NETWORKING = "MasterConfiguration"
View Source
const K8S_POD_NAMESPACE_ARGS = "K8S_POD_NAMESPACE"
View Source
const K8S_POD_NAME_ARGS = "K8S_POD_NAME"
View Source
const K8S_SYSTEM_NAMESPACE = "kube-system"
View Source
const POD_EGRESS_BANDWIDTH = "k8s.aliyun.com/egress-bandwidth"
View Source
const POD_INGRESS_BANDWIDTH = "k8s.aliyun.com/ingress-bandwidth"
View Source
const POD_NEED_ENI = "k8s.aliyun.com/eni"

Variables

View Source
var KUBERNETES_ALICLOUD_IDENTITY = "Kubernetes.Alicloud"
View Source
var (
	LINK_IP = &net.IPNet{
		IP:   net.IPv4(169, 254, 1, 1),
		Mask: net.CIDRMask(32, 32),
	}
)
View Source
var ROLE_NAME = "KubernetesMasterRole"
View Source
var TOKEN_RESYNC_PERIOD = 5 * time.Minute

Functions

func GetMacAddress

func GetMacAddress(ifName string, netns ns.NetNS) (string, error)

func NewRateLimiter

func NewRateLimiter(thro int) *ratelimit

func Run

func Run(pidFilePath string, socketFilePath string, configFilePath string) error

func SetupVethPair

func SetupVethPair(contVethName, pairName string, mtu int, hostNS ns.NetNS) (net.Interface, net.Interface, error)

func VethNameForWorkload

func VethNameForWorkload(workload string) string

VethNameForWorkload returns a deterministic veth name for the given Kubernetes workload.

Types

type ClientMgr

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

func NewClientMgr

func NewClientMgr(key, secret string) (*ClientMgr, error)

func (*ClientMgr) MetaData

func (c *ClientMgr) MetaData() *metadata.MetaData

type CmdArgs

type CmdArgs struct {
	ContainerID string
	Netns       ns.NetNS
	IfName      string
	Args        string
	Path        string
	PodName     string
	PodNS       string
}

type ENIPlugin

type ENIPlugin struct {
	ENI *types.ENI
}

func (*ENIPlugin) Add

func (ep *ENIPlugin) Add(args *CmdArgs, result *current.Result) error

func (*ENIPlugin) Del

func (ep *ENIPlugin) Del(args *CmdArgs, result *current.Result) error

func (*ENIPlugin) Get

func (ep *ENIPlugin) Get(args *CmdArgs) (string, error)

type ENIService

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

func (*ENIService) Allocate

func (eni *ENIService) Allocate(skelArgs *skel.CmdArgs, result *current.Result) error

func (*ENIService) Release

func (eni *ENIService) Release(skelArgs *skel.CmdArgs, result *current.Result) error

type Pool

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

func (*Pool) Allocate

func (p *Pool) Allocate() (*types.ENI, error)

func (*Pool) AvailableNics

func (p *Pool) AvailableNics() int

func (*Pool) RefreshNics

func (p *Pool) RefreshNics() error

func (*Pool) Release

func (p *Pool) Release(mac string) error

type TokenAuth

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

type VETHPlugin

type VETHPlugin struct {
	ENI            *types.ENI
	ServiceAddress *net.IPNet
	Subnet         *net.IPNet
	// contains filtered or unexported fields
}

func (*VETHPlugin) Add

func (vp *VETHPlugin) Add(args *CmdArgs, result *current.Result) error

func (*VETHPlugin) Del

func (vp *VETHPlugin) Del(args *skel.CmdArgs, result *current.Result) error

Jump to

Keyboard shortcuts

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