daemon

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2019 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DaemonModeVPC        = "VPC"
	DaemonModeENIMultiIP = "ENIMultiIP"
)
View Source
const (
	PodNetworkTypeVPCIP      = "VPCIP"
	PodNetworkTypeVPCENI     = "VPCENI"
	PodNetworkTypeENIMultiIP = "ENIMultiIP"
	DBPath                   = "/var/lib/cni/terway/pod.db"
	DBName                   = "pods"
)
View Source
const (
	BYTE = 1 << (10 * iota)
	KILOBYTE
	MEGABYTE
	GIGABYTE
	TERABYTE
)
View Source
const (
	ResDBPath = "/var/lib/cni/terway/ResRelation.db"
	ResDBName = "relation"
)
View Source
const K8S_KUBEADM_CONFIGMAP = "kubeadm-config"
View Source
const K8S_KUBEADM_CONFIGMAP_ClusterConfiguration = "ClusterConfiguration"
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 StorageCleanPeriod = 1 * time.Hour

Functions

func Run

func Run(pidFilePath string, socketFilePath string, debugSocketListen string, configFilePath string, daemonMode string, logLevel string) error

func RunDebugServer added in v1.0.10

func RunDebugServer(debugSocketListen string) error

Types

type ENI added in v1.0.10

type ENI struct {
	*types.ENI
	// contains filtered or unexported fields
}

type ENIFactory added in v1.0.10

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

func NewENIFactory added in v1.0.10

func NewENIFactory(poolConfig *types.PoolConfig, ecs aliyun.ECS) (*ENIFactory, error)

func (*ENIFactory) Create added in v1.0.10

func (f *ENIFactory) Create() (types.NetworkResource, error)

func (*ENIFactory) Dispose added in v1.0.10

func (f *ENIFactory) Dispose(resource types.NetworkResource) error

type ENIIP added in v1.0.10

type ENIIP struct {
	*types.ENIIP
}

type ENIIPFactory added in v1.0.10

type ENIIPFactory struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*ENIIPFactory) Create added in v1.0.10

func (f *ENIIPFactory) Create() (ip types.NetworkResource, err error)

func (*ENIIPFactory) Dispose added in v1.0.10

func (f *ENIIPFactory) Dispose(res types.NetworkResource) (err error)

type ENIIPResourceManager added in v1.0.10

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

func (*ENIIPResourceManager) Allocate added in v1.0.10

func (*ENIIPResourceManager) GarbageCollection added in v1.0.10

func (m *ENIIPResourceManager) GarbageCollection(inUseSet map[string]interface{}, expireResSet map[string]interface{}) error

func (*ENIIPResourceManager) Release added in v1.0.10

func (m *ENIIPResourceManager) Release(context *NetworkContext, resId string) error

type ENIResourceManager added in v1.0.10

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

func (*ENIResourceManager) Allocate added in v1.0.10

func (m *ENIResourceManager) Allocate(ctx *NetworkContext, prefer string) (types.NetworkResource, error)

func (*ENIResourceManager) GarbageCollection added in v1.0.10

func (m *ENIResourceManager) GarbageCollection(inUseSet map[string]interface{}, expireResSet map[string]interface{}) error

func (*ENIResourceManager) Release added in v1.0.10

func (m *ENIResourceManager) Release(context *NetworkContext, resId string) error

type Kubernetes added in v1.0.10

type Kubernetes interface {
	GetLocalPods() ([]*podInfo, error)
	GetPod(namespace, name string) (*podInfo, error)
	GetServiceCidr() *net.IPNet
	GetNodeCidr() *net.IPNet
	SetNodeAllocatablePod(count int) error
}

type NetworkContext added in v1.0.10

type NetworkContext struct {
	context.Context
	// contains filtered or unexported fields
}

func (*NetworkContext) Log added in v1.0.10

func (networkContext *NetworkContext) Log() *logrus.Entry

type NullResourceManager added in v1.0.10

type NullResourceManager struct {
}

func (NullResourceManager) Allocate added in v1.0.10

func (NullResourceManager) Allocate(context *NetworkContext, prefer string) (types.NetworkResource, error)

func (NullResourceManager) GarbageCollection added in v1.0.10

func (NullResourceManager) GarbageCollection(inUseResList []string, expireResList []string) error

func (NullResourceManager) Release added in v1.0.10

func (NullResourceManager) Release(context *NetworkContext, resId string) error

type PodResources added in v1.0.10

type PodResources struct {
	Resources []ResourceItem
	PodInfo   *podInfo
	// contains filtered or unexported fields
}

func (PodResources) GetResourceItemByType added in v1.0.10

func (p PodResources) GetResourceItemByType(resType string) []ResourceItem

type ResourceItem added in v1.0.10

type ResourceItem struct {
	Type string `json:"type"`
	ID   string `json:"id"`
}

type ResourceManager added in v1.0.10

type ResourceManager interface {
	Allocate(context *NetworkContext, prefer string) (types.NetworkResource, error)
	Release(context *NetworkContext, resId string) error
	GarbageCollection(inUseResList map[string]interface{}, expireResList map[string]interface{}) error
}

ResourceManager Allocate/Release/Pool/Stick/GC pod resource managed pod and resource relationship

func NewENIIPResourceManager added in v1.0.10

func NewENIIPResourceManager(poolConfig *types.PoolConfig, ecs aliyun.ECS, allocatedResources []string) (ResourceManager, error)

func NewENIResourceManager added in v1.0.10

func NewENIResourceManager(poolConfig *types.PoolConfig, ecs aliyun.ECS, allocatedResource []string) (ResourceManager, error)

func NewVPCResourceManager added in v1.0.10

func NewVPCResourceManager() (ResourceManager, error)

type VethResourceManager added in v1.0.10

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

func (*VethResourceManager) Allocate added in v1.0.10

func (*VethResourceManager) Allocate(context *NetworkContext, prefer string) (types.NetworkResource, error)

func (*VethResourceManager) GarbageCollection added in v1.0.10

func (f *VethResourceManager) GarbageCollection(inUseSet map[string]interface{}, expireResSet map[string]interface{}) error

func (*VethResourceManager) Release added in v1.0.10

func (*VethResourceManager) Release(context *NetworkContext, resId string) error

Jump to

Keyboard shortcuts

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