-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
35 lines (28 loc) · 783 Bytes
/
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
package main
import (
"fmt"
"log"
"os"
"os/exec"
"github.com/Saumya40-codes/k8s-visualizer/api"
)
func init() {
logFile, _ := os.OpenFile("k8s-visualize.log", os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0666)
log.SetOutput(logFile)
}
func main() {
fmt.Println("🚀 Starting monitoring your k8s")
log.Println("Monitoring started")
go api.StartMonitoring()
cmd := exec.Command("npm", "run", "dev")
cmd.Dir = "./ui"
err := cmd.Start()
if err != nil {
log.Printf("Error starting Visualizer app: %v\n", err)
log.Printf("Ignore above error if you are running docker container or using in-cluster k8s configuration")
return
}
log.Println("Visualizer started")
fmt.Println("😁 Visualizer started successfully!\nHeadover to http://localhost:5173")
select {}
}