Documentation
¶
Index ¶
- func CleanupUselessInfo(pod *v1.Pod)
- func Complete(ctx context.Context, route *core.Route) error
- func CreateAfterDeletePod(factory cmdutil.Factory, p *v1.Pod, helper *pkgresource.Helper) error
- func InjectVPNAndEnvoySidecar(ctx1 context.Context, factory cmdutil.Factory, ...) (err error)
- func InjectVPNSidecar(ctx1 context.Context, factory cmdutil.Factory, namespace, workload string, ...) error
- func Parse(r core.Route) ([]core.Server, error)
- func RemoveUselessInfo(u *unstructured.Unstructured)
- func Rollback(f cmdutil.Factory, ns, workload string)
- func Run(ctx context.Context, servers []core.Server) error
- func UnPatchContainer(factory cmdutil.Factory, mapInterface v12.ConfigMapInterface, ...) error
- type CloneOptions
- type ConnectOptions
- func (c *ConnectOptions) AddRolloutFunc(f func() error)
- func (c *ConnectOptions) Cleanup()
- func (c *ConnectOptions) CleanupLocalContainer(ctx context.Context) error
- func (c *ConnectOptions) Context() context.Context
- func (c *ConnectOptions) CreateRemoteInboundPod(ctx context.Context) (err error)
- func (c *ConnectOptions) DoConnect(ctx context.Context, isLite bool) (err error)
- func (c *ConnectOptions) Equal(a *ConnectOptions) bool
- func (c *ConnectOptions) GetClientset() *kubernetes.Clientset
- func (c *ConnectOptions) GetFactory() cmdutil.Factory
- func (c *ConnectOptions) GetKubeconfigCluster() string
- func (c *ConnectOptions) GetKubeconfigPath() (string, error)
- func (c *ConnectOptions) GetLocalTunIPv4() string
- func (c *ConnectOptions) GetRunningPodList(ctx context.Context) ([]v1.Pod, error)
- func (c *ConnectOptions) GetTunDeviceName() (string, error)
- func (c *ConnectOptions) InitClient(f cmdutil.Factory) (err error)
- func (c *ConnectOptions) InitDHCP(ctx context.Context) error
- func (c *ConnectOptions) LeaveProxyResources(ctx context.Context) (err error)
- func (c *ConnectOptions) PreCheckResource() error
- func (c *ConnectOptions) RentInnerIP(ctx context.Context) (context.Context, error)
- func (c *ConnectOptions) Reset(ctx context.Context) error
- func (c *ConnectOptions) UpdateImage(ctx context.Context) error
- type Connects
- type DHCPManager
- func (d *DHCPManager) ForEach(fn func(net.IP)) error
- func (d *DHCPManager) Get(ctx2 context.Context, key string) (string, error)
- func (d *DHCPManager) ReleaseIP(ctx context.Context, ips ...net.IP) error
- func (d *DHCPManager) RentIPBaseNICAddress(ctx context.Context) (*net.IPNet, *net.IPNet, error)
- func (d *DHCPManager) RentIPRandom(ctx context.Context) (*net.IPNet, *net.IPNet, error)
- func (d *DHCPManager) Set(key, value string) error
- type ExtraRouteInfo
- type P
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupUselessInfo ¶
func CreateAfterDeletePod ¶
func InjectVPNAndEnvoySidecar ¶
func InjectVPNAndEnvoySidecar(ctx1 context.Context, factory cmdutil.Factory, clientset v12.ConfigMapInterface, namespace, workload string, c util.PodRouteConfig, headers map[string]string, portMaps []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 RemoveUselessInfo ¶
func RemoveUselessInfo(u *unstructured.Unstructured)
func UnPatchContainer ¶
Types ¶
type CloneOptions ¶
type CloneOptions struct { Namespace string Headers map[string]string Workloads []string ExtraRouteInfo ExtraRouteInfo Engine config.Engine UseLocalDNS bool TargetKubeconfig string TargetNamespace string TargetContainer string TargetImage string TargetRegistry string IsChangeTargetRegistry bool // contains filtered or unexported fields }
func (*CloneOptions) Cleanup ¶
func (d *CloneOptions) Cleanup(workloads ...string) error
func (*CloneOptions) DoClone ¶
func (d *CloneOptions) DoClone(ctx context.Context) error
DoClone
* 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 (*CloneOptions) InitClient ¶
func (d *CloneOptions) InitClient(f cmdutil.Factory) (err error)
type ConnectOptions ¶
type ConnectOptions struct { Namespace string Headers map[string]string PortMap []string Workloads []string ExtraRouteInfo ExtraRouteInfo UseLocalDNS bool Engine config.Engine Foreground bool OriginKubeconfigPath string Lock *sync.Mutex // contains filtered or unexported fields }
func (*ConnectOptions) AddRolloutFunc ¶
func (c *ConnectOptions) AddRolloutFunc(f func() error)
func (*ConnectOptions) Cleanup ¶
func (c *ConnectOptions) Cleanup()
func (*ConnectOptions) CleanupLocalContainer ¶
func (c *ConnectOptions) CleanupLocalContainer(ctx context.Context) error
func (*ConnectOptions) Context ¶
func (c *ConnectOptions) Context() context.Context
func (*ConnectOptions) CreateRemoteInboundPod ¶
func (c *ConnectOptions) CreateRemoteInboundPod(ctx context.Context) (err error)
func (*ConnectOptions) DoConnect ¶
func (c *ConnectOptions) DoConnect(ctx context.Context, isLite bool) (err error)
func (*ConnectOptions) Equal ¶
func (c *ConnectOptions) Equal(a *ConnectOptions) bool
func (*ConnectOptions) GetClientset ¶
func (c *ConnectOptions) GetClientset() *kubernetes.Clientset
func (*ConnectOptions) GetFactory ¶
func (c *ConnectOptions) GetFactory() cmdutil.Factory
func (*ConnectOptions) GetKubeconfigCluster ¶
func (c *ConnectOptions) GetKubeconfigCluster() string
func (*ConnectOptions) GetKubeconfigPath ¶
func (c *ConnectOptions) GetKubeconfigPath() (string, error)
func (*ConnectOptions) GetLocalTunIPv4 ¶
func (c *ConnectOptions) GetLocalTunIPv4() string
func (*ConnectOptions) GetRunningPodList ¶
func (*ConnectOptions) GetTunDeviceName ¶
func (c *ConnectOptions) GetTunDeviceName() (string, error)
func (*ConnectOptions) InitClient ¶
func (c *ConnectOptions) InitClient(f cmdutil.Factory) (err error)
func (*ConnectOptions) LeaveProxyResources ¶
func (c *ConnectOptions) LeaveProxyResources(ctx context.Context) (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) RentInnerIP ¶
func (*ConnectOptions) Reset ¶
func (c *ConnectOptions) Reset(ctx context.Context) error
Reset 1) quit daemon 2) get all proxy-resources from configmap 3) cleanup all containers 4) cleanup hosts
func (*ConnectOptions) UpdateImage ¶
func (c *ConnectOptions) UpdateImage(ctx context.Context) error
update to newer image
type Connects ¶ added in v2.2.3
type Connects []*ConnectOptions
func (Connects) Append ¶ added in v2.2.3
func (s Connects) Append(options *ConnectOptions) Connects
func (Connects) Less ¶ added in v2.2.3
Less ... * assume: clusterA and clusterB in same VPC network, but only clusterA api-server have public ip, we need access clusterB via clusterA network. steps:
- connect to clusterA with options --extra-cidr or --extra-domain (which container clusterB api-server address)
- connect to clusterB
when we disconnect from all: first, we need to disconnect clusterB second, disconnect clusterA
type DHCPManager ¶
type DHCPManager struct {
// contains filtered or unexported fields
}
func NewDHCPManager ¶
func NewDHCPManager(client corev1.ConfigMapInterface, namespace string) *DHCPManager
func (*DHCPManager) RentIPBaseNICAddress ¶
func (*DHCPManager) RentIPRandom ¶
func (*DHCPManager) Set ¶
func (d *DHCPManager) Set(key, value string) error
type ExtraRouteInfo ¶ added in v2.2.3
func ParseExtraRouteFromRPC ¶ added in v2.2.3
func ParseExtraRouteFromRPC(route *rpc.ExtraRoute) *ExtraRouteInfo
func (ExtraRouteInfo) ToRPC ¶ added in v2.2.3
func (e ExtraRouteInfo) ToRPC() *rpc.ExtraRoute