Documentation
¶
Index ¶
- Constants
- func BuildRegisterSuccessExamples(t cluster.ClusterType) string
- func GetClientFromOptionsOrDie(factory cmdutil.Factory) versioned.Interface
- func GetCluster(clientSet versioned.Interface, ns, clusterName string) (*appsv1.Cluster, error)
- func MultipleSourceComponents(fileName string, in io.Reader) ([]byte, error)
- func NewCancelCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewClusterCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewConnectCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewCreateBackupCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewCreateCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewCreateRestoreCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewCustomOpsCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewDeleteBackupCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewDeleteCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewDeleteOpsCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewDescribeBackupCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewDescribeBackupPolicyCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewDescribeCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewDescribeOpsCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewDescribeReconfigureCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewEditBackupPolicyCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewEditConfigureCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewExplainReconfigureCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewExposeCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewLabelCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewListBackupCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewListBackupPolicyCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewListCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewListComponentsCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewListEventsCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewListInstancesCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewListLogsCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewListOpsCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewListRestoreCommand(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewLogsCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewPromoteCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewRebuildInstanceCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewReconfigureCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewRestartCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewRestoreDescribeCommand(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewScaleInCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewScaleOutCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewStartCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewStopCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewUpdateCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewUpgradeCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewUpgradeToV1Cmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewVerticalScalingCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewVolumeExpansionCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func RegisterClusterChart(f cmdutil.Factory, streams genericiooptions.IOStreams, ...) error
- type ConfigObjectsWrapper
- type ConnectOptions
- type CreateOptions
- type CreateSubCmdsOptions
- type CustomOperations
- type LabelOptions
- type ListLogsOptions
- type LogsOptions
- type OperationsOptions
- type ReconfigureContext
- type ReconfigureWrapper
- type UpdatableFlags
- type UpdateOptions
- type UpgradeToV1Options
- func (o *UpgradeToV1Options) Convert09ComponentDef(cluster *kbappsv1.Cluster, clusterV1alpha1Spec kbappsv1alpha1.ClusterSpec, ...) error
- func (o *UpgradeToV1Options) ConvertForClusterVersion(cluster *kbappsv1.Cluster, clusterV1alpha1Spec kbappsv1alpha1.ClusterSpec, ...) error
- func (o *UpgradeToV1Options) ConvertServiceVersion(compDef09 string, fromServiceVersion string) string
- func (o *UpgradeToV1Options) ConvertServices() error
- func (o *UpgradeToV1Options) GetConvertedCluster() (*kbappsv1.Cluster, *kbappsv1alpha1.Cluster, bool, error)
- func (o *UpgradeToV1Options) Run() error
Constants ¶
const (
ComponentStatusDefaultPodName = "Unknown"
)
Variables ¶
This section is empty.
Functions ¶
func BuildRegisterSuccessExamples ¶ added in v1.0.0
func BuildRegisterSuccessExamples(t cluster.ClusterType) string
BuildRegisterSuccessExamples builds the creation examples for the specified ClusterType type.
func GetClientFromOptionsOrDie ¶ added in v1.0.0
func GetCluster ¶ added in v1.0.0
func MultipleSourceComponents ¶
MultipleSourceComponents gets component data from multiple source, such as stdin, URI and local file
func NewCancelCmd ¶
func NewClusterCmd ¶
NewClusterCmd creates the cluster command
func NewConnectCmd ¶
NewConnectCmd returns the cmd of connecting to a cluster
func NewCreateBackupCmd ¶
func NewCreateCmd ¶
func NewCreateRestoreCmd ¶
func NewCustomOpsCmd ¶ added in v0.7.2
func NewDeleteBackupCmd ¶
func NewDeleteCmd ¶
func NewDeleteOpsCmd ¶
func NewDescribeBackupCmd ¶
func NewDescribeCmd ¶
func NewDescribeOpsCmd ¶
func NewDescribeReconfigureCmd ¶
func NewDescribeReconfigureCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
NewDescribeReconfigureCmd shows details of history modifications or configuration file of reconfiguring operations
func NewEditBackupPolicyCmd ¶
func NewEditConfigureCmd ¶
NewEditConfigureCmd shows the difference between two configuration version.
func NewExplainReconfigureCmd ¶
NewExplainReconfigureCmd shows details of modifiable parameters.
func NewExposeCmd ¶
NewExposeCmd creates an expose command
func NewLabelCmd ¶
func NewListBackupCmd ¶
func NewListBackupPolicyCmd ¶
func NewListCmd ¶
func NewListComponentsCmd ¶
func NewListEventsCmd ¶
func NewListInstancesCmd ¶
func NewListLogsCmd ¶
func NewListOpsCmd ¶
func NewListRestoreCommand ¶ added in v1.0.0
func NewLogsCmd ¶
NewLogsCmd returns the logic of accessing cluster log file
func NewPromoteCmd ¶
NewPromoteCmd creates a promote command
func NewRebuildInstanceCmd ¶ added in v0.9.0
NewRebuildInstanceCmd creates a rebuildInstance command
func NewReconfigureCmd ¶
NewReconfigureCmd creates a Reconfiguring command
func NewRestartCmd ¶
NewRestartCmd creates a restart command
func NewRestoreDescribeCommand ¶ added in v1.0.0
func NewScaleInCmd ¶ added in v1.0.0
NewScaleInCmd creates a scale in command
func NewScaleOutCmd ¶ added in v1.0.0
func NewStartCmd ¶
NewStartCmd creates a start command
func NewStopCmd ¶
NewStopCmd creates a stop command
func NewUpdateCmd ¶
func NewUpgradeCmd ¶
NewUpgradeCmd creates an upgrade command
func NewUpgradeToV1Cmd ¶ added in v1.0.0
func NewVerticalScalingCmd ¶
NewVerticalScalingCmd creates a vertical scaling command
func NewVolumeExpansionCmd ¶
NewVolumeExpansionCmd creates a volume expanding command
func RegisterClusterChart ¶ added in v1.0.0
func RegisterClusterChart(f cmdutil.Factory, streams genericiooptions.IOStreams, source, engine, version, repo string) error
RegisterClusterChart a util function to register cluster chart used by addon install, upgrade and enable.
Types ¶
type ConfigObjectsWrapper ¶ added in v1.0.0
type ConfigObjectsWrapper struct {
// contains filtered or unexported fields
}
type ConnectOptions ¶
type ConnectOptions struct {
*action.ExecOptions
// contains filtered or unexported fields
}
func (*ConnectOptions) Complete ¶ added in v0.7.3
func (o *ConnectOptions) Complete() error
func (*ConnectOptions) Validate ¶ added in v0.7.3
func (o *ConnectOptions) Validate(args []string) error
type CreateOptions ¶
type CreateOptions struct {
Cmd *cobra.Command `json:"-"`
action.CreateOptions `json:"-"`
}
func NewCreateOptions ¶
func NewCreateOptions(f cmdutil.Factory, streams genericiooptions.IOStreams) *CreateOptions
type CreateSubCmdsOptions ¶ added in v0.7.2
type CreateSubCmdsOptions struct {
// ClusterType is the type of the cluster to create.
ClusterType cluster.ClusterType
// values is used to render the cluster helm ChartInfo.
Values map[string]interface{}
// ChartInfo is the cluster chart information, used to render the command flag
// and validate the values.
ChartInfo *cluster.ChartInfo
// Configuration and options for cluster affinity and tolerations
PodAntiAffinity string `json:"podAntiAffinity"`
// TopologyKeys if TopologyKeys is nil, add omitempty json tag, because CueLang can not covert null to list.
TopologyKeys []string `json:"topologyKeys,omitempty"`
NodeLabels map[string]string `json:"nodeLabels,omitempty"`
Tenancy string `json:"tenancy"`
TolerationsRaw []string `json:"-"`
Tolerations []corev1.Toleration
// SkipSchemaValidation is used to skip the schema validation of the helm chart.
SkipSchemaValidation bool `json:"-"`
*action.CreateOptions
}
func NewSubCmdsOptions ¶ added in v0.7.2
func NewSubCmdsOptions(createOptions *action.CreateOptions, t cluster.ClusterType) (*CreateSubCmdsOptions, error)
func (*CreateSubCmdsOptions) Complete ¶ added in v1.0.0
func (o *CreateSubCmdsOptions) Complete(cmd *cobra.Command) error
func (*CreateSubCmdsOptions) Run ¶ added in v0.7.2
func (o *CreateSubCmdsOptions) Run() error
func (*CreateSubCmdsOptions) Validate ¶ added in v1.0.0
func (o *CreateSubCmdsOptions) Validate() error
type CustomOperations ¶ added in v0.7.3
type CustomOperations struct {
*OperationsOptions
OpsDefinitionName string `json:"opsDefinitionName"`
Params []opsv1alpha1.Parameter `json:"params,omitempty"`
SchemaProperties *apiextensionsv1.JSONSchemaProps
}
type LabelOptions ¶
type LabelOptions struct {
Factory cmdutil.Factory
GVR schema.GroupVersionResource
genericiooptions.IOStreams
// contains filtered or unexported fields
}
func NewLabelOptions ¶
func NewLabelOptions(f cmdutil.Factory, streams genericiooptions.IOStreams, gvr schema.GroupVersionResource) *LabelOptions
type ListLogsOptions ¶
type ListLogsOptions struct {
genericiooptions.IOStreams
// contains filtered or unexported fields
}
ListLogsOptions declares the arguments accepted by the list-logs command
func (*ListLogsOptions) Complete ¶
func (o *ListLogsOptions) Complete(f cmdutil.Factory, args []string) error
func (*ListLogsOptions) Run ¶
func (o *ListLogsOptions) Run() error
func (*ListLogsOptions) Validate ¶
func (o *ListLogsOptions) Validate(args []string) error
type LogsOptions ¶
type LogsOptions struct {
*action.ExecOptions
// contains filtered or unexported fields
}
LogsOptions declares the arguments accepted by the logs command
type OperationsOptions ¶
type OperationsOptions struct {
action.CreateOptions `json:"-"`
HasComponentNamesFlag bool `json:"-"`
// AutoApprove when set true, skip the double check.
AutoApprove bool `json:"-"`
ComponentNames []string `json:"componentNames,omitempty"`
OpsRequestName string `json:"opsRequestName"`
InstanceTPLNames []string `json:"instanceTPLNames,omitempty"`
TTLSecondsAfterSucceed int `json:"ttlSecondsAfterSucceed"`
Force bool `json:"force"`
// OpsType operation type
OpsType opsv1alpha1.OpsType `json:"type"`
// OpsTypeLower lower OpsType
OpsTypeLower string `json:"typeLower"`
ComponentDefinitionName string `json:"componentDefinitionName"`
ServiceVersion string `json:"serviceVersion"`
// VerticalScaling options
CPU string `json:"cpu"`
Memory string `json:"memory"`
// HorizontalScaling options
Replicas string `json:"replicas"`
ScaleOut bool `json:"scaleOut"`
OfflineInstancesToOnline []string `json:"offlineInstancesToOnline,omitempty"`
OnlineInstancesToOffline []string `json:"onlineInstancesToOffline,omitempty"`
// Reconfiguring options
KeyValues map[string]*string `json:"keyValues"`
CfgTemplateName string `json:"cfgTemplateName"`
CfgFile string `json:"cfgFile"`
ForceRestart bool `json:"forceRestart"`
FileContent string `json:"fileContent"`
HasPatch bool `json:"hasPatch"`
// VolumeExpansion options.
// VCTNames VolumeClaimTemplate names
VCTNames []string `json:"vctNames,omitempty"`
Storage string `json:"storage"`
// Expose options
ExposeType string `json:"-"`
ExposeSubType string `json:"-"`
ExposeEnabled string `json:"exposeEnabled,omitempty"`
RoleSelector string `json:"roleSelector,omitempty"`
Services []opsv1alpha1.OpsService `json:"services,omitempty"`
// Switchover options
Component string `json:"component"`
ComponentObjectName string `json:"componentObjectName,omitempty"`
Instance string `json:"instance"`
Candidate string `json:"candidate"`
BackupName string `json:"-"`
Inplace bool `json:"-"`
InstanceNames []string `json:"-"`
Nodes []string `json:"-"`
RebuildInstanceFrom []opsv1alpha1.RebuildInstance `json:"rebuildInstanceFrom,omitempty"`
Env []string `json:"-"`
SourceBackupTargetName string `json:"-"`
// contains filtered or unexported fields
}
func (*OperationsOptions) CompleteComponentsFlag ¶
func (o *OperationsOptions) CompleteComponentsFlag() error
CompleteComponentsFlag when components flag is null and the cluster only has one component, auto complete it.
func (*OperationsOptions) CompleteRestartOps ¶
func (o *OperationsOptions) CompleteRestartOps() error
CompleteRestartOps restarts all components of the cluster we should set all component names to ComponentNames flag.
func (*OperationsOptions) Validate ¶
func (o *OperationsOptions) Validate() error
Validate command flags or args is legal
type ReconfigureContext ¶ added in v1.0.0
type ReconfigureContext struct {
Client versioned.Interface
Context context.Context
Cluster *kbappsv1.Cluster
Cmpd *kbappsv1.ComponentDefinition
ConfigRender *parametersv1alpha1.ParamConfigRenderer
ParametersDefs []*parametersv1alpha1.ParametersDefinition
CompName string
}
type ReconfigureWrapper ¶ added in v1.0.0
type ReconfigureWrapper struct {
// contains filtered or unexported fields
}
func (*ReconfigureWrapper) ComponentName ¶ added in v1.0.0
func (w *ReconfigureWrapper) ComponentName() string
func (*ReconfigureWrapper) ConfigFile ¶ added in v1.0.0
func (w *ReconfigureWrapper) ConfigFile() string
func (*ReconfigureWrapper) ConfigSpecName ¶ added in v1.0.0
func (w *ReconfigureWrapper) ConfigSpecName() string
type UpdatableFlags ¶
type UpdatableFlags struct {
// Options for cluster termination policy
TerminationPolicy string `json:"terminationPolicy"`
// Add-on switches for cluster observability
DisableExporter bool `json:"monitor"`
// Configuration and options for cluster affinity and tolerations
PodAntiAffinity string `json:"podAntiAffinity"`
RuntimeClassName string `json:"runtimeClassName,omitempty"`
// TopologyKeys if TopologyKeys is nil, add omitempty json tag, because CueLang can not covert null to list.
TopologyKeys []string `json:"topologyKeys,omitempty"`
NodeLabels map[string]string `json:"nodeLabels,omitempty"`
Tenancy string `json:"tenancy"`
TolerationsRaw []string `json:"-"`
// backup config
BackupEnabled bool `json:"-"`
BackupRetentionPeriod string `json:"-"`
BackupMethod string `json:"-"`
BackupCronExpression string `json:"-"`
BackupStartingDeadlineMinutes int64 `json:"-"`
BackupRepoName string `json:"-"`
BackupPITREnabled bool `json:"-"`
}
UpdatableFlags is the flags that cat be updated by update command
type UpdateOptions ¶ added in v0.7.2
type UpdateOptions struct {
ValMap map[string]interface{}
UpdatableFlags
*action.PatchOptions
// contains filtered or unexported fields
}
func NewUpdateOptions ¶ added in v0.7.2
func NewUpdateOptions(f cmdutil.Factory, streams genericiooptions.IOStreams) *UpdateOptions
func (*UpdateOptions) CmdComplete ¶ added in v0.7.2
func (o *UpdateOptions) CmdComplete(cmd *cobra.Command, args []string) error
func (*UpdateOptions) Complete ¶ added in v0.7.2
func (o *UpdateOptions) Complete() error
func (*UpdateOptions) Exec ¶ added in v0.7.2
func (o *UpdateOptions) Exec() error
func (*UpdateOptions) Validate ¶ added in v0.7.2
func (o *UpdateOptions) Validate() error
type UpgradeToV1Options ¶ added in v1.0.0
type UpgradeToV1Options struct {
Cmd *cobra.Command `json:"-"`
Client clientset.Interface
Dynamic dynamic.Interface
DryRun bool
NoDiff bool
Name string
Namespace string
genericiooptions.IOStreams
// contains filtered or unexported fields
}
func NewUpgradeToV1Option ¶ added in v1.0.0
func NewUpgradeToV1Option(f cmdutil.Factory, streams genericiooptions.IOStreams) *UpgradeToV1Options
func (*UpgradeToV1Options) Convert09ComponentDef ¶ added in v1.0.0
func (o *UpgradeToV1Options) Convert09ComponentDef(cluster *kbappsv1.Cluster, clusterV1alpha1Spec kbappsv1alpha1.ClusterSpec, existUnsupportedSpec *bool) error
func (*UpgradeToV1Options) ConvertForClusterVersion ¶ added in v1.0.0
func (o *UpgradeToV1Options) ConvertForClusterVersion(cluster *kbappsv1.Cluster, clusterV1alpha1Spec kbappsv1alpha1.ClusterSpec, existUnsupportedSpec *bool) error
func (*UpgradeToV1Options) ConvertServiceVersion ¶ added in v1.0.0
func (o *UpgradeToV1Options) ConvertServiceVersion(compDef09 string, fromServiceVersion string) string
func (*UpgradeToV1Options) ConvertServices ¶ added in v1.0.0
func (o *UpgradeToV1Options) ConvertServices() error
func (*UpgradeToV1Options) GetConvertedCluster ¶ added in v1.0.0
func (o *UpgradeToV1Options) GetConvertedCluster() (*kbappsv1.Cluster, *kbappsv1alpha1.Cluster, bool, error)
func (*UpgradeToV1Options) Run ¶ added in v1.0.0
func (o *UpgradeToV1Options) Run() error
Source Files
¶
- cluster.go
- config_edit.go
- config_observer.go
- config_ops.go
- config_resource.go
- config_util.go
- config_wrapper.go
- connect.go
- constant.go
- create.go
- create_subcmds.go
- create_util.go
- dataprotection.go
- delete.go
- delete_ops.go
- describe.go
- describe_ops.go
- errors.go
- label.go
- list.go
- list_logs.go
- list_ops.go
- logs.go
- operations.go
- register.go
- update.go
- upgrade_to_1.0.go