Documentation
¶
Index ¶
- Variables
- func Cleanup(s os.Signal)
- func CleanupUselessInfo(pod *v1.Pod)
- func CreateOutboundPod(ctx context.Context, factory cmdutil.Factory, clientset *kubernetes.Clientset, ...) (ip net.IP, err error)
- func InjectVPNAndEnvoySidecar(ctx1 context.Context, factory cmdutil.Factory, ...) error
- func InjectVPNSidecar(ctx1 context.Context, factory cmdutil.Factory, namespace, workloads string, ...) error
- func Start(ctx context.Context, r Route) error
- func UnPatchContainer(factory cmdutil.Factory, mapInterface v12.ConfigMapInterface, ...) error
- type ConnectOptions
- func (c *ConnectOptions) DoConnect() (err error)
- func (c *ConnectOptions) GetCIDR(ctx context.Context) (err error)
- func (c *ConnectOptions) GetRunningPodList() ([]v1.Pod, error)
- func (c *ConnectOptions) InitClient(f cmdutil.Factory) (err error)
- func (c *ConnectOptions) PreCheckResource()
- func (c *ConnectOptions) Reset(ctx2 context.Context) error
- type DHCPManager
- func (d *DHCPManager) Get(key string) (string, error)
- func (d *DHCPManager) InitDHCP(ctx context.Context) error
- func (d *DHCPManager) ReleaseIpToDHCP(ips ...*net.IPNet) error
- func (d *DHCPManager) RentIPBaseNICAddress() (*net.IPNet, error)
- func (d *DHCPManager) RentIPRandom() (*net.IPNet, error)
- func (d *DHCPManager) Set(key, value string) error
- type P
- type Route
Constants ¶
This section is empty.
Variables ¶
var RollbackFuncList = make([]func(), 2)
Functions ¶
func CleanupUselessInfo ¶
func CreateOutboundPod ¶
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 UnPatchContainer ¶
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) GetCIDR ¶
func (c *ConnectOptions) GetCIDR(ctx context.Context) (err error)
GetCIDR 1: get pod cidr 2: get service cidr todo optimize code should distinguish service cidr and pod cidr https://stackoverflow.com/questions/45903123/kubernetes-set-service-cidr-and-pod-cidr-the-same https://stackoverflow.com/questions/44190607/how-do-you-find-the-cluster-service-cidr-of-a-kubernetes-cluster/54183373#54183373 https://stackoverflow.com/questions/44190607/how-do-you-find-the-cluster-service-cidr-of-a-kubernetes-cluster
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
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) 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