Commit Graph

351 Commits

Author SHA1 Message Date
Stephen Augustus 771ffe6475 generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>

Kubernetes-commit: 481cf6fbe753b9eb2a47ced179211206b0a99540
2021-08-12 17:13:11 -04:00
Antonio Ojea 38c6ad936b run hack/update-netparse-cve.sh
Kubernetes-commit: 0cd75e8fec62a2531637e80bb950ac9983cac1b0
2021-08-20 01:16:14 +02:00
Abu Kashem 450b7e8f12 rename audit Checker interface
Kubernetes-commit: 27f150351475adaef416bd893403e7066b70d33a
2021-03-24 13:07:21 -04:00
Abu Kashem f3ae70d0cf send retry-after until ready
Kubernetes-commit: 6e3923d0a4f4720d2d9f628eb9c073d2d3ee291a
2021-08-10 12:03:21 -04:00
Abu Kashem ffb869e08f apiserver: add a new mode for graceful termination
add a new mode for graceful termination with the new server run option
'shutdown-send-retry-after'
- shutdown-send-retry-after=true: we initiate shutdown of the
  HTTP Server when all in-flight request(s) have been drained. during
  this window all incoming requests are rejected with status code
  429 and the following response headers:
    - 'Retry-After: N' - client should retry after N seconds
    - 'Connection: close' - tear down the TCP connection
- shutdown-send-retry-after=false: we initiate shutdown of the
  HTTP Server as soon as shutdown-delay-duration has elapsed. This
  is in keeping with the current behavior.

Kubernetes-commit: 3182b69e970bd1fd036ff839fdf811f14e790244
2021-07-14 10:39:29 -04:00
Abu Kashem feb4eefe1c apiserver: add callback to get notified of object count
Kubernetes-commit: 2c60feffbee690af4632d068158e640abe10f678
2021-07-14 16:44:34 -04:00
Alexi Kessler 80b28d7c2c Update doc description for --audit-log-maxbackup
Per https://pkg.go.dev/gopkg.in/natefinch/lumberjack.v1 a value of 0 will retain all logs. Not understanding this led to an outage for my team.

Kubernetes-commit: 94977dce8d13ec1e8b4bd8b449f555af685c3ab6
2021-07-22 09:42:30 -04:00
Andrew Rynhard bfbd0aaa7d Do not try to create an audit log file named "-"
That PR fixes --audit-log-path=- support.
It now logs to stdout as in 1.21.

Kubernetes-commit: 7728428f017350d5fb9a91e6e5dc3ccf86348478
2021-07-23 14:26:28 +00:00
Ryan Phillips 7afffd8ef3 Revert "apiserver: add callback to get notified of object count"
Kubernetes-commit: d95b14e1abfb5ec87248e5dd826b89d0c738af42
2021-07-08 13:56:39 -05:00
David Ashpole fe620be9c7 change tracing service from kube-apiserver to apiserver
Kubernetes-commit: 8972efc65fe7f4d2ed840ba1a2bd8ff31e829a7a
2021-07-02 07:04:26 -07:00
Abu Kashem d929410e13 apiserver: add callback to get notified of object count
Kubernetes-commit: 1002b0d163dd948334f10b0e25d0e91d253791e8
2021-06-18 10:44:07 -04:00
David Ashpole 71612b014d move tracing instantiation further up, and check for nil
Kubernetes-commit: b0ffaa93f5c607325203f978c1ae685d6b64d053
2021-07-01 10:42:11 -07:00
David Ashpole 5053bddd06 add tracing to the apiserver's client-go requests
Kubernetes-commit: 79d400c4416f903af604fb2cf07d2c34bb4b98f7
2021-06-26 09:16:32 -07:00
Lukasz Szaszkiewicz 9ff2637133 adds metrics for authorization webhook
Kubernetes-commit: 4a2aef00d6dd2543b011aa7e5af28df598a0cd72
2021-03-17 16:30:40 +01:00
Lukasz Szaszkiewicz 69433684ce adds metrics for authentication webhook
Kubernetes-commit: 322c18c147da08dd2eea25ba3c2b9630a228cf5f
2021-02-23 08:39:25 +01:00
David Ashpole 5927da0040 Add distributed tracing to the apiserver using OpenTelemetry
Kubernetes-commit: 79550ed40c67a70534c1cb697e1fb7e7dbf96335
2021-06-25 05:20:16 -07:00
Mike Spreitzer feae5f3e79 Add config checking for inflight limits
When API Priority and Fairness is enabled, the inflight limits must
add up to something positive.
This rejects the configuration that prompted
https://github.com/kubernetes/kubernetes/issues/102885

Update help for max inflight flags

Kubernetes-commit: 0762f492c5b850471723a305cfa7390e44851145
2021-06-21 16:53:07 -04:00
Jordan Liggitt 84ac736f8e Fix audit unit test file location
Kubernetes-commit: 91e5d98b572a74bf827a575559238cc0a4be6c57
2021-06-04 17:23:34 -04:00
Chao Xu 218926b065 Switch the order of adding SNICert and creating LoopbackClientConfig
Kubernetes-commit: 1df4503b859a2b7b2b7f9c5bcf400f61cc29d349
2021-04-22 23:17:39 +00:00
Juan Antonio Osorio Robles 332add01ef Ensure audit log permissions are restricted
While the apiserver audit options merely use the lumberjack logger in
order to write the appropriate log files, this library has very loose
permissions by default for these files [1]. However, this library will
respect the permissions that the file has, if it exists already. This is
also the most tested scenario in the library [2].

So, let's follow the pattern marked in the library's tests and
pre-create the audit log file with an appropriate mode.

[1] https://github.com/natefinch/lumberjack/blob/v2.0/lumberjack.go#L280
[2] https://github.com/natefinch/lumberjack/blob/v2.0/linux_test.go

Signed-off-by: Juan Antonio Osorio Robles <jaosorior@redhat.com>

Kubernetes-commit: 42df7bc5b3aa26bf545b6392b557833c7162c472
2020-10-08 09:38:57 +03:00
Mike Danese a6a121887a force implementors of dyanmiccertificates providers to think about notify
Right now, `_, ok := provider.(Notifier); !ok` can mean one of two
things:

1. The provider does not support notification because the provided
   content is static.
2. The implementor of the provider hasn't gotten around to implementing
   Notifier yet.

These have very different implications. We should not force consumers of
these interfaces to have to figure out the static of Notifier across
sometimes numerous different implementations. Instead, we should force
implementors to implement Notifier, even if it's a noop.

Change-Id: Ie7a26697a9a17790bfaa58d67045663bcc71e3cb

Kubernetes-commit: 9b7d654a08d694d20226609f7075b112fb18639b
2021-04-09 16:59:17 -07:00
Lukasz Szaszkiewicz 49d90ce0ad DelegatingAuthenticationOptions TokenReview request timeout
it turns out that setting a timeout on HTTP client affect watch requests made by the delegated authentication component.
with a 10 second timeout watch requests are being re-established exactly after 10 seconds even though the default request timeout for them is ~5 minutes.

this is because if multiple timeouts were set, the stdlib picks the smaller timeout to be applied, leaving other useless.
for more details see a937729c2c/src/net/http/client.go (L364)

instead of setting a timeout on the HTTP client we should use context for cancellation.

Kubernetes-commit: d690d71d27c78f2f7981b286f5b584455ff30246
2021-04-09 13:20:51 +02:00
Lukasz Szaszkiewicz b5be45a80f DelegatingAuthOptions: allows for specifying a middleware function for custom HTTP behaviour for the auth webhook client
Kubernetes-commit: ea7d94497b5fef2fe7b925d378f425b94448f01b
2021-03-04 12:35:09 +01:00
xiongzhongliang fbe8ccc9bd Optimize some codes
Kubernetes-commit: 4a24a08f936a295bf332b9567bea182e2feff554
2021-02-28 01:00:09 +08:00
Monis Khan 63ca1f6039 delegated authn: allow client CA override based on non-empty opts
Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: 6686d8b846546f682d1a449cc9cd0e3c0de977b4
2021-03-09 22:53:04 -05:00
carlory 146083d06b deprecate audit.k8s.io/v1[alpha|beta]1 versions
Kubernetes-commit: cad9c245b84fd16cbb5bf240622af07ce7bc3585
2021-02-08 11:22:29 +08:00
yue9944882 d3f04fd7c9 support storage encryption for aa server
Kubernetes-commit: dcf4821cd4c798aa08e6b31c5474717c7164945a
2021-02-18 19:10:50 +08:00
Maurizio Drocco 353b45e333 Update etcd.go
Kubernetes-commit: f6ac24bfd86d9dfce6a8ff0d611b4fdabc7bc504
2020-04-13 13:29:18 -04:00
Maurizio Drocco 68a0c4dbb1 Update etcd.go
Kubernetes-commit: 368e976113ca035854083212275a0c39373f152e
2020-04-10 13:21:59 -04:00
Maurizio Drocco 05f1caa35b Update etcd.go
Kubernetes-commit: 5c3d6a26a11875a8305832fa681cc5929d159eb2
2020-04-10 11:12:26 -04:00
Maurizio Drocco 442d715210 added note on --etcd-servers-overrides
Added a note on etcd-servers-overrides option, to clarify CRDs are not supported (yet).

Kubernetes-commit: 4a71f84a30107abde63b66424c2f8d55acde7ffe
2020-04-10 10:14:50 -04:00
Nikhita Raghunath d22b238769 *: remove nikhiljindal from OWNERS
Kubernetes-commit: 6cef3a4e33c10c27bb301a1070ea3ff4cdad0c39
2021-02-16 10:50:50 +05:30
Dr. Stefan Schimanski 482cbd8dcc apiserver: add --permit-address-sharing flag to listen with SO_REUSEADDR
Kubernetes-commit: cef2ab700fc7d9ce226ab51f78344c907dfbb831
2020-08-10 15:51:37 +02:00
David Eads 4925be5c06 Update delegated authorization options default to eliminate unnecessary
SARs

