cni

package
v0.0.0-...-907bc6e Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Defines the redirect object and operations.

Index

Constants

This section is empty.

Variables

View Source
var InterceptRuleMgrTypes = map[string]InterceptRuleMgrCtor{
	"iptables": IptablesInterceptRuleMgrCtor,
}

Functions

func CmdAdd

func CmdAdd(args *skel.CmdArgs) error

CmdAdd is called for pod ADD requests

func CmdDel

func CmdDel(args *skel.CmdArgs) error

cmdDel is called for pod DELETE requests

func CmdGet

func CmdGet(args *skel.CmdArgs) error

CmdGet is called for pod Get requests

Types

type InterceptRuleMgr

type InterceptRuleMgr interface {
	Program(netns string, redirect *Redirect) error
}

InterceptRuleMgr configures networking tables (e.g. iptables or nftables) for redirecting traffic to an MSM proxy.

func IptablesInterceptRuleMgrCtor

func IptablesInterceptRuleMgrCtor() InterceptRuleMgr

Constructor for iptables InterceptRuleMgr

type InterceptRuleMgrCtor

type InterceptRuleMgrCtor func() InterceptRuleMgr

func GetInterceptRuleMgrCtor

func GetInterceptRuleMgrCtor(interceptType string) InterceptRuleMgrCtor

Constructor factory for known types of InterceptRuleMgr's

type Kubernetes

type Kubernetes struct {
	K8sAPIRoot           string   `json:"kubernetesAPIRoot"`
	KubeConfig           string   `json:"kubeConfig"`
	InterceptRuleMgrType string   `json:"interceptName"`
	NodeName             string   `json:"nodeName"`
	ExcludeNamespaces    []string `json:"excludeNamespaces"`
	CNIBinDir            string   `json:"cniBinDir"`
}

Kubernetes a K8s specific struct to hold config

type KubernetesArgs

type KubernetesArgs struct {
	types.CommonArgs
	IP                         net.IP
	K8S_POD_NAME               types.UnmarshallableString
	K8S_POD_NAMESPACE          types.UnmarshallableString
	K8S_POD_INFRA_CONTAINER_ID types.UnmarshallableString
}

KubernetesArgs is the valid CNI_ARGS used for Kubernetes The field names need to match exact keys in kubelet args for unmarshalling

type PluginConf

type PluginConf struct {
	types.NetConf           // You may wish to not nest this type
	RuntimeConfig *struct{} `json:"runtimeConfig"`

	// Previous result, when called in the context of a chained plugin.
	RawPrevResult *map[string]interface{} `json:"prevResult"`
	PrevResult    *current.Result         `json:"-"`

	// Plugin-specific flags
	LogLevel   string     `json:"logLevel"`
	Kubernetes Kubernetes `json:"kubernetes"`
}

PluginConf is the expected json configuration passed in on stdin.

type PodInfo

type PodInfo struct {
	Containers        []string
	InitContainers    map[string]struct{}
	Labels            map[string]string
	Annotations       map[string]string
	ProxyEnvironments map[string]string
}

PodInfo holds the information of a Kubernetes pod

type Redirect

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

Redirect is the msm-cni redirect object

func NewRedirect

func NewRedirect(_ *PodInfo) (*Redirect, error)

NewRedirect returns a new Redirect Object constructed from a list of ports and annotations For now we are using some default values but that can change in the future to support passing values through annotations

Jump to

Keyboard shortcuts

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