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

Commit

Permalink
add support for running multiple instance of kube-lego in the cluster…
Browse files Browse the repository at this point in the history
… watching their own annotation and getting certificate from their corresponding LE provider
  • Loading branch information
Gurvinder Singh committed Mar 12, 2017
1 parent 634c46d commit c5aa144
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
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 {
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"

0 comments on commit c5aa144

Please sign in to comment.