45 lines
1.1 KiB
Go
45 lines
1.1 KiB
Go
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
|
|
},
|
|
}
|
|
)
|