Commit Graph

163 Commits

Author SHA1 Message Date
James Munnelly
d360eea5e4 Use Events API to report validation errors with ingress-shim
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-26 15:48:47 +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
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
James Munnelly
73f65b9490 Retry after a fixed 5s if self check is failing
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-21 20:29:02 +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
Max Ehrlich
bbd9249198 Configurable issuer duration and renewBefore Take 2 (#893)
* Configurable issuer duration and renewBefore [1/3]

This is part one of (probably) three parts manually moving the changes from commit 723015174a167d746323f506ab3575cfb243d8bd to the new master. This commit moves the basic functionality of configurable duration while skipping e2e tests and docs. It does not include new work.

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Configurable issuer duration and renewBefore [2/3]

This commit moves over most of the e2e testing updates, some things are intentionally left out as they may be obsolete

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Configurable issuer duration and renewBefore [3/3]

This commit moves the documentation changes, completely the migration of the original code to the latest master

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerunning all hack scripts with since the massive bazel update

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add missing boilerplate headers

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerun codegen hack

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerunning update-docs hack

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix failing unit tests

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix build errors in e2e tests

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerun update-deps

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Don't recreate the CA issuer, it already exists

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Need to create new issuers for the duration and renew time tests because those fields are set in the issuer, so make sure they are named uniquely

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add duration e2e tests for self-signed issuer

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add duration e2e tests for vault w/ custom mount path

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add validation to disallow acme certificates with duration and renewBefore set and update unit tests to verify

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Update docs to mention duration/renew for self-signed issuer and fix potential parsing errors with rst formatting

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Self-signed issuer was missing duration validation

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix a bug causing certificates with a short enough renew-before w.r.t their duration to be renewed instantly and forever

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Print the exact time until renewal

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Move duration and renwal validation to the issuer validation

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Update e2e tests to work with new validation

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add e2e test for the self-signed issuer

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Redo cert duration and renew before to appear as part of the CSR and not the issuer

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Updating tests to match new duration/renewbefore format

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Update e2e tests to match new format

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Update docs to reflect changing the field from issuers to certificates

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove event firing and replace with a TODO as of discussion on PR

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Run hack scripts

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove the sync unit test since without events there is no way to catch the warnings that it was testing

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Use IssuerOptions RenewBeforeExpiryDuration if certificates dont set a renewBefore value for immediate renewal checks

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Delete check on certificate data length in e2e test for certificate duration as there is no reason it should be there

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Update e2e tests since certificate creation will never generate an event

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerunning hack scripts after big rebase

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix a few problems that slipped through during the rebase

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix an e2e error that resulted from the rebase

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add unit test for the calculateTimeBeforeExpiry function

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Adding back in a bunch of missing error checks

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove unused function

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add missing boilerplate

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove unused constant

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Move log constants to function body

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerun hack scripts

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove mistakenly commited file

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove double-import of util package

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix bad function call in e2e vault issuer

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Change duration and renewBefore to be pointer fields as they are optional

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove wrong vault issuer test that got passed the rebase somehow

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Change e2e to use pointer format

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Move e2e cert tests out of issuer test file

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Move e2e self-signed issuer test to new location

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Make sure to check for nil in GenerateTemplate

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add more empty checks to be safe

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerunning hacks after rebase

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix bad function call in new e2e test

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Try not setting duration and renewbefore on acme e2e tests

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Zero checks should really just be replaced by nil tests, zero should be caught as any other too-small value

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fixed a missing nil check that got away

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Change e2e duration test format to use pointer times to better simulate API calls

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix sync unit test to match e2e test format

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix vault e2e test

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Revert changes to Certificate sync function

Signed-off-by: James Munnelly <james@munnelly.eu>

* Remove selfsigned e2e issuer.go

Signed-off-by: James Munnelly <james@munnelly.eu>

* Don't use ACME issuer in duration example and tidy up line endings

Signed-off-by: James Munnelly <james@munnelly.eu>

* Allow renewBefore to be set on ACME certificates

Signed-off-by: James Munnelly <james@munnelly.eu>

* Update renewBefore ACME docs. Remove unused fields.

Signed-off-by: James Munnelly <james@munnelly.eu>

* Rename calculateTimeBeforeExpiry to calculateDurationUntilRenew

Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-14 22:30:00 +00:00
Gus Parvin
7e33256b68 changes to add a NotAfter field to the cert status
Signed-off-by: Gus Parvin <gparvin@us.ibm.com>
2018-11-13 16:16:29 +00:00
James Munnelly
3eb8c486ce acmeorders: instantiate real clock
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-13 15:22:44 +00:00
James Munnelly
5cc3240145 Fire Events when challenges succeed or fail
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-07 20:38:22 +00:00
Cosmin Cojocar
3dc4410913 Configure the reference owner before creating the secret
Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
2018-11-07 18:12:18 +01:00
James Munnelly
544507f442 Update gofmt
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-07 12:39:36 +00:00
jetstack-bot
319d6086ca
Merge pull request #1048 from munnerz/fix-grab-secret-name
Fix invalid secret name used in certificates controller
2018-11-07 10:47:45 +00:00
jetstack-bot
a2f77b6e61
Merge pull request #1040 from munnerz/gofmt
Use go_sdk gofmt instead of goimports
2018-11-07 09:48:45 +00:00
James Munnelly
e0829525a5 Fix invalid secret name used in certificates controller
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-06 19:04:51 +00:00
jetstack-bot
ace5c2b2f2
Merge pull request #738 from gambol99/acme_options
Configurable ACME Annotation
2018-11-06 16:00:02 +00:00
James Munnelly
b6f89ae9dd Regenerate files
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-06 12:31:16 +00:00
James Munnelly
61eb132067 Update challenges controller unit tests for new processing field
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-06 12:31:16 +00:00
James Munnelly
85d433cff9 Add ACME challenge scheduler and process challenges for matching domains/types in serial
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-06 12:31:16 +00:00
Rohith
e2f13f5f9c Requested Changes
- changing the name of the command line option to --auto-certificate-annotations
- making the option an array to allow for multiple annotations settings

Signed-off-by: Rohith Jayawardene <gambol99@gmail.com>
2018-11-06 12:09:47 +00:00
Rohith
712a7a85ee Configurable ACME Annotation
- adds a option command line (default to the current behavour) which allows the user to control the acme annotation used by the shim controller
- a current mitgration requires use to run multiple providers at the same

Signed-off-by: Rohith Jayawardene <gambol99@gmail.com>
2018-11-06 12:09:18 +00:00
James Munnelly
ad0971288e Run update-gofmt
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-06 11:10:21 +00:00
James Munnelly
de7d79b7e6 Schedule certificate renewal at the end of Certificate Sync function
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-29 14:27:16 +00:00
Cosmin Cojocar
5d36fba075 Add a flag which controls whether the certificate is configured as an owner of the secret where the effective TLS certificate is stored
Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
2018-10-28 19:55:26 +01:00
Cosmin Cojocar
32cf3242cc Set the certificate as an owner of the secret
In this way, the secret will be garbage collected when a certificate is deleted.

Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
2018-10-28 18:44:33 +01:00
jetstack-bot
2f83424d4d
Merge pull request #1009 from munnerz/simpl-crt-controller
Simplify certificate controller cert validity checks
2018-10-26 12:43:34 +01:00
Sergej Nikolaev
f2add649e7 add certmanager.k8s.io/acme-http01-ingress-class annotation
Signed-off-by: Sergej Nikolaev <kinolaev@gmail.com>
2018-10-25 22:14:08 +03:00
James Munnelly
ee6e0d3325 Resolve golint errors in certificates controller
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-25 18:57:54 +01:00
James Munnelly
8dd548d59b Simplify Certificate controller cert validity checks
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-25 18:57:40 +01:00
James Munnelly
0478694963 Update workqueue rate limiters on issuers and ingress-shim controllers
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-23 00:09:42 +01:00
James Munnelly
01bc1fd51a Update acmechallenges unit tests
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-15 23:37:00 +01:00
James Munnelly
6e32738f22 Handle WaitAuthorization failing properly
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-15 14:15:21 +01:00
James Munnelly
454d420dc0 Run //hack:update-bazel
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-13 23:36:34 +01:00
James Munnelly
d7f21fd59e Refactor acmechallenges unit test fixture construction
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-13 23:36:33 +01:00
James Munnelly
039a086f58 run //hack:update-bazel
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-12 12:40:40 +01:00
James Munnelly
eadbbc85c5 Add missing boilerplate headers
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-12 12:40:39 +01:00
James Munnelly
d323a1df0d Add unit tests for acmeorders and acmechallenges
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-12 12:40:39 +01:00
James Munnelly
9214615d6e Fix race issues in ACME issue function. Add extended unit tests.
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-12 12:40:39 +01:00
James Munnelly
847d0c6152 Refactor controllers to return Response structures
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-12 12:40:38 +01:00
James Munnelly
5482ece3f5 Update unit test framework to support actions and required reactors
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-12 12:40:38 +01:00
James Munnelly
967a48e1dc Add ACME Order & Challenge controllers
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-12 12:40:38 +01:00
James Munnelly
f8b1e653f3 Refactor ACME Issuer to create and manage Order resources
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-12 12:40:37 +01:00
jetstack-bot
5ea95b6cc1
Merge pull request #923 from arnoldbechtoldt/issue892
make http01 solver pod resource request/limits configurable, refs #892
2018-10-10 13:06:11 +01:00
Arnold Bechtoldt
845eb7f57c make http01 solver pod resource request/limits configurable, refs #892
Signed-off-by: Arnold Bechtoldt <arnold.bechtoldt@inovex.de>
2018-09-26 14:39:06 +02:00
Max Ehrlich
ab450c7463
Set the CA field if a non-nil ca cert is passed
Signed-off-by: Max Ehrlich <max.ehr@gmail.com>
2018-09-13 17:07:15 -04:00
Max Ehrlich
e347572541
Change key name constant to better match its function
Signed-off-by: Max Ehrlich <max.ehr@gmail.com>
2018-09-13 17:07:14 -04:00
Max Ehrlich
2524335f3a
Set the "ca.crt" field for certificates issued with isCA so that nginx can properly identify them for client authentication
Signed-off-by: Max Ehrlich <max.ehr@gmail.com>
2018-09-13 17:07:13 -04:00