Commit Graph

69 Commits

Author SHA1 Message Date
Luca Comellini
a57c4abb14 Bump k8s.io dependencies
Signed-off-by: Luca Comellini <luca.com@gmail.com>
2023-05-05 16:32:25 +01:00
Tim Ramlot
927cef3c22
switch to SSA for cainjector
Co-authored-by: joshvanl <vleeuwenjoshua@gmail.com>
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-04-26 17:04:11 +02:00
Richard Wall
b91e0531ed Upgrade to Go 1.20
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2023-04-20 16:55:44 +01:00
jetstack-bot
bfa7eaaf0d
Merge pull request #5766 from irbekrm/cainjector_limit_controllers
Cainjector limit controllers
2023-04-18 11:14:21 +01:00
irbekrm
e49c1f0a74 Code review feedback
Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-04-18 10:36:28 +01:00
Luca Comellini
9219bc409b
Bump Helm to v3.11.2
Signed-off-by: Luca Comellini <luca.com@gmail.com>
2023-04-11 11:39:37 -07:00
Tim Ramlot
1d28b4f31c
Bump k8s.io dependencies
Signed-off-by: Luca Comellini <luca.com@gmail.com>
2023-04-07 10:36:47 +02:00
Tim Ramlot
380359b586
run 'make update-licenses'
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-04-06 22:29:59 +02:00
Maël Valais
e9f81ddc1c go work sync
Signed-off-by: Maël Valais <mael@vls.dev>
2023-04-06 16:34:21 +02:00
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
irbekrm
56cf4dfd3c Allows to modify configured injectable kinds for cainjector via flags
Also changes name of --watch-certs flag to --enable-certificate-data-source

Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-02-01 11:43:00 +00:00
irbekrm
3aba8ed32d Makes cainjector Certificate watch optional
Configurable via a flag, true by default

Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-01-24 13:52:45 +00:00
irbekrm
4776597cb4 Remove the double cache mechanism for cainjector
Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-01-23 17:38:46 +00:00
irbekrm
87bef52337 Fix cainjector's namespace flag
Ensures that when cainjector has the namespace flag passed, namespaced resource caching is scoped to that namespace

Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-01-05 18:15:19 +00: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
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
joshvanl
0bba16e0f9 Adds empty feature set for cainjector. Parses feature gates in devel
script, and passes them on to each component

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-02-07 14:39:46 +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
DiptoChakrabarty
b0e2264b60 add go linters
Signed-off-by: DiptoChakrabarty <diptochuck123@gmail.com>
2022-01-13 00:12:15 +05:30
irbekrm
f4452f1cfa Fix some flag descriptions
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-12-31 09:15:32 +00:00
irbekrm
c58b73edeb Pprof can be optionally run for cainjector
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-10-26 12:21:21 +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
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
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
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
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
Tamal Saha
7b63788f52 Cleanup codegen script
Signed-off-by: Tamal Saha <tamal@appscode.com>
2021-05-17 08:11:19 -07:00
irbekrm
34fd9e9fef Makes /cmd/cainjector/main more DRY
reuses util.ContextWithStopCh to create a context with cancel func

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-01-27 13:32:23 +00:00
Julien ALEXANDRE
f8fbea38b3
Add flags to configure cainjector leader election
This commit enables users to customize the behavior of the cainjector
regarding leader election by adding `--leader-election-lease-duration`,
`--leader-election-renew-deadline` and `--leader-election-retry-period`
flags. These flags are already available on the controller.

Prior to this change, the values of these options were inherited from
controller-runtime. This commit keeps the same defaults for the
cainjector, for backward compatibility, even though they differ from
those of the controller.

Signed-off-by: Julien ALEXANDRE <22328659+ndrpnt@users.noreply.github.com>
2020-12-19 18:00:54 +01:00
Maartje Eyskens
ab0cd57dc5 Use The cert-manager Authors.
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-12-11 19:04:13 +01:00
Maartje Eyskens
1788a9d758 Update copyright to cert-manager project
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-12-08 19:04:49 +01:00
Richard Wall
c3e79865ca Exit(1) and explain what causes the context to be cancelled
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-18 10:24:10 +01:00
Richard Wall
392ed06cfc Explain why we start the two controllers in separate goroutines
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-18 10:21:21 +01:00
Richard Wall
4fd5cd6b3c Avoid launching controller goroutines during shutdown of unelected
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-18 10:15:14 +01:00
Richard Wall
e2765f720a Remove debug log
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-18 10:04:28 +01:00
Richard Wall
b772f3295b Use cancellable contexts and errgroups
...to control the starting and stopping of controllers and caches

Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-17 09:37:05 +01:00
Richard Wall
81874895b0 Use NewUnmanaged and separate caches for each controller
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-11 10:09:27 +01:00
Richard Wall
bcff4edb0f Run both controllers in a single goroutine with a single manager
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-10 13:54:50 +01:00
Richard Wall
ba02ea4120 Revert "Refactor the cainjector to only have 1 leader election"
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-04 16:54:16 +01:00
Maartje Eyskens
8b7552cec1 Refactor the cainjector to only have 1 leader election
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-17 11:16:48 +02:00
Maartje Eyskens
3259fdfe9b Implement feedback
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-12 10:59:42 +02:00
Maartje Eyskens
827ce9c5ad Revert log levels on errors
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-12 10:59:42 +02:00
Maartje Eyskens
5d4869b20e Fix formatted logs
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-12 10:59:41 +02:00
Maartje Eyskens
fecd0b3518 Set all log levels for info
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-12 10:59:41 +02:00
Maartje Eyskens
9dd00905e9 Update klog
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>

klog v2

Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-12 10:59:41 +02:00
JoshVanL
0657e34396
Moves cobra commands from cmd -> app
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2020-04-30 12:14:51 +01:00