controller

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerType added in v0.1.2

type ContainerType int

ContainerType defines the type if continer used to support the pods

const (
	// Docker type container
	Docker ContainerType = iota

	// Crio type container
	Crio
)

func (ContainerType) String added in v0.1.2

func (ct ContainerType) String() string

type Controller

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

Controller the controller object

func NewController

func NewController(kubeClient *kubernetes.Clientset, endpoint, cniBinPath, cniConfPath, cniVendor string, containerType ContainerType) (*Controller, error)

NewController instantiate a docker controller object

func (*Controller) Process added in v0.1.6

func (c *Controller) Process(e *Event)

Process will take a element from the FIFO queue and attempt to process it (either add or remove network)

func (*Controller) Run

func (c *Controller) Run(ctx context.Context, nodeName string) error

Run starts a Pod resource controller

type Event added in v0.1.6

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

Event struct

type EventQueue added in v0.1.6

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

EventQueue is a FIFO type queue

func (*EventQueue) Dequeue added in v0.1.6

func (eq *EventQueue) Dequeue() *Event

Dequeue will remove the first element from the queue and return it for processing. The caller MUST use the mutex provided by the EventQueue struct

func (*EventQueue) Enqueue added in v0.1.6

func (eq *EventQueue) Enqueue(event *Event)

Enqueue will push the new event in the FIFO queue If a similar event already exists with a opposite operation type, both event will be discarded.

type OpType added in v0.1.6

type OpType int
const (
	Add OpType = iota
	Delete
)

type Runtime added in v0.1.2

type Runtime interface {
	// GetNetNS returns the network namespace of the given containerID. The ID
	// supplied is typically the ID of a pod sandbox. This getter doesn't try
	// to map non-sandbox IDs to their respective sandboxes.
	GetNetNS(podSandboxID string) (string, error)

	// GetSandboxID returns kubernete's docker "pause" container ID
	GetSandboxID(containerID string) (string, error)
}

Runtime interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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