pkg

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateInboundPod

func CreateInboundPod(
	ctx context.Context,
	factory cmdutil.Factory,
	clientset *kubernetes.Clientset,
	namespace,
	workloads,
	localTunIP,
	trafficManagerIP,
	shadowTunIP,
	routes string,
) error

CreateInboundPod 1, set replicset to 1 2, backup origin manifest to workloads annotation 3, patch a new sidecar

func DetectAndDisableConflictDevice

func DetectAndDisableConflictDevice(origin string) error

DetectAndDisableConflictDevice will detect conflict route table and try to disable device 1, get route table 2, detect conflict 3, disable device

func Start

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

Types

type ConnectOptions

type ConnectOptions struct {
	Ctx             context.Context `json:"-"`
	Uid             string
	KubeconfigPath  string
	KubeconfigBytes []byte
	Namespace       string
	Workloads       []string
	// contains filtered or unexported fields
}

func (*ConnectOptions) ConnectPingRemote

func (c *ConnectOptions) ConnectPingRemote() bool

func (*ConnectOptions) DoConnect

func (c *ConnectOptions) DoConnect(ctx context.Context) (chan error, error)

func (*ConnectOptions) DoReverse

func (c *ConnectOptions) DoReverse(ctx context.Context) error

func (*ConnectOptions) GenerateTunIP

func (c *ConnectOptions) GenerateTunIP(ctx context.Context) error

GenerateTunIP TODO optimize code, can use patch ?

func (*ConnectOptions) GetClientSet

func (c *ConnectOptions) GetClientSet() *kubernetes.Clientset

func (*ConnectOptions) GetLogger

func (c *ConnectOptions) GetLogger() *log.Logger

func (*ConnectOptions) GetUnstructuredObject

func (c *ConnectOptions) GetUnstructuredObject(workload string) (*resource.Info, error)

func (*ConnectOptions) InitClient

func (c *ConnectOptions) InitClient(ctx context.Context) (err error)

func (*ConnectOptions) InitDHCP

func (c *ConnectOptions) InitDHCP(ctx context.Context) error

func (*ConnectOptions) IsEmpty

func (c *ConnectOptions) IsEmpty() bool

func (*ConnectOptions) IsSameUid

func (c *ConnectOptions) IsSameUid(another *ConnectOptions) bool

func (*ConnectOptions) Prepare

func (c *ConnectOptions) Prepare(ctx context.Context) error

func (*ConnectOptions) ReleaseIP

func (c *ConnectOptions) ReleaseIP() error

func (*ConnectOptions) RemoveInboundPod

func (c *ConnectOptions) RemoveInboundPod() error

func (*ConnectOptions) RentIP

func (c *ConnectOptions) RentIP(random bool) (ip *net.IPNet, err error)

func (*ConnectOptions) ReverePingLocal

func (c *ConnectOptions) ReverePingLocal() bool

func (*ConnectOptions) SetLogger

func (c *ConnectOptions) SetLogger(logger *log.Logger)

func (*ConnectOptions) Shell

func (c *ConnectOptions) Shell(_ context.Context, workload string) (string, error)

func (*ConnectOptions) WaitTrafficManagerToAssignAnIP

func (c *ConnectOptions) WaitTrafficManagerToAssignAnIP(log *log.Logger) error

type Route

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

func (*Route) GenRouters

func (r *Route) GenRouters() ([]router, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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