This commit is contained in:
parent
08f953b7ef
commit
144fbdd18b
1 changed files with 6 additions and 2 deletions
6
main.go
6
main.go
|
@ -96,6 +96,7 @@ func main() {
|
||||||
k8sToken := getEnv("KUBERNETES_TOKEN", "")
|
k8sToken := getEnv("KUBERNETES_TOKEN", "")
|
||||||
verifySSLStr := getEnv("KUBERNETES_VERIFYSSL", "false")
|
verifySSLStr := getEnv("KUBERNETES_VERIFYSSL", "false")
|
||||||
templatePath := getEnv("HAPROXY_TEMPLATE", "haproxy.tmpl")
|
templatePath := getEnv("HAPROXY_TEMPLATE", "haproxy.tmpl")
|
||||||
|
annotationCheckEnabled := os.Getenv("KUBERNETES_ANNOTATION_HAPROXY") != ""
|
||||||
|
|
||||||
if k8sHost == "" || k8sToken == "" {
|
if k8sHost == "" || k8sToken == "" {
|
||||||
log.Fatal("KUBERNETES_HOST and KUBERNETES_TOKEN must be set")
|
log.Fatal("KUBERNETES_HOST and KUBERNETES_TOKEN must be set")
|
||||||
|
@ -183,9 +184,12 @@ func main() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if val, ok := svc.Metadata.Annotations["haproxy/enabled"]; !ok || val != "true" {
|
if annotationCheckEnabled {
|
||||||
|
val, ok := svc.Metadata.Annotations["haproxy/enabled"]
|
||||||
|
if !ok || val != "true" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
key := svc.Metadata.Namespace + "/" + svc.Metadata.Name
|
key := svc.Metadata.Namespace + "/" + svc.Metadata.Name
|
||||||
ep, found := endpointMap[key]
|
ep, found := endpointMap[key]
|
||||||
|
|
Loading…
Add table
Reference in a new issue