Commit Graph

250 Commits

Author SHA1 Message Date
Ashley Davis
6ce6ae839e
separate binaries/tests into separate modules with minimal dependencies
also add gomod validation in CI, along with a cmrel version bump

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2023-04-05 10:30:39 +01:00
Tim Ramlot
f36c06f10d
move cmd/util/ to internal/cmd/util/, since it is also imported by packages outside of cmd/
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-02-28 12:38:59 +01:00
Corey McGalliard
7e6e0940a2 updating to match feedback and adjust the RunAsNonRoot options for http01 solver to be more descriptive
Signed-off-by: Corey McGalliard <cmcgalliard@redventures.com>
2022-11-16 11:20:36 -05:00
irbekrm
584147df37 Document that pod template spec should be used instead of flags
For configuring ACME HTTP-01 solver pod

Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-08-09 15:26:10 +01:00
Ashley Davis
fb231ab641
Remove bazel 🎉
This removes all .bazel and .bzl files, and a bunch of scripts relating
to bazel, now that it's been entirely replaced.

There are still a few places where traces could be removed, but this
removes the brunt of the bazel stuff that remains.

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-07-26 11:38:50 +01:00
irbekrm
75b205021d Corrects the --dns01-check-retry-period flag description
Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-06-09 12:09:39 +01:00
David Bond
4a4dd03245
Switch leader election to use Lease objects
Previously, cert-manager supported both ConfigMap & Lease objects for leader election. This commit modifies
the leader-election code to now solely use Lease objects in both the controller & ca-injector. The related
RBAC for ConfigMap resources has also been removed.

This change means that you cannot upgrade to the version containing this commit from cert-manager 1.3.

Related to #3766

Signed-off-by: David Bond <davidsbond93@gmail.com>
2022-03-10 12:38:50 +00:00
Jake Sanders
f225637e20
Relax the validation on the default Issuer Kind for certificate-shim
Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2022-02-08 13:50:13 +00:00
Ashley Davis
3a055cc2f5
rename all uses of github.com/jetstack/cert-manager
This was done by running the following command twice:

 ```bash
 grep -Ri "github.com/jetstack/cert-manager" . | \
 cut -d":" -f1 | \
 sort | \
 uniq | \
 xargs sed -i
 "s/github.com\/jetstack\/cert-manager/github.com\/cert-manager\/cert-manager/"
 ```

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-02-02 09:08:31 +00:00
joshvanl
d6c34987ef Updates controller start with ControllerFactory
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-01-27 12:51:49 +00:00
jetstack-bot
fa321b6a4b
Merge pull request #4287 from linka-cloud/acme-http-challenge-cutomer-dns
Acme http challenge custom dns
2022-01-11 11:24:03 +00:00
James Munnelly
9c04a04c7c Move feature package into internal/controller
Signed-off-by: James Munnelly <jmunnelly@apple.com>
2022-01-07 12:17:36 +00:00
Adphi
3375fa0609
http01: add custom nameservers support (#4286)
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
2022-01-06 21:02:46 +01:00
James Munnelly
81f22fd49c Upgrade k8s.io dependencies to v0.23.1
Signed-off-by: James Munnelly <jmunnelly@apple.com>
2021-12-17 16:27:47 +00:00
jetstack-bot
f61d534975
Merge pull request #4550 from irbekrm/pprof
Pprof
2021-10-26 11:20:40 +01:00
irbekrm
7b6eeff457 Profiler address for controller can now be configured
Ensures that pprof is configured for controller in the same way as for cainjector

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-10-26 12:20:42 +03:00
irbekrm
4d4a383cb7 Removes deprecated dns01-self-check-nameservers flag
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-10-25 08:43:08 +03:00
joshvanl
64feb85490 Adds bazel to build and release cmctl, along with kubectl-cert_manager
binary

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-10-14 15:49:46 +01:00
Johan Fleury
ef32714434
Make leader election defaults consistent
Signed-off-by: Johan Fleury <jfleury@arcaik.net>
2021-08-13 12:14:40 -04:00
Jake Sanders
ed4ad50b22
Don't start the Gateway Shared Informer Factory if the Gateway API feature is disabled
Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2021-08-05 15:22:02 +01:00
Jake Sanders
36aa9e2501
The gateway-api support is now gated behind --feature-gate=ExperimentalGatewayAPISupport=true
Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2021-08-05 14:37:54 +01:00
Jake Sanders
27348a7072
Better error messages when Gateway API CRDs aren't installed
Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2021-08-03 14:21:02 +01:00
Jake Sanders
b38869b551
Gateway HTTP01: Make docs better, only enable gateway solver if gateway API is found
Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2021-08-02 14:06:23 +01:00
Jake Sanders
deb9ccc5a9
HTTP01 solver support for the Gateway API
Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2021-08-02 14:06:16 +01:00
jetstack-bot
d062176777
Merge pull request #4243 from inteon/improved_go_routines
Cleanup goroutine management
2021-07-28 15:36:41 +01:00
Inteon
78d13787e6
remove duplicated error messages & cobra help messages on error
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-28 15:55:14 +02:00
Inteon
d430113666
remove os.Exit from cert-manager controller and make sure LeaderElection ReleaseOnCancel works
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-27 21:40:42 +02:00
jetstack-bot
3b50d78ae4
Merge pull request #4225 from jakexks/ingressv1
Feature: Support both v1 and v1beta1 ingresses.
2021-07-27 20:11:37 +01:00
Inteon
48e9c2bd16
exit with exit code 0 on cancel & release leader-election on cancel
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-27 19:43:08 +02:00
irbekrm
2ddf6fe637 Allows for annotations passed from CSR to Order to be filtered
Using the value from copied-annotation-prefixes flag, where by default kubectl, fluxcd, argocd annotations are excluded

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-07-27 10:55:09 +01:00
Irbe Krumina
3834a8fc0a Code review feedback
Co-authored-by: Josh Van Leeuwen <joshua.vanleeuwen@jetstack.io>
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-07-26 20:00:37 +01:00
irbekrm
ddf7e130b7 Allow users to specify which annotations should be copied from Certificate to CertificateRequest
Default to all being copied except for kubectl, fluxcd, argocd annotations

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-07-26 20:00:10 +01:00
Jake Sanders
67c6586161
Addressing code review comments in #4225
Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2021-07-26 18:29:54 +01:00
Jake Sanders
0d93b93fc5
Feature: Support both v1 and v1beta1 ingresses.
Kubernetes is removing support for the v1beta1 Ingress type in 1.22: https://kubernetes.io/blog/2021/07/14/upcoming-changes-in-kubernetes-1-22/#api-changes
However, we still wish to support k8s v1.16 until mid 2022 when Openshift 3 becomes out of support.

cert-manager will now use v1 Ingress if available by using the discovery API.

Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2021-07-26 18:29:42 +01:00
joshvanl
b041a8fb3d Wires up ACME CSR controller
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-07-23 16:00:09 +01:00
Inteon
632459c6d9
resolve bug & cleanup
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-23 15:41:24 +02:00
Inteon
81e216eeba
wait for goroutines to end before exiting
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-23 15:30:26 +02:00
jetstack-bot
9ad9e220f3
Merge pull request #4230 from inteon/fix_exit_codes
set correct exit codes
2021-07-23 13:06:09 +01:00
Inteon
d6cd6f457d
set correct exit codes when exiting
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-22 12:57:08 +02:00
joshvanl
65cec6c212 Wires up Venafi CertificateSigningRequest controller
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-07-19 15:50:23 +01:00
Maël Valais
e5436df521 gateway-shim: don't crash cert-manager if the Gateway CRD isn't there
The Gateway CRD has to be installed, meaning that the CRDs may be
installed after cert-manager. We don't want cert-manager to crash in
that case; instead, we let the user know that cert-manager will keep
retrying looking for the CRDs with this message on startup:

  controller.go:181] cert-manager/controller/build-context "msg"="the
  Gateway API CRDs do not seem to be present, cert-manager will keep
  retrying watching for them"

