Skip to content

Commit

Permalink
Add cluster command (#129)
Browse files Browse the repository at this point in the history
Signed-off-by: 6za <53096417+6za@users.noreply.github.com>
  • Loading branch information
6za committed Jul 19, 2022
1 parent bb66602 commit 74e0bb0
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 7 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ go run . init --admin-email $ADMIN_EMAIL --cloud $CLOUD_PROVIDER --hosted-zone-n
At this point, everything is ready to start provisioning the cloud services, and for that we can run:

```bash
go run . create
go run . cluster create
```

## Access ArgoCD
Expand All @@ -71,11 +71,11 @@ rm ~/.flare
Kubefirst provides extra tooling for handling the provisioning work.

| Command | Description |
|------------|-----------------------------------------------------------|
| argocdSync | Request ArgoCD to synchronize applications |
| checktools | use to check compatibility of .kubefirst/tools |
| clean | removes all kubefirst resources locally for new execution |
| create | create a kubefirst management cluster |
|:------------|:-----------------------------------------------------------|
| argocdSync | Request ArgoCD to synchronize applications |
| checktools | use to check compatibility of .kubefirst/tools |
| clean | removes all kubefirst resources locally for new execution |
| cluster create | create a kubefirst management cluster |
| destroy | destroy the kubefirst management cluster |
| info | provides general Kubefirst setup data |
| init | initialize your local machine to execute `create` |
Expand Down
35 changes: 35 additions & 0 deletions cmd/cluster.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
*/
package cmd

import (
"fmt"

"github.com/spf13/cobra"
)

// clusterCmd represents the cluster command
var clusterCmd = &cobra.Command{
Use: "cluster",
Short: "Used to manage cluster level operations",
Long: `Cluster Level operations like create a new cluster provisioned with all kubefirst goodies.`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("cluster called")
},
}

func init() {
rootCmd.AddCommand(clusterCmd)

// Here you will define your flags and configuration settings.

// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// clusterCmd.PersistentFlags().String("foo", "", "A help for foo")

// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// clusterCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}
2 changes: 1 addition & 1 deletion cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ to quickly create a Cobra application.`,
}

func init() {
rootCmd.AddCommand(createCmd)
clusterCmd.AddCommand(createCmd)

// todo: make this an optional switch and check for it or viper
createCmd.Flags().Bool("destroy", false, "destroy resources")
Expand Down

0 comments on commit 74e0bb0

Please sign in to comment.