Commit Graph

642 Commits

Author SHA1 Message Date
Wojciech Tyczyński
0527a0dd45 Cleanup rest storage resources on shutdown 2022-04-19 15:59:13 +02:00
Jefftree
67d3dbfaae Separate OpenAPI V2 and V3 Config 2022-03-29 17:49:56 -07:00
Patrick Ohly
7de1b05e85 logging: add ContextualLogging feature
InitLogs overrides the klog default and turns contextual logging off. This
ensures that it is only enabled in Kubernetes commands that explicitly enable
it via a feature gate. A feature gate for it gets defined in
k8s.io/component-base/logs and is then used by Options.ValidateAndApply.

The effect of disabling contextual logging is very limited according to
benchmarks with kube-scheduler. The feature gets added anyway to satisfy the
PRR recommendation that features should be controllable.

The following commands have support for contextual logging:
- kube-apiserver
- kube-controller-manager
- kubelet
- kube-scheduler
- component-base/logs example

Supporting a feature gate check in ValidateAndApply and not in InitLogs is a
simplification: changing InitLogs to accept a FeatureGate would have implied
changing also component-base/cli.Run. This didn't seem worthwhile because
ValidateAndApply already covers the relevant commands.
2022-03-29 13:29:57 +02:00
Wojciech Tyczyński
ef2e32ab65 Log main golang runtime env vars 2022-03-04 08:04:02 +01:00
Jian Zeng
9573b4a6b9
refactor(apiserver): remove the insecure flags
Signed-off-by: Jian Zeng <anonymousknight96@gmail.com>
2021-12-08 10:53:44 +08:00
Jiahui Feng
9c05de2f31 prune enum when OpenAPIEnums is disabled. 2021-11-09 13:00:00 -08:00
Patrick Ohly
4df70dfd41 component-base: initialize logging as soon as possible
In various places log messages where emitted as part of validation or even
before it (for example, cli.PrintFlags). Those log messages did not use the
final logging configuration, for example text output instead of JSON or not the
final verbosity. The last point became more obvious after moving the setup of
verbosity into logs.Options.Apply because PrintFlags never printed anything
anymore.

In order to force applications to deal with logging as soon as possible, the
Options.Validate and Options.Apply methods are now private. Applications should
use the new Options.ValidateAndApply directly after parsing.
2021-11-03 11:55:54 +01:00
Patrick Ohly
3948cb8d1b component-base: move v/vmodule/log-flush-frequency into LoggingConfiguration
These three options are the ones from logs.AddFlags which are not deprecated.
Therefore it makes sense to make them available also via the configuration file
support in the one command which currently supports that (kubelet).

Long-term, all commands should use LoggingConfiguration, either with a
configuration file (as in kubelet) or via flags (kube-scheduler,
kube-apiserver, kube-controller-manager).

Short-term, both approaches have to be supported. As the majority of the
commands only use logs.AddFlags, that function by default continues to register
the flags and only leaves that to Options.AddFlags when explicitly requested.

A drive-by bug fix is done for log flushing: the periodic flushing called
klog.Flush and therefore missed explicit flushing of the newer logr
backend. This bug was never present in any release Kubernetes and therefore the
fix is not submitted in a separate PR.
2021-11-03 07:41:46 +01:00
Lukasz Szaszkiewicz
9e2bdfee02 rename to muxAndDiscoveryComplete 2021-10-19 13:26:59 +02:00
Lukasz Szaszkiewicz
53867975e7 apiserver: indroduces NotFoundHanlder
The new handler is meant to be executed at the end of the delegation chain.
It simply checks if the request have been made before the server has installed all known HTTP paths.
In that case it returns a 503 response otherwise it returns a 404.

We don't want to add additional checks to the readyz path as it might prevent fixing bricked clusters.
This specific handler is meant to "protect" requests that arrive before the paths and handlers are fully initialized.
2021-10-19 09:55:04 +02:00
Lukasz Szaszkiewicz
7a342a0f8a kube-apiserver: wires the notFoundHandler 2021-10-18 12:41:42 +02:00
Abu Kashem
28f2b42a41
apf: update apf logic to use v1beta2 2021-09-09 08:28:58 -04:00
Antonio Ojea
0cd75e8fec run hack/update-netparse-cve.sh 2021-08-20 10:42:09 +02:00
Kubernetes Prow Robot
3c72622a1f
Merge pull request #104229 from astraw99/fix_trivial_code
Fix single pointer variable parenthesis
2021-08-12 21:16:31 -07:00
astraw99
ff7307bf9c fix single pointer variable 2021-08-11 10:40:10 +08:00
David Ashpole
9dd59017c4 add tracing to webhook requests 2021-07-09 06:30:05 -07:00
David Ashpole
71f810bb71 Add distributed tracing to the etcd client 2021-06-26 09:19:39 -07:00
David Ashpole
79550ed40c Add distributed tracing to the apiserver using OpenTelemetry 2021-06-25 05:20:27 -07:00
Mike Spreitzer
0762f492c5 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
2021-06-23 14:06:50 -04:00
Kubernetes Prow Robot
57fbeb8030
Merge pull request #101993 from wongma7/waitforetcd
Remove etcd connection apiserver preflight check
2021-06-08 12:26:20 -07:00
David Eads
84590fe27c remove --ssh- options, deprecated 13 releases, that only work on GCE 2021-06-03 13:54:35 -04:00
Danil-Grigorev
5d57b3794c Add DisableCloudProviders FG
FeatureGate acts as a secondary switch to disable cloud-controller loops
in KCM, Kubelet and KAPI.

