-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
51 lines (47 loc) · 1.13 KB
/
main.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
package main
import (
"log"
"os"
"github.com/max-rocket-internet/kube-doctor/internal/doctor"
"github.com/urfave/cli/v2"
)
func main() {
app := &cli.App{
Name: "kube-doctor",
Usage: "Gives your Kubnernetes cluster a health checkup",
Suggest: true,
Version: "0.1",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "namespace",
Usage: "A namespace name to check. e.g. 'kube-system'",
},
&cli.StringFlag{
Name: "label-selector",
Usage: "A label selector to check. e.g. 'app.kubernetes.io/name=prometheus'",
},
&cli.BoolFlag{
Name: "non-namespaced-resources",
Value: false,
Usage: "Whether to check non-namespaced resources like Nodes, PersistentVolumes, apiserver health etc",
},
&cli.BoolFlag{
Name: "debug",
Value: false,
Usage: "Enable debug logging",
},
&cli.BoolFlag{
Name: "warning-symptoms",
Value: false,
Usage: "Whether to show warning symptoms (otherwise only critical are shown)",
},
},
Action: func(cCtx *cli.Context) error {
doctor.DoCheckUp(cCtx)
return nil
},
}
if err := app.Run(os.Args); err != nil {
log.Fatal(err)
}
}