Commit Graph

1411 Commits

Author SHA1 Message Date
Patrick Ohly
21d1bcd6b8 initialize logging after flag parsing
It wasn't documented that InitLogs already uses the log flush frequency, so
some commands have called it before parsing (for example, kubectl in the
original code for logs.go). The flag never had an effect in such commands.

Fixing this turned into a major refactoring of how commands set up flags and
run their Cobra command:

- component-base/logs: implicitely registering flags during package init is an
  anti-pattern that makes it impossible to use the package in commands which
  want full control over their command line. Logging flags must be added
  explicitly now, something that the new cli.Run does automatically.

- component-base/logs: AddFlags would have crashed in kubectl-convert if it
  had been called because it relied on the global pflag.CommandLine. This
  has been fixed and kubectl-convert now has the same --log-flush-frequency
  flag as other commands.

- component-base/logs/testinit: an exception are tests where flag.CommandLine has
  to be used. This new package can be imported to add flags to that
  once per test program.

- Normalization of the klog command line flags was inconsistent. Some commands
  unintentionally didn't normalize to the recommended format with hyphens. This
  gets fixed for sample programs, but not for production programs because
  it would be a breaking change.

This refactoring has the following user-visible effects:

- The validation error for `go run ./cmd/kube-apiserver --logging-format=json
  --add-dir-header` now references `add-dir-header` instead of `add_dir_header`.

- `staging/src/k8s.io/cloud-provider/sample` uses flags with hyphen instead of
  underscore.

- `--log-flush-frequency` is not listed anymore in the --logging-format flag's
  `non-default formats don't honor these flags` usage text because it will also
  work for non-default formats once it is needed.

- `cmd/kubelet`: the description of `--logging-format` uses hyphens instead of
  underscores for the flags, which now matches what the command is using.

- `staging/src/k8s.io/component-base/logs/example/cmd`: added logging flags.

- `apiextensions-apiserver` no longer prints a useless stack trace for `main`
  when command line parsing raises an error.