Provide comprehensive logging information to users, so they will be
guided in adoption of out-of-tree cloud provider implementation.
2021-05-21 16:09:44 +02:00
Matthew Wong
c201a78dff Remove etcd connection apiserver preflight check 2021-05-19 13:46:20 -07:00
Kubernetes Prow Robot
8365e2384c
Merge pull request #101187 from GreenApple10/feature/import_cleanup
remove duplicate packet import
2021-04-30 12:06:25 -07:00
Kubernetes Prow Robot
fbc93bd34c
Merge pull request #101403 from wangyx1992/redundant-silce-nilcheck
cleanup: omit redundant nil check around loop in apiserver
2021-04-27 12:31:38 -07:00
Kubernetes Prow Robot
e640a01219
Merge pull request #101068 from BinacsLee/binacs-apiserver-remove-useless-code-logic
code cleanup: apiserver remove useless code logic
2021-04-26 00:03:01 -07:00
wangyx1992
b9ea207ff7 cleanup: omit redundant nil check around loop in apiserver
Signed-off-by: wangyx1992 <wang.yixiang@zte.com.cn>
2021-04-23 11:38:28 +08:00
BinacsLee
75dde4dce4 code cleanup: Abstract repetitive codes in cmd as a function 2021-04-22 23:35:04 +08:00
Shihang Zhang
925900317e allow multiple of --service-account-issuer 2021-04-19 09:54:11 -07:00
c00522440
a1335cba68 del duplicate import 2021-04-16 16:57:57 +08:00
BinacsLee
802a50e4e9 code cleanup: apiserver remove useless code logic 2021-04-13 21:33:41 +08:00
xiongzhongliang
e6d6409cf8 remove duplicated validation for service-cluster-ip-range 2021-03-19 11:17:07 +08:00
xiongzhongliang
00bfd28fbd fix some hardcoding
fix some hardcoding
2021-02-20 01:27:54 +08:00
Michael Taufen
6aa80d9172 Graduate ServiceAccountIssuerDiscovery to GA
Waiting on KEP updates first:
https://github.com/kubernetes/enhancements/pull/2363
2021-02-01 11:44:23 -08:00
yue9944882
849be447f5 APF: graduate API and types to beta
Signed-off-by: Adhityaa Chandrasekar <adtac@google.com>
2020-11-13 23:20:39 +00:00
Kubernetes Prow Robot
281866b35c
Merge pull request #95533 from roycaihw/apiserver-lease-controller
Add kube-apiserver lease controller
2020-11-06 18:09:37 -08:00
Haowei Cai
3761a00e5b add kube-apiserver-lease-controller poststart hook 2020-11-06 13:33:08 -08:00
Kubernetes Prow Robot
d16112f76c
Merge pull request #96052 from wojtek-t/fix_watchcache_size
Disable watchcache for events
2020-11-02 07:30:53 -08:00
wojtekt
5a8f94cb30 Disable watchcache for events 2020-10-31 19:51:33 +01:00
Kubernetes Prow Robot
1968e96165
Merge pull request #95856 from knight42/refactor/disable-apiserver-insecure-port
refactor(apiserver): disable insecure port
2020-10-29 10:47:58 -07:00
knight42
cfc2b330a7
refactor(apiserver): ignore the insecure flags
Leave the insecure flags intact but stop serving on insecure port.
2020-10-29 23:20:17 +08:00
Andrew Sy Kim
a0aebf96ec apiserver: support egress selection name 'controlplane' and deprecate 'master'
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
2020-10-26 10:24:16 -04:00
Daniel Smith
13b6a929bc It's an 'Instance' of apiserver 2020-09-24 16:14:29 -04:00
Daniel Smith
a86afc12df update scripts 2020-09-02 10:49:40 -07:00
Daniel Smith
15e0e3e90e rename 2020-09-02 10:48:26 -07:00
Kubernetes Prow Robot
2d327ac455
Merge pull request #91539 from andrewsykim/fix-cloud-provider-deprecation
only log cloud provider deprecation warning for in-tree components
2020-07-10 00:59:48 -07:00
Kubernetes Prow Robot
8ec5747fe5
Merge pull request #91501 from tahsinrahman/add-apiserver-logging-flag
Add `--logging-format` flag for kube-apiserver
2020-07-03 12:24:47 -07:00
Kubernetes Prow Robot
7151131d79
Merge pull request #73032 from liggitt/kubectl-warning
surface server-side warnings in client-go / kubectl
2020-06-12 17:09:56 -07:00
Jordan Liggitt
0d674c4edb cmd: silence warnings in kube-controller-manager/kube-apiserver, dedupe/color warnings in kubectl 2020-06-11 16:04:19 -04:00
wojtekt
5ceb53987b Remove heuristic watchcache sizes 2020-06-08 13:32:52 +02:00