handler

package
v1.1.33 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: MIT Imports: 83 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 Complete added in v1.1.21

func Complete(route *core.Route) error

func Final added in v1.1.21

func Final() error

func InjectVPNAndEnvoySidecar

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

InjectVPNAndEnvoySidecar 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 Parse added in v1.1.32

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

func RemoveUselessInfo added in v1.1.27

func RemoveUselessInfo(u *unstructured.Unstructured)

func Rollback added in v1.1.18

func Rollback(f cmdutil.Factory, ns, workload string)

func Run added in v1.1.32

func Run(ctx context.Context, servers []core.Server) error

func SshJump added in v1.1.24

func SshJump(conf *util.SshConfig, flags *pflag.FlagSet) (err 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
	ExtraCIDR   []string
	ExtraDomain []string
	UseLocalDNS bool
	// contains filtered or unexported fields
}

func (*ConnectOptions) DoConnect

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

func (ConnectOptions) GetClientset added in v1.1.29

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

func (*ConnectOptions) GetKubeconfigPath added in v1.1.29

func (c *ConnectOptions) GetKubeconfigPath() (string, 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() error

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(ctx context.Context) error

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

func (*ConnectOptions) UpdateImage added in v1.1.29

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

update to newer image

type DHCPManager

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

func NewDHCPManager

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

func (*DHCPManager) Get

func (d *DHCPManager) Get(ctx2 context.Context, key string) (string, error)

func (*DHCPManager) ReleaseIP added in v1.1.30

func (d *DHCPManager) ReleaseIP(ctx context.Context, ips ...net.IP) error

func (*DHCPManager) RentIPBaseNICAddress

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

func (*DHCPManager) RentIPRandom

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

func (*DHCPManager) Set

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

type DuplicateOptions added in v1.1.27

type DuplicateOptions struct {
	Namespace   string
	Headers     map[string]string
	Workloads   []string
	ExtraCIDR   []string
	ExtraDomain []string

	TargetKubeconfig       string
	TargetNamespace        string
	TargetContainer        string
	TargetImage            string
	TargetRegistry         string
	IsChangeTargetRegistry bool
	// contains filtered or unexported fields
}

func (*DuplicateOptions) DoDuplicate added in v1.1.27

func (d *DuplicateOptions) DoDuplicate(ctx context.Context) error

DoDuplicate

* 1) download mount path use empty-dir but skip empty-dir in init-containers * 2) get env from containers * 3) create serviceAccount as needed * 4) modify podTempSpec inject kubevpn container

func (*DuplicateOptions) InitClient added in v1.1.27

func (d *DuplicateOptions) InitClient(f cmdutil.Factory) (err error)

type P

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

Jump to

Keyboard shortcuts

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