2021-09-30 13:46:49 +02:00
Khaled Henidak (Kal)
a53e2eaeab
move IPv6DualStack feature to stable. (#104691)
* kube-proxy

* endpoints controller

* app: kube-controller-manager

* app: cloud-controller-manager

* kubelet

* app: api-server

* node utils + registry/strategy

* api: validation (comment removal)

* api:pod strategy (util pkg)

* api: docs

* core: integration testing

* kubeadm: change feature gate to GA

* service registry and rest stack

* move feature to GA

* generated
2021-09-24 16:30:22 -07:00
Kubernetes Prow Robot
fed612c9f8
Merge pull request #103172 from niulechuan/cleanup/deprecated_flag
Remove deprecated flag --experimental-bootstrap-kubeconfig
2021-09-21 14:08:18 -07:00
Kubernetes Prow Robot
c79f7c1add
Merge pull request #104711 from claudiubelu/update-pause-3.6
update pause image references to use 3.6
2021-09-13 19:09:08 -07:00
Sascha Grunert
46077e6be7
Remove deprecated --seccomp-profile-root/seccompProfileRoot configuration
The configuration is deprecated and targets removal for v1.23. Tests
cases have been changed as well.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-08-31 09:55:28 +02:00
Claudiu Belu
18936d4785 updates pause image references
The pause:3.6 image has been published.

Also updates older / incorrect references.
2021-08-29 21:50:05 -07:00
Stephen Augustus
481cf6fbe7
generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-08-24 15:47:49 -04:00
Antonio Ojea
0cd75e8fec run hack/update-netparse-cve.sh 2021-08-20 10:42:09 +02:00
tanjing2020
523b4c0918 Replace 'x.Sub(time.Now())' with 'time.Until(x)' 2021-07-23 10:03:36 +08:00
Francesco Romani
c5cb263dcf smtalign: propagate policy options to cpumanager
The CPUManagerPolicyOptions received from the kubelet config/command line args
is propogated to the Container Manager.

We defer the consumption of the options to a later patch(set).

Co-authored-by: Swati Sehgal <swsehgal@redhat.com>
Signed-off-by: Francesco Romani <fromani@redhat.com>
2021-07-08 23:15:35 +02:00
Swati Sehgal
cc76a756e4 smtalign: add cpu-manager-policy-options flag in Kubelet
In this patch we enhance the kubelet configuration to support
cpuManagerPolicyOptions.

In order to introduce SMT-awareness in CPU Manager, we introduce a
new flag in Kubelet to allow the user to specify an additional flag
called `cpumanager-policy-options` to allow the user to modify the
behaviour of static policy to strictly guarantee allocation of whole
core.

Co-authored-by: Francesco Romani <fromani@redhat.com>
Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
2021-07-08 23:14:59 +02:00
Li Bo
c3d9b10ca8 feature: support Memory QoS for cgroups v2 2021-07-08 09:26:46 +08:00
Kubernetes Prow Robot
8e56a34195
Merge pull request #102966 from SergeyKanzhelev/deprecateDynamicKubeletConfig
deprecate and disable by default DynamicKubeletConfig feature flag
2021-07-07 17:05:15 -07:00
Sergey Kanzhelev
dffc2a60a2 deprecate and disable by default DynamicKubeletConfig feature flag 2021-07-02 23:53:11 +00:00
Lukasz Szaszkiewicz
4a2aef00d6 adds metrics for authorization webhook 2021-06-30 09:26:25 +02:00
Lukasz Szaszkiewicz
322c18c147 adds metrics for authentication webhook 2021-06-29 09:49:14 +02:00
Niu Lechuan
606de85fca Remove deprecated flag --experimental-bootstrap-kubeconfig in kubelet
Signed-off-by: Niu Lechuan <lechuan.niu@daocloud.io>
2021-06-25 11:10:25 +08:00
Kubernetes Prow Robot
2e93b3924a
Merge pull request #101943 from saschagrunert/seccomp-default
Add kubelet `SeccompDefault` alpha feature
2021-06-24 13:07:41 -07:00
Kubernetes Prow Robot
06dfe683ce
Merge pull request #103123 from dims/remove-fakefs-to-drop-spf13/afero-dependency
Remove fakefs to drop spf13/afero dependency
2021-06-24 07:57:41 -07:00
Davanum Srinivas
5feff280e1
remove fakefs to drop spf13/afero dependency
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-06-24 09:51:34 -04:00
Monis Khan
7e891e5d6c
csr: correctly handle backdating of short lived certs
This change updates the backdating logic to only be applied to the
NotBefore date and not the NotAfter date when the certificate is
short lived. Thus when such a certificate is issued, it will not be
immediately expired.  Long lived certificates continue to have the
same lifetime as before.

Consolidated all certificate lifetime logic into the
PermissiveSigningPolicy.policy method.

Signed-off-by: Monis Khan <mok@vmware.com>
2021-06-23 15:36:11 -04:00
Sascha Grunert
8b7003aff4
Add SeccompDefault feature
This adds the gate `SeccompDefault` as new alpha feature. Seccomp path
and field fallbacks are now passed to the helper functions, whereas unit
tests covering those code paths have been added as well.

Beside enabling the feature gate, the feature has to be enabled by the
`SeccompDefault` kubelet configuration or its corresponding
`--seccomp-default` CLI flag.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>

Apply suggestions from code review

Co-authored-by: Paulo Gomes <pjbgf@linux.com>
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-06-23 10:22:57 +02:00
Kubernetes Prow Robot
e55ff835b4
Merge pull request #102922 from SataQiu/update-link
cmd/kubelet: replace KEP link with the documentation one as it is available now
2021-06-19 13:10:50 -07:00
SataQiu
a47afdded0 cmd/kubelet: replace KEP link with the documentation one as it is available now 2021-06-16 23:38:58 +08:00
Davanum Srinivas
7fcdbbef06
Switch to github.com/coreos/go-systemd/v22 and drop older package
- We use the new v22 module released on May 10
- We drop the unmaintained `github.com/coreos/pkg`

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-06-16 11:14:16 -04:00
Kubernetes Prow Robot
71d6a48d3e
Merge pull request #102431 from serathius/loggingconfig
Use LoggingConfig within LogOptions
2021-06-16 02:21:59 -07:00
Kubernetes Prow Robot
7b9c335826
Merge pull request #98869 from liuxu623/master
fix kubelet flag description: --event-qps and --event-burst
2021-06-15 22:55:59 -07:00
Marek Siarkowicz
f9343f837d Use LoggingConfig within LogOptions
Co-authored-by: mengjiao.liu <mengjiao.liu@daocloud.io>
Co-authored-by: Jordan Liggitt <jordan@liggitt.net>
Co-authored-by: Heisenberg <yuzhiquanlong@gmail.com>
2021-06-15 17:14:43 +02:00
Mengjiao Liu
bd80603c9e JSON log format registration for kubelet 2021-06-09 16:02:34 +08:00
Kubernetes Prow Robot
29a8105cec
Merge pull request #101272 from Jiawei0227/deprecateflag
Remove CSIMigrationvSphereComplete flag
2021-06-05 10:40:38 -07:00
Sascha Grunert
b167fc24d7
Update pause image to v3.5
Update dependencies and the test images to use pause 3.5. We also
provide a changelog entry for the new container image version.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-05-25 09:04:46 +02:00
Kubernetes Prow Robot
13cafd5cb0
Merge pull request #101480 from yuzhiquan/little-nit-for-kubelet
Fix some nit for kubelet
2021-05-24 21:49:05 -07:00
Jiawei Wang
94db1e18ba Remove scaleio from volume plugins 2021-05-19 10:35:21 -07:00
Kubernetes Prow Robot
10b09e8a46
Merge pull request #100326 from wzshiming/fix/memory-leak
Fix watchForLockfileContention memory leak
2021-05-07 13:31:16 -07:00
Jiawei Wang
fa1a4100c6 Remove CSIMigrationVSphereComplete flag 2021-05-04 21:38:47 -07:00
yuzhiquan
ee2c3c1859 fix broken links by https 2021-04-26 14:58:42 +08:00
yuzhiquan
747c6f20dc error string should not be capitalized 2021-04-26 14:56:39 +08:00
wangyx1992
5109c3d548 cleanup: fix errors in wrapped format and log capitalization in kubelet
Signed-off-by: wangyx1992 <wang.yixiang@zte.com.cn>
2021-04-25 11:09:24 +08:00
Kubernetes Prow Robot
95ef042fb3
Merge pull request #98152 from jianzzha/master
update --reserved-cpus cpu list validation
2021-04-24 07:56:59 -07:00
Kubernetes Prow Robot
43b9491055
Merge pull request #101057 from wangyysde/remove-chaos-chance
removing kubelet's flag chaos-chance
2021-04-23 19:27:52 -07:00
Kubernetes Prow Robot
1ceddc790d
Merge pull request #98516 from chymy/fix-kubelet-option
To be consistent with global flags in --logging-format description
2021-04-22 19:50:01 -07:00
Jianzhu Zhang
bbfbc5e889 Update --reserved-cpus cpu list validation so kubelet won't fail to start due to off-line CPUs 2021-04-22 21:39:20 -04:00
Kubernetes Prow Robot
1960a7becf
Merge pull request #100981 from songxiao-wang87/run-test3
spelling mistake
2021-04-22 13:18:40 -07:00
wangyysde
4467082ddb removed kubelet's flag chaos-chance 2021-04-13 14:09:55 +08:00
songxiao-wang87
9c880ad907 spelling error server.go.
Signed-off-by: songxiao-wang87 <wang.xiaosong23@zte.com.cn>
2021-04-10 11:00:28 +08:00
navist2020
4f7d87f72c Don't use Yoda conditions 2021-04-08 18:14:45 +08:00
chymy
ec7624b80d Fix flag spelling err in kubelet options
Signed-off-by: chymy <chang.min1@zte.com.cn>
2021-04-06 10:06:27 +08:00
Davanum Srinivas
ba56884d91
Ensure providerless kubelet does not pull cloud providers
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-03-21 21:36:38 -04:00
Elana Hashman
6af7eb6d49
Migrate missed log entries in kubelet
Co-Authored-By: pacoxu <paco.xu@daocloud.io>
2021-03-18 14:26:26 -07:00
Shiming Zhang
a3d337491f Fix watchForLockfileContention memory leak 2021-03-17 15:10:53 +08:00