Documentation ¶
Index ¶
- func AddExtraRoute(flags *pflag.FlagSet, route *ExtraRouteInfo)
- func Complete(ctx context.Context, route *core.Route) error
- func Parse(r core.Route) ([]core.Server, error)
- func RemoveUselessInfo(u *unstructured.Unstructured)
- func Run(ctx context.Context, servers []core.Server) error
- type CloneOptions
- func (d *CloneOptions) AddRollbackFunc(f func() error)
- func (d *CloneOptions) Cleanup(workloads ...string) error
- func (d *CloneOptions) DoClone(ctx context.Context, kubeconfigJsonBytes []byte) error
- func (d *CloneOptions) GetFactory() cmdutil.Factory
- func (d *CloneOptions) GetSyncthingGUIAddr() string
- func (d *CloneOptions) InitClient(f cmdutil.Factory) (err error)
- func (d *CloneOptions) SetContext(ctx context.Context)
- func (d *CloneOptions) SyncDir(ctx context.Context, labels string) error
- 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) GetClusterID() string
- func (c *ConnectOptions) GetFactory() cmdutil.Factory
- func (c *ConnectOptions) GetIPFromContext(ctx context.Context) error
- func (c *ConnectOptions) GetLocalTunIP() (v4 string, v6 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) RentIP(ctx context.Context) (context.Context, error)
- func (c *ConnectOptions) Reset(ctx context.Context) error
- type Connects
- type ExtraRouteInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddExtraRoute ¶ added in v2.2.8
func AddExtraRoute(flags *pflag.FlagSet, route *ExtraRouteInfo)
func RemoveUselessInfo ¶
func RemoveUselessInfo(u *unstructured.Unstructured)
Types ¶
type CloneOptions ¶
type CloneOptions struct { Namespace string Headers map[string]string Workloads []string ExtraRouteInfo ExtraRouteInfo Engine config.Engine TargetKubeconfig string TargetNamespace string TargetContainer string TargetImage string TargetRegistry string IsChangeTargetRegistry bool TargetWorkloadNames map[string]string OriginKubeconfigPath string LocalDir string RemoteDir string // contains filtered or unexported fields }
func (*CloneOptions) AddRollbackFunc ¶ added in v2.2.9
func (d *CloneOptions) AddRollbackFunc(f func() error)
func (*CloneOptions) Cleanup ¶
func (d *CloneOptions) Cleanup(workloads ...string) error
func (*CloneOptions) DoClone ¶
func (d *CloneOptions) DoClone(ctx context.Context, kubeconfigJsonBytes []byte) 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) GetFactory ¶ added in v2.2.8
func (d *CloneOptions) GetFactory() cmdutil.Factory
func (*CloneOptions) GetSyncthingGUIAddr ¶ added in v2.2.11
func (d *CloneOptions) GetSyncthingGUIAddr() string
func (*CloneOptions) InitClient ¶
func (d *CloneOptions) InitClient(f cmdutil.Factory) (err error)
func (*CloneOptions) SetContext ¶ added in v2.2.11
func (d *CloneOptions) SetContext(ctx context.Context)
type ConnectOptions ¶
type ConnectOptions struct { Namespace string Headers map[string]string PortMap []string Workloads []string ExtraRouteInfo ExtraRouteInfo 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) GetClusterID ¶ added in v2.2.7
func (c *ConnectOptions) GetClusterID() string
func (*ConnectOptions) GetFactory ¶
func (c *ConnectOptions) GetFactory() cmdutil.Factory
func (*ConnectOptions) GetIPFromContext ¶ added in v2.2.15
func (c *ConnectOptions) GetIPFromContext(ctx context.Context) error
func (*ConnectOptions) GetLocalTunIP ¶ added in v2.2.9
func (c *ConnectOptions) GetLocalTunIP() (v4 string, v6 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
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 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