Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

add support for running multiple instance of kube-lego in the cluster #105

Merged
merged 1 commit into from
Mar 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ spec:
| `LEGO_DEFAULT_INGRESS_CLASS` | n | `nginx` | Default ingress class for resources without specification|
| `LEGO_KUBE_API_URL` | n | `http://127.0.0.1:8080` | API server URL |
| `LEGO_LOG_LEVEL` | n | `info` | Set log level (`debug|info|warn|error`) |
| `LEGO_KUBE_ANNOTATION` | n | `kubernetes.io/tls-acme` | Set the ingress annotation used by this instance of kube-lego to get certificate for from Let's Encrypt. Allows you to run kube-lego against staging and production LE |


## Full deployment examples
Expand Down
5 changes: 5 additions & 0 deletions pkg/kubelego/kubelego.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,5 +312,10 @@ func (kl *KubeLego) paramsLego() error {
kl.legoHTTPPort = intstr.FromInt(i)
}

annotationEnabled := os.Getenv("LEGO_KUBE_ANNOTATION")
if len(annotationEnabled) == 0 {
kubelego.AnnotationEnabled = annotationEnabled
}

return nil
}
2 changes: 1 addition & 1 deletion pkg/kubelego_const/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const TLSCaKey = "ca.crt"
const AnnotationIngressChallengeEndpoints = "kubernetes.io/tls-acme-challenge-endpoints"
const AnnotationIngressChallengeEndpointsHash = "kubernetes.io/tls-acme-challenge-endpoints-hash"
const AnnotationIngressClass = "kubernetes.io/ingress.class"
const AnnotationEnabled = "kubernetes.io/tls-acme"
const AnnotationSslRedirect = "ingress.kubernetes.io/ssl-redirect"
const AnnotationKubeLegoManaged = "kubernetes.io/kube-lego-managed"

var SupportedIngressClasses = []string{"nginx", "gce"}
var AnnotationEnabled = "kubernetes.io/tls-acme"