Commit Graph

146 Commits

Author SHA1 Message Date
Michael Tsang
f2e57a1c95 Add ControllerSyncCallCount metric
Signed-off-by: Michael Tsang <michael.tsang@jetstack.io>
2019-05-17 14:22:16 +01:00
James Munnelly
1268f76690 Make lastTransitionTime a pointer
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-05-02 14:59:52 +01:00
James Munnelly
fc6e3e5315 Remove extra check for certificate.spec.acme
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-05-01 14:24:37 +01:00
James Munnelly
064b710f02 Fix update loop due to changing notAfter struct
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-04-30 19:10:29 +01:00
James Munnelly
871ed4283b Allow controller constructors to return errors
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-04-18 14:22:04 +01:00
Lennart Jern
dfb3954dba Update cert if issuer doesn't match
Signed-off-by: Lennart Jern <lennart.jern@gmail.com>
2019-03-29 20:32:59 +01:00
James Munnelly
a13543013d Use logr in pkg/util/kube
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-03-12 14:24:50 +00:00
James Munnelly
92713156ed Update certificates controller
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-03-12 14:24:50 +00:00
James Munnelly
dfabece6eb Use a one-use CA to sign temporary certificates
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-02-25 20:48:13 +00:00
James Munnelly
cf2f9eac74 Generate a temporary certificate whilst waiting for Issuer to issue
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-02-25 17:48:22 +00:00
James Munnelly
2f30258f0e Switch to klog
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-02-22 12:34:02 +00:00
James Munnelly
1f48f3d1d4 gofmt
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-02-19 11:25:56 +00:00
James Munnelly
bbd73477cd Fixes after rebasing
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-02-19 11:25:56 +00:00
James Munnelly
324e8319b6 Add basic Certificate unit tests
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-02-19 11:25:55 +00:00
James Munnelly
cee0e28a05 Add initial unit test for certificate controller
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-02-19 11:25:55 +00:00
James Munnelly
0bde3dacba Create pkg/api/util and re-arrange controller instantiation code
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-02-19 11:25:54 +00:00
James Munnelly
3a19501e26 Add initial unit test framework for Certificates controller
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-02-19 11:22:36 +00:00
James Munnelly
804240da9d Switch Certificate controller to use Helper struct
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-02-19 11:22:36 +00:00
James Munnelly
1c4f160169 Use Helper structure to call GetGenericIssuer everywhere
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-02-07 22:35:17 +00:00
jetstack-bot
fd9567f1e4
Merge pull request #1318 from munnerz/crt-ctrl-use-lister
Use secretLister in updateSecret
2019-02-06 16:39:55 +00:00
James Munnelly
fac0a32c7e Fix bug causing certficates to be re-issued with misconfigured renewBefore/duration
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-02-06 15:43:59 +00:00
James Munnelly
e53312463d Use secretLister in updateSecret
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-02-05 17:56:16 +00:00
jetstack-bot
22b0863801
Merge pull request #1128 from lrolaz/certificate-ip-sans
Add IP Address in CSR
2019-01-31 23:05:25 +00:00
Laurent ROLAZ
ed82465df5 Refactoring
Signed-off-by: Laurent Rolaz <laurent.rolaz@gmail.com>
2019-01-30 13:04:28 +01:00
Laurent Rolaz
18daea16ae Remove duplicate IPAddressesToString
Signed-off-by: Laurent Rolaz <laurent.rolaz@gmail.com>
2019-01-25 18:50:16 +01:00
Laurent Rolaz
c5fa202239 Fix some GO Style
Signed-off-by: Laurent Rolaz <laurent.rolaz@gmail.com> (+2 squashed commits)
Squashed commits:
[ce6cc2eb] Fix some GO Style

Signed-off-by: Laurent Rolaz <laurent.rolaz@gmail.com>
[563b7275] Fix some GO Style

Signed-off-by: Laurent Rolaz <laurent.rolaz@gmail.com>
2019-01-25 18:50:16 +01:00
Laurent Rolaz
531c26061c GO Format
Signed-off-by: Laurent Rolaz <laurent.rolaz@gmail.com>

