Commit Graph

20 Commits

Author SHA1 Message Date
PatrickLaabs
286cc8368b chore: depr. pointer pkg replacement for the csr
Kubernetes-commit: 6c3146e3557e1de3d617f49d0b64ee380a42a8b1
2025-07-03 11:34:13 +02:00
Patrick Ohly
d0f5d55191 client-go certificate: context-aware APIs and logging
For NewManager, the Config struct gets changed (not extended!) so that the
caller can provide a logger instead of just a logging function. Breaking the
API was chosen because it avoids having to maintain two different log calls in
various places (one for printf-style logging, one for structured logging).

RequestCertificateWithContext is an extension. It enables getting rid of
context.TODO calls.

NewFileStoreWithLogger also is an extension.

Kubernetes-commit: f9051901cee8d8ff4aed3db27ff495a706f1a487
2024-12-09 12:45:54 +01:00
HaoJie Liu
2f582c2a40 Fix:import the same package multiple times
Signed-off-by: HaoJie Liu <liuhaojie@beyondcent.com>

Kubernetes-commit: 4f0a0ec81c649727cfc62cf8c0a2ad7eabf12516
2022-07-12 17:41:37 +08:00
Monis Khan
30cd4e9a49 csr: add expirationSeconds field to control cert lifetime
This change updates the CSR API to add a new, optional field called
expirationSeconds.  This field is a request to the signer for the
maximum duration the client wishes the cert to have.  The signer is
free to ignore this request based on its own internal policy.  The
signers built-in to KCM will honor this field if it is not set to a
value greater than --cluster-signing-duration.  The minimum allowed
value for this field is 600 seconds (ten minutes).

This change will help enforce safer durations for certificates in
the Kube ecosystem and will help related projects such as
cert-manager with their migration to the Kube CSR API.

Future enhancements may update the Kubelet to take advantage of this
field when it is configured in a way that can tolerate shorter
certificate lifespans with regular rotation.

Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: cd91e59f7c351fce47c064a5162c2cb79075159c
2021-06-25 22:08:10 -04:00
Jordan Liggitt
3ab7d09ea9 Switch cert manager to v1 CSR API by default, falling back to v1beta1
Kubernetes-commit: a298c14f18d4973a9ceaf21f1e0dc4e39b4c5bfb
2020-06-03 22:40:02 -04:00
Jordan Liggitt
198e8f5ee4 Switch issued check to inspect certificate length
Kubernetes-commit: 94fd1d76ca0e8992b000fbb6b1562c11c37df7cb
2020-05-28 10:48:49 -04:00
Jordan Liggitt
e72c3d3ce2 Stop waiting for failed CSRs
Kubernetes-commit: 184b3f81adcf73fe063579eeef41f5bc9c6ae19a
2020-04-16 01:06:10 -04:00
Davanum Srinivas
75fea27a27 switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 442a69c3bdf6fe8e525b05887e57d89db1e2f3a5
2020-04-17 15:25:06 -04:00
James Munnelly
0c19a3c0da Extend client-go csr package to invalidate CSRs based on signerName
Kubernetes-commit: c2367bd5da68112ad3031dd33933859dacf8db58
2020-03-03 13:14:04 +00:00
James Munnelly
e8be24fd4c certificates: update controllers to understand signerName field
Signed-off-by: James Munnelly <james.munnelly@jetstack.io>

Kubernetes-commit: d5dae048983cd299cdce9d2703f564bf4bd246ee
2020-02-17 23:06:02 +00:00
Jiahui Feng
9d42b5ecf1 add logging for csr being approved and issued.
Kubernetes-commit: fdd7424d191b43bc9b1c4364ddf9c88547883072
2020-02-12 11:09:56 -08:00
Mike Danese
6659ae5216 generated: run refactor
Kubernetes-commit: 25651408aeadf38c3df7ea8c760e7519fd37d625
2020-02-08 12:30:21 -05:00
Mike Danese
60a0346672 generated: run refactor
Kubernetes-commit: 3aa59f7f3077642592dc8a864fcef8ba98699894
2020-02-07 18:16:47 -08:00
Jordan Liggitt
987d27d1af Interrupt WaitForCertificate if desired kubelet serving cert changes
Kubernetes-commit: 739a75fc32c5337ddbd13691e9bf6648fb13ff0d
2019-05-15 11:47:23 -04:00
Tomas Nozicka
0dbe75c417 Switch WaitForCertificate to informers to avoid broken watches
Kubernetes-commit: a7588723f7e9b88c2e8b9d601a2391e0f6b19a17
2019-01-17 18:32:36 +01:00
Andrew Lytvynov
5dc6658914 Move csr.RequestNodeCertificate into kubelet bootstrap package
This func is only used by the kubelet and there's no need to pollute
client-go API with it.

Kubernetes-commit: 5c073abfe16fc0b9f62310b8276fc3b0c7043e60
2018-11-12 16:53:53 -08:00
Andrew Lytvynov
28931a70f2 Unexport csr.ParseCSR
This func is only used internally and was copied from
k8s.io/kubernetes/pkg/apis/certificates.

Kubernetes-commit: 41334cfdd3eefc352536943518ffd9eaf570e27c
2018-11-12 17:15:09 -08:00
Davanum Srinivas
74cd8bbeee Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135

Kubernetes-commit: 954996e231074dc7429f7be1256a579bedd8344c
2018-11-09 13:49:10 -05:00
Tomas Nozicka
6dac86f710 Deprecate ListWatchUntil, fix it and call places
Kubernetes-commit: e434f3189e81e473aa89e3589ca81545d1341cf8
2018-08-03 16:08:28 +02:00
Clayton Coleman
1372839f29 Move pkg/kubelet/util/csr into client-go
Everything else it depends on was already there, and now we have a
somewhat consistent code chain.

Kubernetes-commit: 5649f9a578f4f130f61579d77d5609fbdaf82a1f
2017-10-10 20:15:03 -04:00