-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
install_hello_world.go
60 lines (56 loc) · 1.08 KB
/
install_hello_world.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package install_hello_world
import (
parent_cmd "github.com/sikalabs/slu/cmd/scripts/kubernetes"
"github.com/sikalabs/slu/utils/k8s_scripts"
"github.com/spf13/cobra"
)
var FlagDry bool
var FlagHost string
var FlagNamespace string
var FlagReplicas int
var FlagText string
var Cmd = &cobra.Command{
Use: "install-hello-world",
Short: "Install sikalabs/hello-world (hello-world-server)",
Aliases: []string{"ihw"},
Args: cobra.NoArgs,
Run: func(c *cobra.Command, args []string) {
k8s_scripts.InstallHelloWorld(FlagHost, FlagReplicas, FlagText, FlagNamespace, FlagDry)
},
}
func init() {
parent_cmd.Cmd.AddCommand(Cmd)
Cmd.Flags().BoolVar(
&FlagDry,
"dry",
false,
"Dry run",
)
Cmd.Flags().StringVar(
&FlagHost,
"host",
"",
"public hostname of the hello-world server",
)
Cmd.Flags().StringVarP(
&FlagNamespace,
"namespace",
"n",
"hello-world",
"Kubernetes namespace",
)
Cmd.Flags().IntVarP(
&FlagReplicas,
"replicas",
"r",
1,
"Nuber of replicas / pods",
)
Cmd.Flags().StringVarP(
&FlagText,
"text",
"t",
"",
"Text to display",
)
}