Commit Graph
519 Commits
Author SHA1 Message Date
Eng Zer Jun 54e70d2cc4 refactor: move from io/ioutil to io and os package
The io/ioutil package has been deprecated in Go 1.16. This commit
replaces the existing io/ioutil functions with their new definitions in
io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-08-23 19:50:42 +08: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
jetstack-botandGitHub 9d1c6c9f09 Merge pull request #4347 from inteon/fix_install
Don't wait for hooks in kubectl cert-manager x install integration test (part 2)
2021-08-13 09:36:11 +02:00
Inteon f4bc283965 update comments
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-08-12 22:54:14 +02:00
Inteon 91ec4c773a use correct contexts everywhere & don't restart apiserver to add crds
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-08-12 20:05:01 +02:00
Inteon e5df60d47e don't wait for hooks in kubectl cert-manager x install test & use local chart for tests
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-08-11 23:18:33 +02:00
Inteon a569e79776 cleanup test contexts
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-08-06 17:31:19 +02: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
jetstack-botandGitHub d647e543e3 Merge pull request #4276 from jakexks/gateway-http01
Experimental Gateway API support for ACME HTTP-01 Solving
2021-08-03 18:51:49 +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
jetstack-botandGitHub d0f4c82baf Merge pull request #4226 from inteon/simple_kubectl_check_version
add 'kubectl cert-manager version'
2021-08-03 12:36:19 +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
InteonandRichard Wall 85710579dd Apply suggestions from code review
Co-authored-by: Richard Wall <wallrj@users.noreply.github.com>
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-30 17:00:27 +02:00
Inteon 644db10b92 don't early-stop, instead return all versions
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-29 15:06:31 +02:00
jetstack-botandGitHub b92fc91208 Merge pull request #4267 from JoshVanL/ctl-remove-pkg-util
Move exported cmd util func to package where it is used
2021-07-29 11:02:12 +01:00
jetstack-botandGitHub 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
joshvanl 1f4343d98e Move exported cmd util func to package where it is used. Removes util
package

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-07-28 14:25:17 +01: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-botandGitHub 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
Inteon 6545064fcf align flags and behaviour to 'kubectl version'
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-27 18:02:21 +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 KruminaandJosh Van Leeuwen 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
jetstack-botandGitHub 218408a741 Merge pull request #4112 from JoshVanL/certificate-signing-request=acme
CertificateSigningRequest ACME Controller
2021-07-26 11:51:12 +01:00
jetstack-botandGitHub 77c5c2fb16 Merge pull request #4184 from inteon/kubectl_certmanager_install_tests
Add basic tests to kubectl cert-manager x install
2021-07-23 16:16:19 +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
Inteon f11c44dd15 acme solver wait for server to shutdown
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-23 15:30:02 +02:00
Inteon 0ed0135930 Improvements based on reviewer's feedback
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-23 15:29:43 +02:00
jetstack-botandGitHub 9ad9e220f3 Merge pull request #4230 from inteon/fix_exit_codes
set correct exit codes
2021-07-23 13:06:09 +01:00
Inteon 50daf04118 rename cmdutil to k8scmdutil
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-22 21:43:53 +02: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
jetstack-botandGitHub 88e85d0725 Merge pull request #4205 from inteon/kubectl_check_api
Add kubectl 'cert-manager check api' command
2021-07-16 14:43:15 +01:00
Inteon 21bc98979e improved ux
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-16 13:11:40 +02: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 ValaisandJake Sanders 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
Inteon ac7775bdb4 made errors human readable, added unit tests, added check api to e2e, fixed os.Exit(1)
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-15 16:50:31 +02:00
Inteon 5458173739 Add kubectl 'cert-manager check api' command
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-15 16:50:31 +02:00
Inteon 611bac67cf Add basic test cases
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-08 16:28:38 +02:00
jetstack-botandGitHub e51bfe560c Merge pull request #4138 from inteon/kubectl_certmanager_install_preview
Basic install functionality for kubectl plugin
2021-07-05 09:02:44 +01:00
Inteon d4e8aad895 remove unused function
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-03 00:31:48 +02:00