Documentation ¶
Index ¶
- func ExecCommand(name string, arg ...string) error
- func ExecCommandGetOutput(name string, arg ...string) (string, error)
- func ExecCommandInDirectory(name, dir string, arg ...string) (err error)
- func GetClient() (client dynamic.Interface, clientSet *kubernetes.Clientset, err error)
- func GetClientset(ctx context.Context) (clientset *kubernetes.Clientset)
- func GetDynamicClient(ctx context.Context) (client dynamic.Interface)
- func GetKubeShpereDeployment() []string
- func GetNightlyTag(date string) (dateStr, tag string)
- func GetPluginAbleComponents() []string
- func GetRestClient(ctx context.Context) (client *rest.RESTClient)
- func NoFileCompletion(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective)
- func PortIsFree(port int) bool
- func UpdateWithEditor(resource schema.GroupVersionResource, ns, name string, ...) (err error)
- type Authentication
- type ClientFactory
- type CompletionFunc
- type ComponentStatus
- type FreePort
- type KSInstaller
- type KSInstallerSpec
- type Multicluster
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecCommandGetOutput ¶ added in v0.0.54
ExecCommandGetOutput run command and get output
func ExecCommandInDirectory ¶ added in v0.0.62
ExecCommandInDirectory runs a command in a particular directory
func GetClient ¶
func GetClient() (client dynamic.Interface, clientSet *kubernetes.Clientset, err error)
GetClient returns the k8s client
func GetClientset ¶ added in v0.0.50
func GetClientset(ctx context.Context) (clientset *kubernetes.Clientset)
GetClientset gets the clientset of k8s
func GetDynamicClient ¶ added in v0.0.50
GetDynamicClient gets the dynamic k8s client from context
func GetKubeShpereDeployment ¶
func GetKubeShpereDeployment() []string
GetKubeShpereDeployment returns the deployment of KubeSphere
func GetNightlyTag ¶
GetNightlyTag parse the nightly tag
func GetPluginAbleComponents ¶
func GetPluginAbleComponents() []string
GetPluginAbleComponents returns the component list which can plug-in or plug-out
func GetRestClient ¶ added in v0.0.51
func GetRestClient(ctx context.Context) (client *rest.RESTClient)
GetRestClient returns the restClient of the Kubernetes
func NoFileCompletion ¶
NoFileCompletion avoid completion with files
func UpdateWithEditor ¶
func UpdateWithEditor(resource schema.GroupVersionResource, ns, name string, client dynamic.Interface) (err error)
UpdateWithEditor update the k8s resources with a editor
Types ¶
type Authentication ¶ added in v0.0.48
type Authentication struct {
JwtSecret string `yaml:"jwtSecret"`
}
Authentication represents the Authentication of KubeSphere
type ClientFactory ¶ added in v0.0.50
type ClientFactory struct {
// contains filtered or unexported fields
}
ClientFactory is for getting k8s client
func (*ClientFactory) GetClient ¶ added in v0.0.50
func (c *ClientFactory) GetClient() (client dynamic.Interface, clientSet *kubernetes.Clientset, restClient *rest.RESTClient)
GetClient returns k8s client
func (*ClientFactory) SetContext ¶ added in v0.0.50
func (c *ClientFactory) SetContext(ctx string)
SetContext sets the k8s context
type CompletionFunc ¶
type CompletionFunc func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
CompletionFunc is the function for command completion
func ArrayCompletion ¶
func ArrayCompletion(array ...string) CompletionFunc
ArrayCompletion return a completion which base on an array
func KubeSphereDeploymentCompletion ¶
func KubeSphereDeploymentCompletion() CompletionFunc
KubeSphereDeploymentCompletion returns a completion function for KuebSphere deployments
func PluginAbleComponentsCompletion ¶
func PluginAbleComponentsCompletion() CompletionFunc
PluginAbleComponentsCompletion returns a completion function for pluginAble components
type ComponentStatus ¶
type ComponentStatus struct {
Enabled bool
}
ComponentStatus is a common status
type FreePort ¶
type FreePort struct {
// contains filtered or unexported fields
}
FreePort is the tool to find free ports of KubeSphere
func NewFreePort ¶ added in v0.0.62
NewFreePort creates a FreePort with a specific extra count of ports
func (*FreePort) FindFreePortsOfKubeSphere ¶
FindFreePortsOfKubeSphere returns the free ports of KubeSphere The order of the ports is: console, jenkins
type KSInstaller ¶
type KSInstaller struct {
Spec KSInstallerSpec `yaml:"spec"`
}
KSInstaller is the installer for KubeSphere
type KSInstallerSpec ¶
type KSInstallerSpec struct { Version string ImageNamespace string Authentication Authentication `yaml:"authentication"` Servicemesh ComponentStatus Openpitrix ComponentStatus Notification ComponentStatus NetworkPolicy ComponentStatus MetricsServer ComponentStatus Logging ComponentStatus Events ComponentStatus DevOps ComponentStatus Auditing ComponentStatus Alerting ComponentStatus Multicluster Multicluster `yaml:"multicluster"` }
KSInstallerSpec is ks-installer
type Multicluster ¶
type Multicluster struct {
ClusterRole string `yaml:"clusterRole"`
}
Multicluster represents multi-cluster