Signed-off-by: Laurent Rolaz <laurent.rolaz@gmail.com>
2019-01-25 18:38:12 +01:00
Laurent Rolaz
6dcc408741 Add IP Address in CSR
Signed-off-by: Laurent Rolaz <laurent.rolaz@gmail.com>
2019-01-25 18:38:12 +01:00
James Munnelly
3d1183a169 Fix nil map panic when writing to an empty existing Secret
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-18 11:16:44 +00:00
Louis Taylor
bbda87b3c8 Add --namespace flag
Signed-off-by: Louis Taylor <louis@kragniz.eu>
2019-01-10 13:52:52 +00:00
James Munnelly
22342b61b3 Fix use of SecretTLSKeyPair in certificates controller
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-09 11:39:48 +00:00
James Munnelly
0fcc0c666c Update copyright header year
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-07 15:07:55 +00:00
jetstack-bot
bed2934534
Merge pull request #1125 from munnerz/issueresponse-ptr
Switch issuer.Issue to return a pointer and fix up setting secret fields
2018-11-30 11:59:12 +00:00
James Munnelly
943e545697 Switch issuer.Issue to return a pointer and fix up setting secret fields
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-30 11:47:08 +00:00
James Munnelly
c890913fb1 Don't update Certificate status condition upon issuance
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-30 10:42:33 +00:00
James Munnelly
f8fe9ef21f Remove requeue option and fix small race in controllers
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-29 12:23:21 +00:00
James Munnelly
87f91a6e8e Add explicit check for certificate.spec.acme when issuing acme certificates
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-28 19:18:09 +00:00
James Munnelly
32c230656f Use certificateMatchesSpec for detecting need for re-issuance
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-28 19:17:41 +00:00
James Munnelly
1cbfa7ada7 Resync certificates on changes to their referenced issuers
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-28 17:01:15 +00:00
James Munnelly
dc97dde2ef Make Certificate Ready condition behaviour consistent between all issuer types
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-28 17:00:51 +00:00
jetstack-bot
a21ac37a74
Merge pull request #713 from kragniz/add-prometheus-metrics-endpoint
Add cert-manager specific metrics to Prometheus endpoint
2018-11-26 15:45:33 +00:00
jetstack-bot
2c74eabb1c
Merge pull request #819 from ccojocar/cert_secret_ref
Set the certificate as an owner of the secret
2018-11-26 15:06:33 +00:00
Louis Taylor
39dd82b8a2
Defer UpdateCertificateExpiry earlier
Signed-off-by: Louis Taylor <louis@kragniz.eu>
2018-11-26 13:13:57 +00:00
Louis Taylor
cf872a9fc9
Add prometheus metrics
Count certificate requests

Add certificate_expiry_time_seconds metric

Register certificate_expiry_time_seconds metric, fix kind switch and fix metric status result

Export nameForIssuer and remove unneccessary switch

Refactor metrics into controller context

Move metrics collection into functions

Move error checking for metrics collection back into sync function

Remove space

Add TODO

Move update certificate expiry function to metrics package

Refactor metrics functionality

Signed-off-by: Louis Taylor <louis@kragniz.eu>

Run dep ensure

Signed-off-by: Louis Taylor <louis@kragniz.eu>

Fix build

Signed-off-by: Louis Taylor <louis@kragniz.eu>

Refactor

Signed-off-by: Louis Taylor <louis@kragniz.eu>

Fix reporting errors

Signed-off-by: Louis Taylor <louis@kragniz.eu>

Add comments

Signed-off-by: Louis Taylor <louis@kragniz.eu>

Remove unused issuerType

Signed-off-by: Louis Taylor <louis@kragniz.eu>

Update dep inputs-digest

Signed-off-by: Louis Taylor <louis@kragniz.eu>

Don't update status

Signed-off-by: Louis Taylor <louis@kragniz.eu>

Make metrics package level var

Signed-off-by: Louis Taylor <louis@kragniz.eu>

Add prometheusMetricsServerMaxHeaderBytes comment

Signed-off-by: Louis Taylor <louis@kragniz.eu>

Add failures metric

Signed-off-by: Louis Taylor <louis@kragniz.eu>

Remove issue metrics

TODO: hopefully revert this at some point.
Signed-off-by: Louis Taylor <louis@kragniz.eu>

Assign metrics

Signed-off-by: Louis Taylor <louis@kragniz.eu>

Update dep digest

Signed-off-by: Louis Taylor <louis@kragniz.eu>

Fix copyright header

Signed-off-by: Louis Taylor <louis@kragniz.eu>

Remove old metrics server

Signed-off-by: Louis Taylor <louis@kragniz.eu>

Update bazel files

Signed-off-by: Louis Taylor <louis@kragniz.eu>

Clean up

Signed-off-by: Louis Taylor <louis@kragniz.eu>
2018-11-26 13:13:44 +00:00
jetstack-bot
99e44be850
Merge pull request #1098 from munnerz/challenges-no-error-check
Retry after a fixed 5s if self check is failing & adjust all controllers to use same rate limiter
2018-11-26 13:13:33 +00:00
jetstack-bot
26c7451b5b
Merge pull request #1023 from munnerz/fix-renew-bug
Schedule certificate renewal at the end of Certificate Sync function
2018-11-26 12:38:33 +00:00
James Munnelly
b103403ff7 Add default rate limiter used by all controllers
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-21 20:37:57 +00:00
jetstack-bot
9975ff4a8a
Merge pull request #1075 from gparvin/adding-not-after-to-certificate-status
changes to add a NotAfter field to the cert status
2018-11-16 10:11:01 +00:00
Gus Parvin
acc0fa887b set the NotAfter time as soon as the cert is parsed successfully
Signed-off-by: Gus Parvin <gparvin@us.ibm.com>
2018-11-15 14:30:31 +00:00
Gus Parvin
ff3f198eca make sure the expire time is set when the certificate is in an infinite renewal loop
Signed-off-by: Gus Parvin <gparvin@us.ibm.com>
2018-11-15 14:07:34 +00:00