2019-02-06 14:52:09 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2019-02-12 16:55:14 +02:00
|
|
|
"runtime"
|
|
|
|
"flag"
|
|
|
|
"fmt"
|
2019-02-11 19:49:27 +02:00
|
|
|
|
2019-02-12 16:55:14 +02:00
|
|
|
controller "nirmata/kube-policy/controller"
|
2019-02-11 19:49:27 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2019-02-12 16:55:14 +02:00
|
|
|
masterURL string
|
|
|
|
kubeconfig string
|
2019-02-06 14:52:09 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2019-02-12 16:55:14 +02:00
|
|
|
flag.Parse()
|
2019-02-11 19:49:27 +02:00
|
|
|
|
2019-02-12 16:55:14 +02:00
|
|
|
controller, err := controller.NewController(masterURL, kubeconfig)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println("Error running Controller!")
|
|
|
|
}
|
2019-02-11 19:49:27 +02:00
|
|
|
|
2019-02-12 16:55:14 +02:00
|
|
|
err = controller.Run(runtime.NumCPU())
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println("Error running Controller!")
|
|
|
|
}
|
2019-02-11 19:49:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
2019-02-12 16:55:14 +02:00
|
|
|
flag.StringVar(&kubeconfig, "kubeconfig", "", "Path to a kubeconfig. Only required if out-of-cluster.")
|
|
|
|
flag.StringVar(&masterURL, "master", "", "The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster.")
|
2019-02-06 14:52:09 +02:00
|
|
|
}
|