Danny e8b9c8b94c Merged in feature/config (pull request #2)
Provide ability to configure caddy ingress controller

* Update helm charts
  * Default install into caddy-sytem namespace
  * Allow inter namespace service discovery
2019-05-06 21:29:41 +00:00

37 lines
1.2 KiB
Go

package main
import (
"flag"
"bitbucket.org/lightcodelabs/ingress/internal/caddy"
"k8s.io/klog"
)
func parseFlags() caddy.ControllerConfig {
var email string
flag.StringVar(&email, "email", "", "the email address to use for requesting tls certificates if automatic https is enabled.")
var namespace string
flag.StringVar(&namespace, "observe-namespace", "", "the namespace that you would like to observe kubernetes ingress resources in.")
var enableAutomaticTLS bool
flag.BoolVar(&enableAutomaticTLS, "tls", false, "defines if automatic tls should be enabled for hostnames defined in ingress resources.")
var tlsUseStaging bool
flag.BoolVar(&tlsUseStaging, "tls-use-staging", false, "defines if the lets-encrypt staging server should be used for testing the provisioning of tls certificates.")
flag.Parse()
if email == "" && enableAutomaticTLS {
klog.Info("An email must be defined for automatic tls features, set flag `email` with the email address you would like to use for certificate registration.")
enableAutomaticTLS = false
}
return caddy.ControllerConfig{
Email: email,
AutomaticTLS: enableAutomaticTLS,
TLSUseStaging: tlsUseStaging,
WatchNamespace: namespace,
}
}