Commit 6fd77519 authored by Geoff Simmons's avatar Geoff Simmons

Add the kubeconfig & masterurl CLI args for the controller.

Enables out-of-cluster runs.
parent 24f020e2
...@@ -47,7 +47,7 @@ import ( ...@@ -47,7 +47,7 @@ import (
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/informers" "k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd"
) )
var ( var (
...@@ -62,6 +62,10 @@ var ( ...@@ -62,6 +62,10 @@ var (
"the TEMPLATE_DIR env variable, if set, or the \n"+ "the TEMPLATE_DIR env variable, if set, or the \n"+
"current working directory when the ingress \n"+ "current working directory when the ingress \n"+
"controller is invoked") "controller is invoked")
masterURLF = flag.String("masterurl", "", "cluster master URL, for "+
"out-of-cluster runs")
kubeconfigF = flag.String("kubeconfig", "", "config path for the "+
"cluster master URL, for out-of-cluster runs")
logFormat = logrus.TextFormatter{ logFormat = logrus.TextFormatter{
DisableColors: true, DisableColors: true,
FullTimestamp: true, FullTimestamp: true,
...@@ -120,7 +124,7 @@ func main() { ...@@ -120,7 +124,7 @@ func main() {
os.Exit(-1) os.Exit(-1)
} }
config, err := rest.InClusterConfig() config, err := clientcmd.BuildConfigFromFlags(*masterURLF, *kubeconfigF)
if err != nil { if err != nil {
log.Fatalf("error creating client configuration: %v", err) log.Fatalf("error creating client configuration: %v", err)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment