Commit Graph

10 Commits

Author SHA1 Message Date
novahe
3262fdedea Certificate store: ensure data is written to disk
Kubernetes-commit: 653f48d8867d0b8487e3f824b3680ddc7d85758f
2025-03-30 10:46:59 +08: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
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
Jack Kleeman
29bb8bf344 Support intermediate certificate in certificate store
Kubernetes-commit: 83a223f5ee3790b7ed54197986d4317e75da1652
2020-03-02 19:48:38 +00:00
Davanum Srinivas
2537fc5f76 remove unused code
Change-Id: If821920ec8872e326b7d85437ad8d2620807799d

Kubernetes-commit: 7b8c9acc09d51a8f6018eafc49490102ae7cb0c4
2019-04-18 17:22:45 -04: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
Andrew Lytvynov
40fb7ab6be Allow inverted key/cert order in combined PEM file
certificate.FileStore only handles (cert, key) combined PEM files. This
PR allows (key, cert), which is what "openssl req -out foo.pem -keyout
foo.pem" generates.

Kubernetes-commit: 4b6a6a1cd5c8df83b3c51a03ecab975b82057489
2018-10-08 11:37:36 -07:00
Clayton Coleman
caf2e70aa1 When bootstrapping a client cert, store it with other client certs
The kubelet uses two different locations to store certificates on
initial bootstrap and then on subsequent rotation:

* bootstrap: certDir/kubelet-client.(crt|key)
* rotation:  certDir/kubelet-client-(DATE|current).pem

Bootstrap also creates an initial node.kubeconfig that points to the
certs. Unfortunately, with short rotation the node.kubeconfig then
becomes out of date because it points to the initial cert/key, not the
rotated cert key.

Alter the bootstrap code to store client certs exactly as if they would
be rotated (using the same cert Store code), and reference the PEM file
containing cert/key from node.kubeconfig, which is supported by kubectl
and other Go tooling. This ensures that the node.kubeconfig continues to
be valid past the first expiration.

Kubernetes-commit: 368959346af6e06085c63a4cc7c37839f262f636
2018-04-04 21:56:15 -04:00
Clayton Coleman
cb1d458c41 When cert dir is relative, cert rotation builds incorrect symlinks
Symlinks relative to a working directory were being constructed to the
wrong location, leading to failure to refresh client certs.

Kubernetes-commit: 3ec453d0d000a9bd3244d9d455f715bfe64d2e6b
2017-11-02 00:34:34 -04:00
Jacob Simpson
1bb4ecc0ae Move certificate manager to client.
Kubernetes-commit: 415c4d2c3af1fadb839bf4b73c6ea16db6b8c59f
2017-03-09 16:34:55 -08:00