Documentation ¶
Overview ¶
Copyright Jetstack Ltd. See LICENSE for details.
Copyright Jetstack Ltd. See LICENSE for details.
Copyright Jetstack Ltd. See LICENSE for details.
Copyright Jetstack Ltd. See LICENSE for details.
Copyright Jetstack Ltd. See LICENSE for details.
Copyright Jetstack Ltd. See LICENSE for details.
Copyright Jetstack Ltd. See LICENSE for details.
Copyright Jetstack Ltd. See LICENSE for details.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AppName string = "vault-helper"
var CertCmd = &cobra.Command{ Use: "cert [cert role] [common name] [destination path]", Short: "Create local key to generate a CSR. Call vault with CSR for specified cert role.", Run: func(cmd *cobra.Command, args []string) { log, err := LogLevel(cmd) if err != nil { Must(err) } i, err := newInstanceToken(cmd) if err != nil { Must(err) } if err := i.TokenRenewRun(); err != nil { Must(err) } c := cert.New(log, i) if len(args) != 3 { Must(fmt.Errorf("wrong number of arguments given. Usage: vault-helper cert [cert role] [common name] [destination path]")) } if err := setFlagsCert(c, cmd, args); err != nil { Must(err) } if err := c.RunCert(); err != nil { Must(err) } }, }
initCmd represents the init command
var Must = func(err error) { if err != nil { logrus.Fatal(err) } }
var RootCmd = &cobra.Command{
Use: "vault-helper",
Short: "Automates PKI tasks using Hashicorp's Vault as a backend.",
}
RootCmd represents the base command when called without any subcommands
var SetupCmd = &cobra.Command{ Use: "setup [cluster ID]", Short: "Setup kubernetes on a running vault server.", Run: func(cmd *cobra.Command, args []string) { log, err := LogLevel(cmd) if err != nil { Must(err) } v, err := vault.NewClient(nil) if err != nil { Must(err) } k := kubernetes.New(v, log) if err != nil { Must(err) } if len(args) > 0 { k.SetClusterID(args[0]) } else { Must(errors.New("no cluster id was given")) } if err := setFlagsKubernetes(k, cmd); err != nil { Must(err) } if err := k.Ensure(); err != nil { Must(err) } for n, t := range k.InitTokens() { log.Infof(n + "-init_token := " + t) } }, }
initCmd represents the init command
var Version struct { Version string BuildDate string Commit string }
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func InitCertCmdFlags ¶
func InitSetupFlags ¶
func InitSetupFlags()
Types ¶
This section is empty.