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:
105
105
| `LEGO_SERVICE_NAME_NGINX` | n | `kube-lego-nginx` | Service name for NGINX ingress |
106
106
| `LEGO_SERVICE_NAME_GCE` | n | `kube-lego-gce` | Service name for GCE ingress |
107
107
| `LEGO_SUPPORTED_INGRESS_CLASS` | n | `nginx,gce` | Specify the supported ingress class |
108
+ | `LEGO_HEALTH_CHECK_PATH` | n | `/healthz` | Specify the health check path |
108
109
| `LEGO_INGRESS_NAME_NGINX` | n | `kube-lego-nginx` | Ingress name which contains the routing for HTTP verification for nginx ingress |
109
110
| `LEGO_PORT` | n | `8080` | Port where this daemon is listening for verifcation calls (HTTP method)|
110
111
| `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 {
48
48
}
49
49
})
50
50
51
- mux .HandleFunc ("/healthz" , func (w http.ResponseWriter , r * http.Request ) {
51
+ mux .HandleFunc (a . kubelego . LegoHealthCheckPath () , func (w http.ResponseWriter , r * http.Request ) {
52
52
w .Header ().Set ("Content-Type" , "text/plain" )
53
53
w .WriteHeader (http .StatusOK )
54
54
fmt .Fprint (w , "ok" )
Original file line number Diff line number Diff line change @@ -157,6 +157,9 @@ func (kl *KubeLego) LegoEmail() string {
157
157
return kl .legoEmail
158
158
}
159
159
160
+ func (kl * KubeLego ) LegoHealthCheckPath () string {
161
+ return kl .legoHealthCheckPath
162
+ }
160
163
func (kl * KubeLego ) LegoNamespace () string {
161
164
return kl .legoNamespace
162
165
}
@@ -340,5 +343,12 @@ func (kl *KubeLego) paramsLego() error {
340
343
} else {
341
344
kl .legoWatchNamespace = watchNamespace
342
345
}
346
+
347
+ kl .legoHealthCheckPath = os .Getenv ("LEGO_HEALTH_CHECK_PATH" )
348
+ if len (kl .legoHealthCheckPath ) == 0 {
349
+ kl .legoHealthCheckPath = kubelego .LegoHealthCheckPath
350
+ }
351
+
352
+
343
353
return nil
344
354
}
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ type KubeLego struct {
25
25
legoServiceNameGce string
26
26
legoSupportedIngressClass []string
27
27
legoHTTPPort intstr.IntOrString
28
+ legoHealthCheckPath string
28
29
legoCheckInterval time.Duration
29
30
legoMinimumValidity time.Duration
30
31
legoDefaultIngressClass string
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const AcmeRegistrationUrl = "acme-registration-url"
10
10
const AcmePrivateKey = k8sApi .TLSPrivateKeyKey
11
11
const AcmeHttpChallengePath = "/.well-known/acme-challenge"
12
12
const AcmeHttpSelfTest = "/.well-known/acme-challenge/_selftest"
13
-
13
+ const LegoHealthCheckPath = "/healthz"
14
14
const TLSCertKey = k8sApi .TLSCertKey
15
15
const TLSPrivateKeyKey = k8sApi .TLSPrivateKeyKey
16
16
const TLSCaKey = "ca.crt"
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ type KubeLego interface {
28
28
LegoCheckInterval () time.Duration
29
29
LegoMinimumValidity () time.Duration
30
30
LegoPodIP () net.IP
31
+ LegoHealthCheckPath () string
31
32
IngressProvider (string ) (IngressProvider , error )
32
33
Version () string
33
34
AcmeUser () (map [string ][]byte , error )
Original file line number Diff line number Diff line change @@ -82,6 +82,12 @@ func (_m *MockKubeLego) LegoEmail() string {
82
82
return ret0
83
83
}
84
84
85
+ func (_m * MockKubeLego ) LegoHealthCheckPath () string {
86
+ ret := _m .ctrl .Call (_m , "LegoHealthCheckPath" )
87
+ ret0 , _ := ret [0 ].(string )
88
+ return ret0
89
+ }
90
+
85
91
func (_mr * _MockKubeLegoRecorder ) LegoEmail () * gomock.Call {
86
92
return _mr .mock .ctrl .RecordCall (_mr .mock , "LegoEmail" )
87
93
}
You can’t perform that action at this time.
0 commit comments