Update CLI reference (#248)

Co-authored-by: katexochen <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
github-actions[bot] 2022-10-14 10:48:20 +02:00 committed by GitHub
parent 84a9f0bfb4
commit 74c3c93dec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 17 deletions

View File

@ -46,7 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Mini Constellation: Try out Constellation locally without any cloud subscription required just with one command: `constellation mini up`
- MiniConstellation: Try out Constellation locally without any cloud subscription required just with one command: `constellation mini up`
- Loadbalancer for control-plane recovery
- K8s conformance mode
- Local cluster creation based on QEMU

View File

@ -8,12 +8,12 @@ package cmd
import "github.com/spf13/cobra"
// NewMiniCmd creates a new cobra.Command for managing mini Constellation clusters.
// NewMiniCmd creates a new cobra.Command for managing MiniConstellation clusters.
func NewMiniCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "mini",
Short: "Manage mini Constellation clusters",
Long: "Manage mini Constellation clusters.",
Short: "Manage MiniConstellation clusters",
Long: "Manage MiniConstellation clusters.",
Args: cobra.ExactArgs(0),
}

View File

@ -23,8 +23,8 @@ import (
func newMiniDownCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "down",
Short: "Destroy a mini Constellation cluster",
Long: "Destroy a mini Constellation cluster.",
Short: "Destroy a MiniConstellation cluster",
Long: "Destroy a MiniConstellation cluster.",
Args: cobra.ExactArgs(0),
RunE: runDown,
}
@ -53,7 +53,7 @@ func checkForMiniCluster(fileHandler file.Handler) error {
return errors.New("cluster is not a QEMU based Constellation")
}
if idFile.UID != "mini" {
return errors.New("cluster is not a mini Constellation cluster")
return errors.New("cluster is not a MiniConstellation cluster")
}
return nil

View File

@ -37,8 +37,8 @@ import (
func newMiniUpCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "up",
Short: "Create and initialize a new mini Constellation cluster",
Long: "Create and initialize a new mini Constellation cluster.\n" +
Short: "Create and initialize a new MiniConstellation cluster",
Long: "Create and initialize a new MiniConstellation cluster.\n" +
"A mini cluster consists of a single control-plane and worker node, hosted using QEMU/KVM.\n",
Args: cobra.ExactArgs(0),
RunE: runUp,
@ -92,7 +92,7 @@ func up(cmd *cobra.Command, spinner spinnerInterf) error {
return nil
}
// checkSystemRequirements checks if the system meets the requirements for running a mini Constellation cluster.
// checkSystemRequirements checks if the system meets the requirements for running a MiniConstellation cluster.
// We do so by verifying that the host:
// - arch/os is linux/amd64.
// - has access to /dev/kvm.
@ -112,7 +112,7 @@ func checkSystemRequirements(out io.Writer) error {
// check CPU cores
if runtime.NumCPU() < 4 {
return fmt.Errorf("insufficient CPU cores: %d, at least 4 cores are required by mini Constellation", runtime.NumCPU())
return fmt.Errorf("insufficient CPU cores: %d, at least 4 cores are required by MiniConstellation", runtime.NumCPU())
}
if runtime.NumCPU() < 6 {
fmt.Fprintf(out, "WARNING: Only %d CPU cores available. This may cause performance issues.\n", runtime.NumCPU())
@ -136,7 +136,7 @@ func checkSystemRequirements(out io.Writer) error {
}
memGB := memKB / 1024 / 1024
if memGB < 4 {
return fmt.Errorf("insufficient memory: %dGB, at least 4GB of memory are required by mini Constellation", memGB)
return fmt.Errorf("insufficient memory: %dGB, at least 4GB of memory are required by MiniConstellation", memGB)
}
if memGB < 6 {
fmt.Fprintln(out, "WARNING: Less than 6GB of memory available. This may cause performance issues.")
@ -148,7 +148,7 @@ func checkSystemRequirements(out io.Writer) error {
}
freeSpaceGB := stat.Bavail * uint64(stat.Bsize) / 1024 / 1024 / 1024
if freeSpaceGB < 20 {
return fmt.Errorf("insufficient disk space: %dGB, at least 20GB of disk space are required by mini Constellation", freeSpaceGB)
return fmt.Errorf("insufficient disk space: %dGB, at least 20GB of disk space are required by MiniConstellation", freeSpaceGB)
}
return nil
@ -168,7 +168,7 @@ func prepareConfig(cmd *cobra.Command, fileHandler file.Handler) (*config.Config
return nil, err
}
if config.GetProvider() != cloudprovider.QEMU {
return nil, errors.New("invalid provider for mini constellation cluster")
return nil, errors.New("invalid provider for MiniConstellation cluster")
}
return config, nil
}
@ -204,7 +204,7 @@ func createMiniCluster(ctx context.Context, fileHandler file.Handler, creator cl
return err
}
idFile.UID = "mini" // use UID "mini" to identify mini constellation clusters.
idFile.UID = "mini" // use UID "mini" to identify MiniConstellation clusters.
return fileHandler.WriteJSON(constants.ClusterIDsFileName, idFile, file.OptNone)
}

View File

@ -167,7 +167,6 @@ constellation init [flags]
```
--conformance enable conformance mode
--endpoint string endpoint of the bootstrapper, passed as HOST[:PORT]
-h, --help help for init
--master-secret string path to base64-encoded master secret
```
@ -224,7 +223,7 @@ constellation mini up [flags]
--config string path to the configuration file (default "constellation-conf.yaml")
```
## constellation mini **down**
## constellation mini down
Destroy a MiniConstellation cluster