healthz, readyz, and livez are canonical names for checks that the kubelet does.  By default, allow access to them in the options. Callers can adjust the defaults if they have a reason to require checks.

system:masters has full power, so the authorization check is unnecessary and just uses an extra call for in-cluster access.  Callers can adjust the defaults if they have a reason to require checks.

Kubernetes-commit: cebce291ddcb8490a705c79623c0b4f13faef6e7
2021-01-22 16:16:14 -05:00
pacoxu 2343af38bb fix all keps links 404 for kep folder migration
Signed-off-by: pacoxu <paco.xu@daocloud.io>

Kubernetes-commit: a10bdfed09e96f3c2703454caafa2c884914e064
2021-01-14 14:03:21 +08:00
xiongzhongliang 351f1ab57a use klog.Info and klog.Warning when had no format
Kubernetes-commit: 90f4aeeea4cc5f96caa6ed87c67ca7e62d1ba21c
2020-11-14 00:55:06 +08:00
yue9944882 9db9b5f556 disables APF if the aggregated apiserver cannot locate the core kube-apiserver
Kubernetes-commit: 02df343437ca9331ab6b0a0de65858c68ba47a54
2021-01-12 18:08:46 +08:00
KeZhang 23abb6c50f Fix HSTS Missing From HTTPS Server(Nessus Scanner)
Kubernetes-commit: 4801f4d25506dbfed834c67e3fc363bfab54a48e
2020-11-12 16:10:58 +08:00
yue9944882 54481aaf0e fixes nil panic for nil delegated auth options
Kubernetes-commit: 9ade821baab1fa5573f4a36eb7d7098b033ec17c
2021-01-12 17:12:33 +08:00
Ling Samuel bd7da186cc apiserver add metric etcd_lease_object_counts
Signed-off-by: Ling Samuel <lingsamuelgrace@gmail.com>

Kubernetes-commit: 7e9fe39cd7c3ee67fcc29e6ca0836917c5a4e9e1
2020-12-07 10:45:44 +08:00
Antonio Ojea bd10b9f5fb bind-address flag usage
Kubernetes-commit: 2e4aed2d4a8dc32acbd12ee7464fa00e650e0204
2020-12-11 18:42:51 +01:00
Ling Samuel f673ce24f7 apiserver add --lease-reuse-duration-seconds to config lease reuse duration
Signed-off-by: Ling Samuel <lingsamuelgrace@gmail.com>

Kubernetes-commit: c99567005db15d220f2b792e98af735c5aa24f6e
2020-12-02 17:35:10 +08:00
Stefan Bueringer c8433b21e4 fix staticcheck: vendor/k8s.io/apiserver/pkg/server
Kubernetes-commit: ed0adcb65e92198177bf23db97807b3312d6be29
2020-11-17 11:58:13 +01:00
yue9944882 a4a3fc9b87 APF: graduate API and types to beta
Signed-off-by: Adhityaa Chandrasekar <adtac@google.com>

Kubernetes-commit: 849be447f563fc93a27a0827fb1185b885b57114
2020-11-04 16:33:14 +08:00
Lukasz Szaszkiewicz e275c178b6 DelegatingAuthenticationOptions: allows for setting a timeout for the TokenReview client that is used by for the webhook authenticator
Previously no timeout was set. Requests without explicit timeout might potentially hang forever and lead to starvation of the application.
When no timeout was specified a default one will be applied.

Kubernetes-commit: 7340c3498ac23f46fc8b6bff4d5ac664a9c64a3b
2020-11-04 11:14:44 +01:00
Patrik Cyvoct ddd0b07a5a Allow configuration of etcd healthcheck timeout
Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>

Kubernetes-commit: 2e430ba622817b534642fd93098f87ea7f983aee
2020-07-20 09:22:13 +02:00
Abu Kashem 5254108841 make backoff parameters configurable for webhook
Currently webhook retry backoff parameters are hard coded, we want
to have the ability to configure the backoff parameters for webhook
retry logic.

Kubernetes-commit: 53a1307f68ccf6c9ffd252eeea2b333e818c1103
2020-10-30 11:25:32 -04:00
卢振兴10069964 3e37d6db5c add audit-log-compress to apiserver
Kubernetes-commit: 9470f64a4f8af6439cb6c5c35335121446faade3
2020-08-18 11:26:07 +08:00
Lukasz Szaszkiewicz 972d12cb5f DelegatingAuthorizationOptions: exposes and sets a default timeout for SubjectAccessReview client
previously no timeout was set. Requests without explicit timeout might potentially hang forever and lead to starvation of the application.

Kubernetes-commit: 2160cbc53fdd27a3cbc1b361e523abda4c39ac42
2020-10-20 14:39:45 +02:00
Andrew Sy Kim 6746ccadda apiserver: support egress selection name 'controlplane' and deprecate 'master'
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>

Kubernetes-commit: a0aebf96ec2eef6517e2611335f0e6c9375dd807
2020-10-26 10:24:16 -04:00