The user then sees the following message printed (using an exponential
back-off):

  reflector.go:167: Failed to watch *v1alpha1.Gateway: failed to list
  *v1alpha1.Gateway: the server could not find the requested resource
  (get gateways.networking.x-k8s.io)

Signed-off-by: Maël Valais <mael@vls.dev>
2021-07-15 20:35:47 +02:00
Maël Valais
b5142f84c0 gateway-shim: only discover the gateway api when gateway-shim is enabled
Signed-off-by: Maël Valais <mael@vls.dev>
2021-07-15 20:35:34 +02:00
Maël Valais
30f9c123d3 gateway-shim: add the gateway-shim controller
Note that the gateway-shim is only half the work for supporting the
Gateway API in cert-manager. The other half is the HTTP01 solver
support, which is still worked on.

The Gateway API in cert-manager is releases as an experimental feature
and needs to be enabled manually with the following flag:

  --controllers=*,gateway-shim

All the annotations supported by ingress-shim are also supported by
gateway-shim, with some exceptions:

  "acme.cert-manager.io/http01-ingress-class"

This annotation is not supported on the Gateway resource. Although the
Gateway resource also has a "gatewayClass" field, we will need to add
another field instead of "ingress-class" to avoid confusion with the
ingress-shim.

  "acme.cert-manager.io/http01-edit-in-place"

This annotation is not supported because it is specific to some ingress
controllers like ingress-gce.

  "kubernetes.io/tls-acme"

This annotation is not supported because it is a behavior inherited from
kube-lego and we chose not to keep this behavior with the Gateway API.

Unlike the ingress-shim, you can reuse the same Secret name in multiple
TLS configurations on the same Gateway resource.

The ingress-shim now shows the exact location of the duplicate
secretName when the user gives the same secretName in two separate TLS
blocks.

Signed-off-by: Maël Valais <mael@vls.dev>
Co-authored-by: Jake Sanders <i@am.so-aweso.me>
2021-07-15 20:34:55 +02:00
joshvanl
d9be35c299 Wires up Vault CSR controller
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-06-29 09:11:43 +01:00
jetstack-bot
fbd2a6d06a
Merge pull request #4105 from kit837/add-clock-time-seconds
Add clock_time_seconds metric
2021-06-15 21:00:53 +01:00
kit837
0f97e6d19d pass in clock.Clock for better test
Signed-off-by: kit837 <66801824+kit837@users.noreply.github.com>
2021-06-15 17:48:20 +00:00
jetstack-bot
b8a1f3d6fb
Merge pull request #4070 from irbekrm/3969_parameterize_and_document_image_building
3969 parameterize and document image building
2021-06-15 16:45:53 +01:00
joshvanl
72800ae0f2 Wires up the SelfSigned CertificateSigningRequest controller
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-06-14 10:19:28 +01:00
irbekrm
4413774944 Removes unused Bazel deps
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-06-01 08:49:30 +01:00
irbekrm
d79a058b14 Allow controlling whether cgo is enabled via flags to Bazel
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-06-01 08:47:06 +01:00