This repository was archived by the owner on Aug 26, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +21
-2
lines changed
Expand file tree Collapse file tree 7 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ Please note:
105105| `LEGO_SERVICE_NAME_NGINX` | n | `kube-lego-nginx` | Service name for NGINX ingress |
106106| `LEGO_SERVICE_NAME_GCE` | n | `kube-lego-gce` | Service name for GCE ingress |
107107| `LEGO_SUPPORTED_INGRESS_CLASS` | n | `nginx,gce` | Specify the supported ingress class |
108+ | `LEGO_HEALTH_CHECK_PATH` | n | `/healthz` | Specify the health check path |
108109| `LEGO_INGRESS_NAME_NGINX` | n | `kube-lego-nginx` | Ingress name which contains the routing for HTTP verification for nginx ingress |
109110| `LEGO_PORT` | n | `8080` | Port where this daemon is listening for verifcation calls (HTTP method)|
110111| `LEGO_CHECK_INTERVAL` | n | `8h` | Interval for periodically certificate checks (to find expired certs)|
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ func (a *Acme) Mux() *http.ServeMux {
4848 }
4949 })
5050
51- mux .HandleFunc ("/healthz" , func (w http.ResponseWriter , r * http.Request ) {
51+ mux .HandleFunc (a . kubelego . LegoHealthCheckPath () , func (w http.ResponseWriter , r * http.Request ) {
5252 w .Header ().Set ("Content-Type" , "text/plain" )
5353 w .WriteHeader (http .StatusOK )
5454 fmt .Fprint (w , "ok" )
Original file line number Diff line number Diff line change @@ -157,6 +157,9 @@ func (kl *KubeLego) LegoEmail() string {
157157 return kl .legoEmail
158158}
159159
160+ func (kl * KubeLego ) LegoHealthCheckPath () string {
161+ return kl .legoHealthCheckPath
162+ }
160163func (kl * KubeLego ) LegoNamespace () string {
161164 return kl .legoNamespace
162165}
@@ -340,5 +343,12 @@ func (kl *KubeLego) paramsLego() error {
340343 } else {
341344 kl .legoWatchNamespace = watchNamespace
342345 }
346+
347+ kl .legoHealthCheckPath = os .Getenv ("LEGO_HEALTH_CHECK_PATH" )
348+ if len (kl .legoHealthCheckPath ) == 0 {
349+ kl .legoHealthCheckPath = kubelego .LegoHealthCheckPath
350+ }
351+
352+
343353 return nil
344354}
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ type KubeLego struct {
2525 legoServiceNameGce string
2626 legoSupportedIngressClass []string
2727 legoHTTPPort intstr.IntOrString
28+ legoHealthCheckPath string
2829 legoCheckInterval time.Duration
2930 legoMinimumValidity time.Duration
3031 legoDefaultIngressClass string
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const AcmeRegistrationUrl = "acme-registration-url"
1010const AcmePrivateKey = k8sApi .TLSPrivateKeyKey
1111const AcmeHttpChallengePath = "/.well-known/acme-challenge"
1212const AcmeHttpSelfTest = "/.well-known/acme-challenge/_selftest"
13-
13+ const LegoHealthCheckPath = "/healthz"
1414const TLSCertKey = k8sApi .TLSCertKey
1515const TLSPrivateKeyKey = k8sApi .TLSPrivateKeyKey
1616const TLSCaKey = "ca.crt"
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ type KubeLego interface {
2828 LegoCheckInterval () time.Duration
2929 LegoMinimumValidity () time.Duration
3030 LegoPodIP () net.IP
31+ LegoHealthCheckPath () string
3132 IngressProvider (string ) (IngressProvider , error )
3233 Version () string
3334 AcmeUser () (map [string ][]byte , error )
Original file line number Diff line number Diff line change @@ -82,6 +82,12 @@ func (_m *MockKubeLego) LegoEmail() string {
8282 return ret0
8383}
8484
85+ func (_m * MockKubeLego ) LegoHealthCheckPath () string {
86+ ret := _m .ctrl .Call (_m , "LegoHealthCheckPath" )
87+ ret0 , _ := ret [0 ].(string )
88+ return ret0
89+ }
90+
8591func (_mr * _MockKubeLegoRecorder ) LegoEmail () * gomock.Call {
8692 return _mr .mock .ctrl .RecordCall (_mr .mock , "LegoEmail" )
8793}
You can’t perform that action at this time.
0 commit comments