Commit Graph

108094 Commits

Author SHA1 Message Date
Patrick Ohly
9eaa2dc554 avoid klog Info calls without verbosity
In the following code pattern, the log message will get logged with v=0 in JSON
output although conceptually it has a higher verbosity:

   if klog.V(5).Enabled() {
       klog.Info("hello world")
   }

Having the actual verbosity in the JSON output is relevant, for example for
filtering out only the important info messages. The solution is to use
klog.V(5).Info or something similar.

Whether the outer if is necessary at all depends on how complex the parameters
are. The return value of klog.V can be captured in a variable and be used
multiple times to avoid the overhead for that function call and to avoid
repeating the verbosity level.
2022-01-12 07:48:36 +01:00
Kubernetes Prow Robot
935052185c
Merge pull request #107450 from atiratree/local-up-cleanup
remove iptables cleanup from local-up-cluster.sh
2022-01-11 21:52:36 -08:00
Kubernetes Prow Robot
b5103f6117
Merge pull request #107426 from yanghesong/remove_validate_runtime
Remove runtime in validate
2022-01-11 20:50:36 -08:00
sayaoailun
36697d2e5d fix comment of e2e test case garbage_collector
Signed-off-by: sayaoailun <guojianwei007@126.com>
2022-01-12 10:59:13 +08:00
Mengjiao Liu
d0ec334605 Fix goroutine leaks in package selectorspread 2022-01-12 10:20:32 +08:00
Kubernetes Prow Robot
68e64ba52e
Merge pull request #106453 from davidleitw/master
Fix typo
2022-01-11 17:13:23 -08:00
Philip Hamer
ea2dff12e6
add test case for issue 106277 (PR 106268) (#106532)
* add test case for issue 106277 - fix edit of non-registered custom API types

* remove unneeded struct, as suggested
2022-01-11 15:53:23 -08:00
Kubernetes Prow Robot
1f382b171e
Merge pull request #107080 from sivchari/fix-misspell
fix curent to current
2022-01-11 13:56:53 -08:00
Kubernetes Prow Robot
57d66b9aad
Merge pull request #106400 from mahendrabishnoi2/master
fix grammar
2022-01-11 13:56:41 -08:00
Eric Lin
5fdf24baca Read number of running processes from /proc/loadavg.
Fallback to using sysinfo syscall if failed.

Fix kubernetes#107107
2022-01-11 21:33:53 +00:00
James Sturtevant
c5e341d5e0 Remove unsupported Windows SAC images from pause image
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2022-01-11 12:40:19 -08:00
Kubernetes Prow Robot
f8bb35d76e
Merge pull request #107448 from saschagrunert/apparmor-e2e
Fix AppArmor unloaded profile e2e test
2022-01-11 12:23:15 -08:00
Kubernetes Prow Robot
9cb26b7a07
Merge pull request #107472 from alculquicondor/patch-3
Remove skip Multi-AZ test based on provider
2022-01-11 10:49:09 -08:00
Kubernetes Prow Robot
cadbe8dfb5
Merge pull request #107250 from cndoit18/use-errors
cleanup(kubelet): use errors.Is(err, os.ErrProcessDone)
2022-01-11 10:49:01 -08:00
Kubernetes Prow Robot
7082bb90ad
Merge pull request #107192 from SergeyKanzhelev/cri-api-readme
synced up v1 and v1alpha2 CRI API comments and updated the readme
2022-01-11 10:48:54 -08:00
Kubernetes Prow Robot
19069665f9
Merge pull request #107094 from adisky/d-container-runtime
Mark container-runtime kubelet flag as deprecated
2022-01-11 10:48:46 -08:00
Kubernetes Prow Robot
7eb5046064
Merge pull request #106470 from qmloong/qmloong/fix
fix: some typos and syncPod outdated workflow annotation
2022-01-11 10:48:38 -08:00
Kubernetes Prow Robot
5f4914604d
Merge pull request #106353 from gjkim42/remove-false-pleg-errors
kubelet: Remove false PLEG errors
2022-01-11 10:48:26 -08:00
Kubernetes Prow Robot
9c468ecf30
Merge pull request #107467 from SataQiu/kubeadm-cleanup-20220111
kubeadm: print warnings to stderr
2022-01-11 09:46:57 -08:00
Kubernetes Prow Robot
fa52d44037
Merge pull request #107466 from humblec/new-field
correct struct fields in various core storage structs
2022-01-11 09:46:49 -08:00
Kubernetes Prow Robot
8f453c9d79
Merge pull request #107044 from pohly/cli-invalid-command
cli: avoid logging command line errors in more cases
2022-01-11 09:46:37 -08:00
Kubernetes Prow Robot
8d8d3f03c0
Merge pull request #106766 from kerthcet/feature/add-test-to-multipoint
add test to cover multipoint with scoring extension
2022-01-11 09:46:25 -08:00
Kubernetes Prow Robot
d05e5c0e41
Merge pull request #107408 from awels/allow_greater_or_equal_capacity_in_provisioning_check
Allow greater or equal in storage provisioning check
2022-01-11 08:33:28 -08:00
Kubernetes Prow Robot
39136784a4
Merge pull request #107009 from kerthcet/feature/fix-wrong-calculate-in-podTopologySpread
nodeAffinity filtered nodes should be excluded when calculating skew …
2022-01-11 08:33:16 -08:00
Aldo Culquicondor
3f0de6b80e
Remove skip Multi-AZ test based on provider
The test only cares if there are multiple zones and that is independent of the provider
2022-01-11 10:38:41 -05:00
SataQiu
218b4dea9f kubeadm: print warnings to stderr 2022-01-11 23:08:59 +08:00
Humble Chirammal
1cb0dd028f correct struct fields in various core storage structs
The field names in godoc for various core storage structs have been
corrected with this commit.

Additional Ref# #105963 (comment)

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2022-01-11 20:35:04 +05:30
fengzixu
5d544d3f01 fix comment 2022-01-11 14:28:31 +00:00
fengzixu
f96449f2e2 fix unit test 2022-01-11 13:50:18 +00:00
fengzixu
e2b5b5465a improve metrics comment 2022-01-11 13:50:18 +00:00
fengzixu
c1a58d715c fix unit test 2022-01-11 13:50:18 +00:00
fengzixu
5593e27429 improve metrics comment 2022-01-11 13:50:18 +00:00
fengzixu
1cdc694ac2 fix unit test 2022-01-11 13:50:18 +00:00
fengzixu
4a72f08a28 add useful comment for volume stats metrics 2022-01-11 13:50:18 +00:00
fengzixu
b885deffe3 fix unit test 2022-01-11 13:50:17 +00:00
fengzixu
f202164c87 fix e2e test 2022-01-11 13:50:17 +00:00
fengzixu
ed7fd0ced5 add volumeHealth label to metrics 2022-01-11 13:50:17 +00:00
fengzixu
bab1755274 fix: correct metrics expression 2022-01-11 13:50:17 +00:00
fengzixu
d71e21e01e add volume kubelet_volume_stats_health_abnormal to kubelet 2022-01-11 13:50:17 +00:00
Filip Křepinský
1bc56fc71e remove iptables cleanup from local-up-cluster.sh
- remove root warning
2022-01-11 14:15:31 +01:00
Kubernetes Prow Robot
f86ee5649b
Merge pull request #107468 from neolit123/1.24-remove-kubeadm-output-v1alpha1
kubeadm: remove the deprecated output/v1alpha1 API
2022-01-11 04:55:16 -08:00
Lubomir I. Ivanov
ad58393e19 kubeadm: remove the deprecated output/v1alpha1 API
The API was deprecated in 1.23 when output/v1alpha2 was
added. v1alpha1 is problematic since it embeds kubeadm/v1beta2
BootstrapToken related types directly. v1alpha2 imports
a new group dedicated to bootstrap tokens apis/bootstraptoken.
2022-01-11 12:51:46 +02:00
Damien Grisonnet
a188f5bf7e component-base: replace url in rest client metrics
The `rest_client_request_duration_seconds` and
`rest_client_rate_limiter_duration_seconds` metrics have a url label
that used to contain the whole uri of the request. This is very
dangerous and can lead to cardinality explosions since its values aren't
bounded. We don't really need to expose the whole uri since these
metrics are used to mesure the availability of the different proxy in
front the apiserver. The most valuable information is the host to be
able to differentiate between the different proxy. In the future, we
might also want to add the path to be able to add some granularity, but
since there is no immediate use case for that, so there is no need to
add it now.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2022-01-11 10:20:43 +01:00
Patrick Ohly
a5a241e0df logs: update expected output for multi-line test case
The multiline support has been merged while this benchmark was written. We now
get the output that we want, with line breaks.
2022-01-11 09:57:03 +01:00
Patrick Ohly
25c646cbdd json: never call fsync for stdout or stderr
We don't need to worry about data loss once the data has been written to an
output stream. Calling fsync unnecessarily has been the reason for performance
issues in the past.
2022-01-11 09:56:22 +01:00
Patrick Ohly
9a867c555c logs: benchmark write performance
The recent regression https://github.com/kubernetes/kubernetes/issues/107033
shows that we need a way to automatically measure different logging
configurations (structured text, JSON with and without split streams) under
realistic conditions (time stamping, caller identification).

System calls may affect the performance and thus writing into actual files is
useful. A temp dir under /tmp (usually a tmpfs) is used, so the actual IO
bandwidth shouldn't affect the outcome. The "normal" json.Factory code is used
to construct the JSON logger when we have actual files that can be set as
os.Stderr and os.Stdout, thus making this as realistic as possible.

When discarding the output instead of writing it, the focus is more on the rest
of the pipeline and changes there can be investigated more reliably.

The benchmarks automatically gather "log entries per second" and "bytes per
second", which is useful to know when considering requirements like the ones
from https://github.com/kubernetes/kubernetes/issues/107029.
2022-01-11 09:56:22 +01:00
Patrick Ohly
b8501fc10b logs: work around logcheck
logcheck complains:
Additional arguments to ErrorS should always be Key Value pairs. Please check if there is any key or value missing.

That check is intentional, but not applicable here. The check can be worked
around by calling the functions through variables.
2022-01-11 09:56:22 +01:00
Patrick Ohly
072859c967 logs: create separate test/integration directory
The benchmark depends on k8s.io/api (for v1.Container). Such a dependency is
not desirable for k8s.io/component-base/logs, even if it's just for
testing. The solution is to create a separate directory where such a dependency
isn't a problem.

The alternative, a separate package with its own go.mod file under
k8s.io/component-base/logs wouldd have been more complicated to maintain (yet
another go.mod file and different whitelisted dependencies).
2022-01-11 09:56:22 +01:00
Patrick Ohly
8e2f03d336 logs: add benchmark
The benchmark reads a JSON log file and measures how long it takes to re-encode
it. The focus is on the encoding of message and values, therefore additional
work (time stamping, caller, writing to file) gets avoided.
2022-01-11 09:56:21 +01:00
Patrick Ohly
40b38f09d9 json: more flexible constructor
The encoder configuration can now be chosen by the caller. This will be used by
a benchmark to write messages without caller and time stamp.

While at it, some places where the logger was unnecessarily tested with split
output streams writing into the same actual stream were replaced with writing
as single stream. This is a leftover from a previous incarnation of the split
output stream patch where identical streams were used instead of nil for the
error stream to indicate "single stream".
2022-01-11 09:56:21 +01:00