diff --git a/README.md b/README.md index 46772f9a6..72ae1cea8 100755 --- a/README.md +++ b/README.md @@ -2,72 +2,98 @@ ## Overview -A command line tool to support developers of and with [Kyma](https://github.com/kyma-project/kyma) - -## Available Commands - -- `version`: Shows the Kyma cluster version and the Kyma CLI version -- `provision minikube`: Initializes minikube with a new cluster (replaces the `minikube.sh` script) -- `install`: Installs Kyma to a cluster based on a release (replaces the `ìnstaller.sh` and `is-installed.sh` script) -- `uninstall`: Uninstalls all Kyma related resources from a cluster -- `completion`: Outputs shell completion code for bash -- `test`: Triggers and reports the tests for every Kyma module -- `help`: Displays usage for the given command (e.g. `kyma help`, `kyma help status`, etc...) +Kyma CLI is a command line tool which supports [Kyma](https://github.com/kyma-project/kyma) developers. It provides a set of commands you can use to install and test Kyma. ## Prerequisites -In order to run the Kyma CLI you need the following software installed: +Kyma CLI requires the following software: - [kubectl](https://github.com/kubernetes/kubectl) -- [minikube](https://github.com/kubernetes/minikube) +- [Minikube](https://github.com/kubernetes/minikube) + +## Installation + +For the installation instructions, see the [release page](https://github.com/kyma-project/cli/releases). ## Usage -Installation of Kyma with minikube on Mac: +### Commands -```bash -kyma provision minikube -kyma install -``` +Kyma CLI comes with a set of commands: -Installation of Kyma with minikube on Windows: +- `version` shows the Kyma cluster version and the Kyma CLI version. +- `provision minikube` initializes Minikube on a new cluster. It replaces the `minikube.sh` script. +- `install` installs Kyma to a cluster based on the current release. It replaces the `ìnstaller.sh` and `is-installed.sh` script. +- `uninstall` uninstalls all Kyma-related resources from a cluster. +- `completion` generates and shows the bash completion script. +- `test` triggers and reports the tests for every Kyma module. +- `help` displays and explains the usage of a given command. -```bash -kyma provision minikube -# follow instructions to add hosts -kyma install -``` -Installation of Kyma with minikube on Windows using HyperV: +### Use Kyma CLI -```bash -kyma provision minikube --vm-driver hyperv --hypervVirtualSwitch {YOUR_SWITCH_NAME} -# follow instructions to add hosts -kyma install +Use the following syntax to run the commands from your terminal: + +``` +kyma {COMMAND} {FLAGS} ``` +where: + +* **{COMMAND}** specifies the operation you want to perform. +* **{FLAGS}** specify optional flags. For example, use `-v` or `--verbose` for additional information on performed operations. + +Example: -Run tests on Kyma installation: -```bash -kyma test ``` -## Installation +kyma install --verbose +``` + +Further usage examples include: + +* Install Kyma with Minikube on Mac: + + ```bash + kyma provision minikube + kyma install + ``` + +* Install Kyma with Minikube on Windows: + + ```bash + kyma provision minikube + # follow instructions to add hosts + kyma install + ``` + +* Install Kyma with Minikube on Windows using HyperV: + + ```bash + kyma provision minikube --vm-driver hyperv --hypervVirtualSwitch {YOUR_SWITCH_NAME} + # follow instructions to add hosts + kyma install + ``` + + * Run tests on Kyma: + ```bash + kyma test + ``` -For the latest release and installation instructions, see the [release page](https://github.com/kyma-project/cli/releases) +## Development -## Kyma CLI as a Kubectl plugin +### Kyma CLI as a kubectl plugin -To follow this section a kubectl version of 1.12.0 or later is required. +> **NOTE**: To use Kyma CLI as a kubectl plugin, use Kubernetes version 1.12.0 or higher. -A plugin is nothing more than a standalone executable file, whose name begins with kubectl- . To install a plugin, simply move this executable file to anywhere on your PATH. +A plugin is a standalone executable file with a name prefixed with `kubectl-` .To use the plugin, perform the following steps: -Rename a `kyma` binary to `kubectl-kyma` and place it anywhere in your PATH: +1. Rename the `kyma` binary to `kubectl-kyma` and place it anywhere in your **{PATH}**: ```bash sudo mv ./kyma /usr/local/bin/kubectl-kyma ``` -Run `kubectl plugin list` command and you will see your plugin in the list of available plugins. +2. Run `kubectl plugin list` command to see your plugin on the list of all available plugins. -You may now invoke your plugin as a kubectl command: +3. Invoke your plugin as a kubectl command: ```bash $ kubectl kyma version @@ -75,4 +101,4 @@ Kyma CLI version: v0.6.1 Kyma cluster version: 1.0.0 ``` -To know more about extending kubectl with plugins read [kubernetes documentation](https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/). +For more information on extending kubectl with plugins, read [Kubernetes documentation](https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/). diff --git a/internal/kubectl/kubectl.go b/internal/kubectl/kubectl.go index 457328efb..2da4c4bbc 100755 --- a/internal/kubectl/kubectl.go +++ b/internal/kubectl/kubectl.go @@ -62,7 +62,7 @@ func execCmd(cmd *exec.Cmd, inputText string, verbose bool) (string, error) { if verbose { fmt.Printf("\nExecuted command:\n kubectl %s\nwith output:\n %s\nand error:\n %s\n", inputText, string(out), err) } - return unquotedOut, fmt.Errorf("Failed executing kubectl command 'kubectl %s' with output '%s' and error message '%s'", inputText, out, err) + return unquotedOut, fmt.Errorf("Failed executing kubectl 'kubectl %s' command with output '%s' and error message '%s'", inputText, out, err) } if verbose { fmt.Printf("\nExecuted command:\n kubectl %s\nwith output:\n %s\n", inputText, string(out)) @@ -177,7 +177,7 @@ func IsPodReady(namespace string, labelName string, labelValue string, verbose b if containerStatus != "true" { events, err := RunCmd(verbose, "get", "event", "-n", namespace, "-o", "go-template='{{range .items}}{{if eq .involvedObject.name \"'"+pod+"'\"}}{{.message}}{{\"\\n\"}}{{end}}{{end}}'") if err != nil { - fmt.Printf("Error while checking for pod events '%s'\n‚", err) + fmt.Printf("Error occurred while searching for Pod Events '%s'\n‚", err) } if events != "" { fmt.Printf("Status '%s'", events) @@ -213,5 +213,5 @@ func CheckVersion(verbose bool) (string, error) { return "", nil } - return fmt.Sprintf("You are using an unsupported kubectl version '%s'. This may not work. It is recommended to use kubectl version '%s'", version, kubectlVersion), nil + return fmt.Sprintf("You are using an unsupported kubectl version '%s'. This may not work. The recommended kubectl version is '%s'", version, kubectlVersion), nil } diff --git a/internal/minikube/minikube.go b/internal/minikube/minikube.go index 3775b058c..856700757 100755 --- a/internal/minikube/minikube.go +++ b/internal/minikube/minikube.go @@ -25,7 +25,7 @@ func RunCmd(verbose bool, args ...string) (string, error) { if verbose { fmt.Printf("\nExecuted command:\n minikube %s\nwith output:\n %s\nand error:\n %s\n", strings.Join(args, " "), string(out), err) } - return unquotedOut, fmt.Errorf("Failed executing command 'minikube %s' with output '%s' and error message '%s'", strings.Join(args, " "), out, err) + return unquotedOut, fmt.Errorf("Failed executing the 'minikube %s' command with output '%s' and error message '%s'", strings.Join(args, " "), out, err) } if verbose { fmt.Printf("\nExecuted command:\n minikube %s\nwith output:\n %s\n", strings.Join(args, " "), string(out)) @@ -57,7 +57,7 @@ func CheckVersion(verbose bool) (string, error) { if check { return "", nil } - return fmt.Sprintf("You are using an unsupported minikube version '%s'. This may not work. It is recommended to use minikube version '%s'", version, minikubeVersion), nil + return fmt.Sprintf("You are using an unsupported Minikube version '%s'. This may not work. The recommended Minikube version is '%s'", version, minikubeVersion), nil } //DockerClient creates a docker client based on minikube "docker-env" configuration diff --git a/pkg/kyma/cmd/install/cmd.go b/pkg/kyma/cmd/install/cmd.go index 1fd3bef28..379b89feb 100644 --- a/pkg/kyma/cmd/install/cmd.go +++ b/pkg/kyma/cmd/install/cmd.go @@ -64,31 +64,31 @@ func NewCmd(o *Options) *cobra.Command { cobraCmd := &cobra.Command{ Use: "install", - Short: "Installs Kyma to a running kubernetes cluster", - Long: `Install Kyma on a running kubernetes cluster. - -Assure that your KUBECONFIG is pointing to the target cluster already. -The command will: -- Install tiller -- Install the Kyma installer -- Configures the Kyma installer with the latest minimal configuration -- Triggers the installation + Short: "Installs Kyma on a running Kubernetes cluster", + Long: `Install Kyma on a running Kubernetes cluster. + +Make sure that your KUBECONFIG is already pointing to the target cluster. +The command: +- Installs Tiller +- Deploys the Kyma Installer +- Configures the Kyma Installer using the latest minimal configuration +- Triggers Kyma installation `, RunE: func(_ *cobra.Command, _ []string) error { return cmd.Run() }, Aliases: []string{"i"}, } - cobraCmd.Flags().StringVarP(&o.ReleaseVersion, "release", "r", "1.1.0", "kyma release to use") - cobraCmd.Flags().StringVarP(&o.ReleaseConfig, "config", "c", "", "URL or path to the installer configuration yaml") - cobraCmd.Flags().BoolVarP(&o.NoWait, "noWait", "n", false, "Do not wait for completion of kyma-installer") - cobraCmd.Flags().StringVarP(&o.Domain, "domain", "d", "kyma.local", "domain to use for installation") + cobraCmd.Flags().StringVarP(&o.ReleaseVersion, "release", "r", "1.1.0", "Kyma release to use") + cobraCmd.Flags().StringVarP(&o.ReleaseConfig, "config", "c", "", "URL or path to the Installer configuration YAML file") + cobraCmd.Flags().BoolVarP(&o.NoWait, "noWait", "n", false, "Do not wait for the Installer configuration to complete") + cobraCmd.Flags().StringVarP(&o.Domain, "domain", "d", "kyma.local", "Domain used for installation") cobraCmd.Flags().BoolVarP(&o.Local, "local", "l", false, "Install from sources") - cobraCmd.Flags().StringVarP(&o.LocalSrcPath, "src-path", "", "", "Path to local sources to use") - cobraCmd.Flags().StringVarP(&o.LocalInstallerVersion, "installer-version", "", "", "Version of installer docker image to use while building locally") - cobraCmd.Flags().StringVarP(&o.LocalInstallerDir, "installer-dir", "", "", "Directory of installer docker image to use while building locally") - cobraCmd.Flags().DurationVarP(&o.Timeout, "timeout", "", 0, "Timeout after which CLI should give up watching installation") - cobraCmd.Flags().StringVarP(&o.Password, "password", "p", "", "Pre-defined cluster password") - cobraCmd.Flags().VarP(&o.OverrideConfigs, "override", "o", "Path to YAML file with parameters to override. Multiple entries of this flag allowed") + cobraCmd.Flags().StringVarP(&o.LocalSrcPath, "src-path", "", "", "Path to local sources") + cobraCmd.Flags().StringVarP(&o.LocalInstallerVersion, "installer-version", "", "", "Version of the Kyma Installer Docker image used for local installation") + cobraCmd.Flags().StringVarP(&o.LocalInstallerDir, "installer-dir", "", "", "The directory of the Kyma Installer Docker image used for local installation") + cobraCmd.Flags().DurationVarP(&o.Timeout, "timeout", "", 0, "Timeout after which CLI stops watching the installation progress") + cobraCmd.Flags().StringVarP(&o.Password, "password", "p", "", "Predefined cluster password") + cobraCmd.Flags().VarP(&o.OverrideConfigs, "override", "o", "Path to YAML file with parameters to override. Multiple entries of this flag are allowed") return cobraCmd } @@ -106,7 +106,7 @@ func (cmd *command) Run() error { s.Failure() return err } - s.Successf("Requirements are fine") + s.Successf("Requirements verified") if cmd.opts.Local { s.LogInfof("Installing Kyma from local path: '%s'", cmd.opts.LocalSrcPath) @@ -122,13 +122,13 @@ func (cmd *command) Run() error { } s.Successf("Tiller installed") - s = cmd.NewStep("Installing kyma-installer") + s = cmd.NewStep("Deploying Kyma Installer") err = cmd.installInstaller() if err != nil { s.Failure() return err } - s.Successf("kyma-installer installed") + s.Successf("Kyma Installer deployed") s = cmd.NewStep("Configuring Helm") err = cmd.configureHelm() @@ -138,13 +138,13 @@ func (cmd *command) Run() error { } s.Successf("Helm configured") - s = cmd.NewStep("Requesting kyma-installer to install kyma") + s = cmd.NewStep("Requesting Kyma Installer to install Kyma") err = cmd.activateInstaller() if err != nil { s.Failure() return err } - s.Successf("kyma-installer is installing kyma") + s.Successf("Kyma Installer is installing Kyma") if !cmd.opts.NoWait { err = cmd.waitForInstaller() @@ -178,15 +178,15 @@ func (cmd *command) validateFlags() error { if cmd.opts.LocalSrcPath == "" { goPath := os.Getenv("GOPATH") if goPath == "" { - return fmt.Errorf("No local 'src-path' configured and no applicable default found, verify if you have exported a GOPATH?") + return fmt.Errorf("No local 'src-path' configured and no applicable default found. Check if you exported a GOPATH.") } cmd.opts.LocalSrcPath = filepath.Join(goPath, "src", "github.com", "kyma-project", "kyma") } if _, err := os.Stat(cmd.opts.LocalSrcPath); err != nil { - return fmt.Errorf("Configured 'src-path=%s' does not exist, please check if you configured a valid path", cmd.opts.LocalSrcPath) + return fmt.Errorf("Configured 'src-path=%s' does not exist. Check if you configured a valid path.", cmd.opts.LocalSrcPath) } if _, err := os.Stat(filepath.Join(cmd.opts.LocalSrcPath, "installation", "resources")); err != nil { - return fmt.Errorf("Configured 'src-path=%s' seems to not point to a Kyma repository, please verify if your repository contains a folder 'installation/resources'", cmd.opts.LocalSrcPath) + return fmt.Errorf("Configured 'src-path=%s' does not seem to point to a Kyma repository. Check if your repository contains the 'installation/resources' folder.", cmd.opts.LocalSrcPath) } // This is to help developer and use appropriate repository if PR image is provided @@ -250,7 +250,7 @@ func (cmd *command) configureHelm() error { data, ok := cfg["data"].(map[interface{}]interface{}) if !ok { - return fmt.Errorf("unable to get data from helm secret") + return fmt.Errorf("Unable to get data from the Helm Secret") } err = writeHelmFile(data, "global.helm.ca.crt", helmHome, "ca.pem") @@ -274,7 +274,7 @@ func (cmd *command) configureHelm() error { func writeHelmFile(data map[interface{}]interface{}, helmData string, helmHome string, filename string) error { value, ok := data[helmData].(string) if !ok { - return fmt.Errorf("unable to get %s from helm secret data", helmData) + return fmt.Errorf("Unable to get %s from Helm Secret data", helmData) } valueDecoded, err := base64.StdEncoding.DecodeString(value) if err != nil { @@ -515,12 +515,12 @@ func (cmd *command) applyOverrideFiles() error { for _, file := range cmd.opts.OverrideConfigs { oFile, err := os.Open(file) if err != nil { - return fmt.Errorf("unable to open file: %s. Error: %s", + return fmt.Errorf("Unable to open file: %s. Error: %s", file, err.Error()) } rawData, err := ioutil.ReadAll(oFile) if err != nil { - return fmt.Errorf("unable to read data from file: %s. Error: %s", + return fmt.Errorf("Unable to read data from file: %s. Error: %s", file, err.Error()) } @@ -530,28 +530,28 @@ func (cmd *command) applyOverrideFiles() error { cfg := make(map[interface{}]interface{}) err = yaml.Unmarshal([]byte(c), &cfg) if err != nil { - return fmt.Errorf("unable to parse file data: %s. Error: %s", + return fmt.Errorf("Unable to parse file data: %s. Error: %s", file, err.Error()) } kind, ok := cfg["kind"].(string) if !ok { - return fmt.Errorf("unable get kind of config. File: %s", file) + return fmt.Errorf("Unable to retrieve the kind of config. File: %s", file) } meta, ok := cfg["metadata"].(map[interface{}]interface{}) if !ok { - return fmt.Errorf("unable to get metadata from config. File: %s", file) + return fmt.Errorf("Unable to get metadata from config. File: %s", file) } namespace, ok := meta["namespace"].(string) if !ok { - return fmt.Errorf("unable to get namespace from config. File: %s", file) + return fmt.Errorf("Unable to get Namespace from config. File: %s", file) } name, ok := meta["name"].(string) if !ok { - return fmt.Errorf("unable to get name from config. File: %s", file) + return fmt.Errorf("Unable to get name from config. File: %s", file) } _, err := cmd.Kubectl().RunCmd("-n", @@ -562,7 +562,7 @@ func (cmd *command) applyOverrideFiles() error { "-p", c) if err != nil { - return fmt.Errorf("unable to override values. File: %s. Error: %s", file, err.Error()) + return fmt.Errorf("Unable to override values. File: %s. Error: %s", file, err.Error()) } } @@ -619,7 +619,7 @@ func (cmd *command) printSummary() error { fmt.Printf("Kyma console: https://console.%s\n", cmd.opts.Domain) fmt.Printf("Kyma admin email: %s\n", emailDecoded) if cmd.opts.Password == "" || cmd.opts.NonInteractive { - fmt.Printf("Kyma admin pwd: %s\n", pwdDecoded) + fmt.Printf("Kyma admin password: %s\n", pwdDecoded) } fmt.Println() fmt.Println("Happy Kyma-ing! :)") @@ -651,7 +651,7 @@ func (cmd *command) waitForInstaller() error { case <-timeout: cmd.CurrentStep.Failure() _ = cmd.printInstallationErrorLog() - return errors.New("Timeout while awaiting installation to complete") + return errors.New("Timeout reached while waiting for installation to complete") default: status, desc, err := cmd.getInstallationStatus() if err != nil { @@ -666,8 +666,8 @@ func (cmd *command) waitForInstaller() error { case "Error": if !errorOccured { errorOccured = true - cmd.CurrentStep.Failuref("Error installing Kyma: %s", desc) - cmd.CurrentStep.LogInfof("To fetch the logs from the installer execute: 'kubectl logs -n kyma-installer -l name=kyma-installer'") + cmd.CurrentStep.Failuref("Kyma installation failed: %s", desc) + cmd.CurrentStep.LogInfof("To fetch the logs from the installer, run: 'kubectl logs -n kyma-installer -l name=kyma-installer'") } case "InProgress": diff --git a/pkg/kyma/cmd/provision/minikube/cmd.go b/pkg/kyma/cmd/provision/minikube/cmd.go index d790db4f1..4e6bb8e37 100755 --- a/pkg/kyma/cmd/provision/minikube/cmd.go +++ b/pkg/kyma/cmd/provision/minikube/cmd.go @@ -79,15 +79,15 @@ func NewOptions(o *core.Options) *MinikubeOptions { func NewCmd(o *MinikubeOptions) *cobra.Command { cmd := &cobra.Command{ Use: "minikube", - Short: "Provisions minikube", - Long: `Provisions minikube for Kyma installation`, + Short: "Provisions Minikube", + Long: `Provisions Minikube for Kyma installation`, RunE: func(_ *cobra.Command, _ []string) error { return o.Run() }, Aliases: []string{"m"}, } cmd.Flags().StringVarP(&o.Domain, "domain", "d", "kyma.local", "domain to use") cmd.Flags().StringVar(&o.VMDriver, "vm-driver", defaultVMDriver, "VMDriver to use, possible values are: "+strings.Join(drivers, ",")) - cmd.Flags().StringVar(&o.HypervVirtualSwitch, "hypervVirtualSwitch", "", "Name of the hyperv switch to use, required if --vm-driver=hyperv") + cmd.Flags().StringVar(&o.HypervVirtualSwitch, "hypervVirtualSwitch", "", "Name of the hyperv switch, required if --vm-driver=hyperv") cmd.Flags().StringVar(&o.DiskSize, "disk-size", "30g", "Disk size to use") cmd.Flags().StringVar(&o.Memory, "memory", "8192", "Memory to use") cmd.Flags().StringVar(&o.CPU, "cpu", "4", "CPUs to use") @@ -102,11 +102,11 @@ func (o *MinikubeOptions) Run() error { s.Failure() return err } - s.Successf("Requirements are fine") + s.Successf("Requirements verified") - s.LogInfof("Preparing minikube using domain '%s' and vm-driver '%s'", o.Domain, o.VMDriver) + s.LogInfof("Preparing Minikube using domain '%s' and vm-driver '%s'", o.Domain, o.VMDriver) - s = o.NewStep("Check minikube status") + s = o.NewStep("Check Minikube status") err = checkIfMinikubeIsInitialized(o, s) switch err { case ErrMinikubeRunning, nil: @@ -115,9 +115,9 @@ func (o *MinikubeOptions) Run() error { s.Failure() return err } - s.Successf("Minikube status is fine") + s.Successf("Minikube status verified") - s = o.NewStep(fmt.Sprintf("Initializing minikube config")) + s = o.NewStep(fmt.Sprintf("Initializing Minikube config")) err = initializeMinikubeConfig(o) if err != nil { s.Failure() @@ -125,15 +125,15 @@ func (o *MinikubeOptions) Run() error { } s.Successf("Minikube config initialized") - s = o.NewStep(fmt.Sprintf("Create minikube instance")) - s.Status("Start minikube") + s = o.NewStep(fmt.Sprintf("Create Minikube instance")) + s.Status("Start Minikube") err = startMinikube(o) if err != nil { s.Failure() return err } - s.Status("Await minikube to be up and running") + s.Status("Wait for Minikube to be up and running") err = waitForMinikubeToBeUp(o, s) if err != nil { s.Failure() @@ -147,7 +147,7 @@ func (o *MinikubeOptions) Run() error { return err } - s.Status("Await kube-dns to be up and running") + s.Status("Wait for kube-dns to be up and running") err = kubectl.WaitForPodReady("kube-system", "k8s-app", "kube-dns", o.Verbose) if err != nil { @@ -161,7 +161,7 @@ func (o *MinikubeOptions) Run() error { return err } - s = o.NewStep(fmt.Sprintf("Adjusting minikube cluster")) + s = o.NewStep(fmt.Sprintf("Adjusting Minikube cluster")) s.Status("Increase fs.inotify.max_user_instances") err = increaseFsInotifyMaxUserInstances(o) if err != nil { @@ -187,11 +187,11 @@ func (o *MinikubeOptions) Run() error { func checkRequirements(o *MinikubeOptions, s step.Step) error { if !driverSupported(o.VMDriver) { s.Failure() - return fmt.Errorf("Specified VMDriver '%s' is not supported by minikube", o.VMDriver) + return fmt.Errorf("Specified VMDriver '%s' is not supported by Minikube", o.VMDriver) } if o.VMDriver == vmDriverHyperv && o.HypervVirtualSwitch == "" { s.Failure() - return fmt.Errorf("Specified VMDriver '%s' requires option --hypervVirtualSwitch to be provided", vmDriverHyperv) + return fmt.Errorf("Specified VMDriver '%s' requires the --hypervVirtualSwitch option", vmDriverHyperv) } versionWarning, err := minikube.CheckVersion(o.Verbose) @@ -221,7 +221,7 @@ func checkIfMinikubeIsInitialized(o *MinikubeOptions, s step.Step) error { var answer string var err error if !o.NonInteractive { - answer, err = s.Prompt("Do you want to remove previous minikube cluster [y/N]: ") + answer, err = s.Prompt("Do you want to remove the existing Minikube cluster? [y/N]: ") if err != nil { return err } diff --git a/pkg/kyma/cmd/uninstall/cmd.go b/pkg/kyma/cmd/uninstall/cmd.go index c83fce81f..3ef9be5ab 100644 --- a/pkg/kyma/cmd/uninstall/cmd.go +++ b/pkg/kyma/cmd/uninstall/cmd.go @@ -40,20 +40,20 @@ func NewCmd(o *Options) *cobra.Command { cobraCmd := &cobra.Command{ Use: "uninstall", - Short: "Uninstalls Kyma from a running kubernetes cluster", - Long: `Uninstall Kyma on a running kubernetes cluster. - -Assure that your KUBECONFIG is pointing to the target cluster already. -The command will: -- Removes your account as the cluster administrator -- Removes tiller -- Removes the Kyma installer + Short: "Uninstalls Kyma from a running Kubernetes cluster", + Long: `Uninstalls Kyma from a running Kubernetes cluster. + +Make sure that your KUBECONFIG is already pointing to the target cluster. +This command: +- Removes your cluster administrator account +- Removes Tiller +- Removes Kyma Installer `, RunE: func(_ *cobra.Command, _ []string) error { return cmd.Run() }, Aliases: []string{"i"}, } - cobraCmd.Flags().DurationVarP(&o.Timeout, "timeout", "", 0, "Timeout after which CLI should give up watching installation") + cobraCmd.Flags().DurationVarP(&o.Timeout, "timeout", "", 0, "Timeout after which Kyma CLI stops watching the installation progress") return cobraCmd } @@ -66,7 +66,7 @@ func (cmd *command) Run() error { s.Failure() return err } - s.Successf("Requirements are fine") + s.Successf("Requirements verified") s.LogInfof("Uninstalling Kyma") @@ -97,7 +97,7 @@ func (cmd *command) Run() error { s.Failure() return err } - s.Successf("tiller deleted") + s.Successf("Tiller deleted") s = cmd.NewStep("Deleting ClusterRoleBinding for admin") err = cmd.deleteClusterRoleBinding() @@ -291,7 +291,7 @@ func (cmd *command) waitForInstallerToUninstall() error { case <-timeout: cmd.CurrentStep.Failure() _ = cmd.printUninstallationErrorLog() - return errors.New("Timeout while awaiting uninstallation to complete") + return errors.New("Timeout reached while waiting for Kyma to uninstall") default: status, desc, err := cmd.getUninstallationStatus() if err != nil { @@ -306,8 +306,8 @@ func (cmd *command) waitForInstallerToUninstall() error { case "Error": if !errorOccured { errorOccured = true - cmd.CurrentStep.Failuref("Error uninstalling Kyma: %s", desc) - cmd.CurrentStep.LogInfof("To fetch the logs from the installer execute: 'kubectl logs -n kyma-installer -l name=kyma-installer'") + cmd.CurrentStep.Failuref("Failed to uninstall Kyma: %s", desc) + cmd.CurrentStep.LogInfof("To fetch the logs from the Installer, run: 'kubectl logs -n kyma-installer -l name=kyma-installer'") } case "InProgress":