kube-forge v2: embede python with ansible (kubespray) and cobra as cli building tool
This commit is contained in:
44
cmd/root.go
Normal file
44
cmd/root.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"kube-forge/internal/additional"
|
||||
"kube-forge/internal/config"
|
||||
"kube-forge/internal/csi"
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func installAndConfigureModules() {
|
||||
csi.ApplyCharts()
|
||||
additional.ApplyCharts()
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.PersistentFlags().StringVarP(&config.ConfigFile, "config", "c", "config.yaml", "path to configuration file for cluster")
|
||||
rootCmd.PersistentFlags().StringVarP(&config.Output, "output", "o", "", "directory to store k8s admin config")
|
||||
rootCmd.PersistentFlags().StringVarP(&config.Password, "password", "p", "", "password to access hosts via SSH")
|
||||
rootCmd.PersistentFlags().BoolVarP(&config.Verbose, "verbose", "v", false, "enable verbose logging")
|
||||
}
|
||||
|
||||
func Execute() {
|
||||
if err := rootCmd.Execute(); err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
rootCmd = &cobra.Command{
|
||||
Use: "kube-forge <subcommand>",
|
||||
Short: "Kube-forge will help you to deploy K8s clusters",
|
||||
Long: `An easy to use K8s installer`,
|
||||
Args: func(cmd *cobra.Command, args []string) error {
|
||||
if err := cobra.MinimumNArgs(0)(cmd, args); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
},
|
||||
}
|
||||
)
|
||||
Reference in New Issue
Block a user