handler

package
v1.1.14 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2023 License: MIT Imports: 54 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RollbackFuncList = make([]func(), 2)

Functions

func Cleanup

func Cleanup(s os.Signal)

func CleanupUselessInfo

func CleanupUselessInfo(pod *v1.Pod)

func CreateOutboundPod

func CreateOutboundPod(ctx context.Context, factory cmdutil.Factory, clientset *kubernetes.Clientset, namespace string, trafficManagerIP string, nodeCIDR []*net.IPNet) (ip net.IP, err error)

func InjectVPNAndEnvoySidecar

func InjectVPNAndEnvoySidecar(ctx1 context.Context, factory cmdutil.Factory, clientset v12.ConfigMapInterface, namespace, workloads string, c util.PodRouteConfig, headers map[string]string) error

patch a sidecar, using iptables to do port-forward let this pod decide should go to 233.254.254.100 or request to 127.0.0.1

func InjectVPNSidecar

func InjectVPNSidecar(ctx1 context.Context, factory cmdutil.Factory, namespace, workloads string, config util.PodRouteConfig) error

func Start

func Start(ctx context.Context, r Route) error

func UnPatchContainer

func UnPatchContainer(factory cmdutil.Factory, mapInterface v12.ConfigMapInterface, namespace, workloads string, headers map[string]string) error

Types

type ConnectOptions

type ConnectOptions struct {
	Namespace string
	Headers   map[string]string
	Workloads []string
	// contains filtered or unexported fields
}

func (*ConnectOptions) DoConnect

func (c *ConnectOptions) DoConnect() (err error)

func (*ConnectOptions) GetRunningPodList

func (c *ConnectOptions) GetRunningPodList() ([]v1.Pod, error)

func (*ConnectOptions) InitClient

func (c *ConnectOptions) InitClient(f cmdutil.Factory) (err error)

func (*ConnectOptions) PreCheckResource

func (c *ConnectOptions) PreCheckResource()

PreCheckResource transform user parameter to normal, example: pod: productpage-7667dfcddb-cbsn5 replicast: productpage-7667dfcddb deployment: productpage transform: pod/productpage-7667dfcddb-cbsn5 --> deployment/productpage service/productpage --> deployment/productpage replicaset/productpage-7667dfcddb --> deployment/productpage

pods without controller pod/productpage-without-controller --> pod/productpage-without-controller service/productpage-without-pod --> controller/controllerName

func (*ConnectOptions) Reset added in v1.1.12

func (c *ConnectOptions) Reset(ctx2 context.Context) error

Reset 1, get all proxy-resources from configmap 2, cleanup all containers

type DHCPManager

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

func NewDHCPManager

func NewDHCPManager(client corev1.ConfigMapInterface, namespace string, cidr *net.IPNet) *DHCPManager

func (*DHCPManager) Get

func (d *DHCPManager) Get(key string) (string, error)

func (*DHCPManager) InitDHCP

func (d *DHCPManager) InitDHCP(ctx context.Context) error

todo optimize dhcp, using mac address, ip and deadline as unit

func (*DHCPManager) ReleaseIpToDHCP

func (d *DHCPManager) ReleaseIpToDHCP(ips ...*net.IPNet) error

func (*DHCPManager) RentIPBaseNICAddress

func (d *DHCPManager) RentIPBaseNICAddress() (*net.IPNet, error)

func (*DHCPManager) RentIPRandom

func (d *DHCPManager) RentIPRandom() (*net.IPNet, error)

func (*DHCPManager) Set

func (d *DHCPManager) Set(key, value string) error

type P

type P struct {
	Op    string      `json:"op,omitempty"`
	Path  string      `json:"path,omitempty"`
	Value interface{} `json:"value,omitempty"`
}

type Route

type Route struct {
	ServeNodes []string // -L tun
	ChainNode  string   // -F tcp
	Retries    int
}

func (*Route) GenerateServers

func (r *Route) GenerateServers() ([]core.Server, error)

Jump to

Keyboard shortcuts

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