controller

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigRecord added in v0.1.9

type ConfigRecord struct {
	Expected ExpectedConfig
	Running  RunningConfig
}

type ConfigStore added in v0.1.9

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

ConfigStore is a store for Config

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 ExpectedConfig added in v0.1.9

type ExpectedConfig struct {
	Optype Optype
	Data   interface{}
}

ExpectedConfig struct

type Optype added in v0.1.9

type Optype string
const (
	Add    Optype = "Add"
	Delete Optype = "Delete"
)

type RunningConfig added in v0.1.9

type RunningConfig struct {
	State RunningState
	Data  interface{}
}

RunningConfig struct

type RunningState added in v0.1.9

type RunningState string
const (
	Nil    RunningState = "Nil"
	Active RunningState = "Active"
	Dirty  RunningState = "Dirty"
)

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