Commit Graph

1442 Commits

Author SHA1 Message Date
Francesco Romani
ff44dc1932 cpumanager: the FG is locked to default (ON)
hence we can remove the if() guards, the feature
is always available.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2022-11-02 18:41:41 +01:00
Swati Sehgal
8b29eded52 node: devicemgr: Remove devicePluginEnabled field from container mgr
With graduation of device plugins to GA in 1.26, the feature gate is
enabled by default so `devicePluginEnabled` field no longer needs to
be passed at the time of Container Manager creation.

In addition to that, we remove the `ManagerStub` as it is no longer
needed.

Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
2022-11-02 11:05:20 +00:00
Artur Żyliński
9f31669a53 New histogram: Pod start SLI duration 2022-10-26 11:28:17 +02:00
Kubernetes Prow Robot
244c035b87
Merge pull request #110263 from claudiubelu/unittests
unittests: Fixes unit tests for Windows
2022-10-25 14:50:34 -07:00
Claudiu Belu
6f2eeed2e8 unittests: Fixes unit tests for Windows
Currently, there are some unit tests that are failing on Windows due to
various reasons:

- config options not supported on Windows.
- files not closed, which means that they cannot be removed / renamed.
- paths not properly joined (filepath.Join should be used).
- time.Now() is not as precise on Windows, which means that 2
  consecutive calls may return the same timestamp.
- different error messages on Windows.
- files have \r\n line endings on Windows.
- /tmp directory being used, which might not exist on Windows. Instead,
  the OS-specific Temp directory should be used.
- the default value for Kubelet's EvictionHard field was containing
  OS-specific fields. This is now moved, the field is now set during
  Kubelet's initialization, after the config file is read.
2022-10-25 23:46:56 +03:00
helen
008dc87aa9 Remove HTTP Server support for pushing pods onto the kubelet #3015
Signed-off-by: helen <helenfrank@protonmail.com>
Signed-off-by: helen <haitao.zhang@daocloud.io>
2022-10-18 22:02:09 +08:00
Kubernetes Prow Robot
525280d285
Merge pull request #112643 from SergeyKanzhelev/removeDynamicKubeletConfig
remove DynamicKubeletConfig feature gate from the code
2022-10-12 01:33:00 -07:00
Kubernetes Prow Robot
02109414e8
Merge pull request #112542 from astraw99/fix-runtime-validate
Add validation for runtime endpoint flag
2022-09-30 18:04:24 -07:00
astraw99
805be30745 Add validation for runtime endpoint 2022-09-28 10:33:35 +08:00
Han Kang
e95179ffb6 Wire up feature_gate.go with metrics via AddMetrics method
wire up feature_gate.go with metrics via AddMetrics method

Change-Id: I9b4f6b04c0f4eb9bcb198b16284393d21c774ad8

wire in metrics to kubernetes components

Change-Id: I6d4ef8b26f149f62b03f32d1658f04f3056fe4dc

rename metric since we're using the value to determine if enabled is true or false

Change-Id: I13a6b6df90a5ffb4b9c5b34fa187562413bea029

Update staging/src/k8s.io/component-base/featuregate/feature_gate.go

Co-authored-by: Jordan Liggitt <jordan@liggitt.net>
2022-09-26 08:44:42 -07:00
Sergey Kanzhelev
39e49a91d7 remove DynamicKubeletConfig feature gate from the code 2022-09-23 23:14:19 +00:00
Davanum Srinivas
01d8a4f0c5
update to v1.12.0 of semconv
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-09-18 19:34:30 -04:00
Davanum Srinivas
3eaca7cf51
update code to use newer otel api
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-09-17 21:48:20 -04:00
Humble Chirammal
c2a7bfd6b4 removal of glusterfs in-tree driver code from the source
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2022-09-13 20:11:50 +05:30
Davanum Srinivas
9bbf01bae9
Remove references to openstack and cinder
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-08-22 16:43:14 -04:00
Jiawei Wang
d52cdeae79 cleanup: Remove storageos volume plugins from k8s codebase 2022-08-03 20:19:59 +00:00
jinxu
0064010cdd Promote Local storage capacity isolation feature to GA
This change is to promote local storage capacity isolation feature to GA

At the same time, to allow rootless system disable this feature due to
unable to get root fs, this change introduced a new kubelet config
"localStorageCapacityIsolation". By default it is set to true. For
rootless systems, they can set this configuration to false to disable
the feature. Once it is set, user cannot set ephemeral-storage
request/limit because capacity and allocatable will not be set.

Change-Id: I48a52e737c6a09e9131454db6ad31247b56c000a
2022-08-02 23:45:48 -07:00
Kubernetes Prow Robot
d40bc18461
Merge pull request #105126 from sallyom/tracing-kubelet
kubelet tracing instrumentation
2022-08-02 11:38:06 -07:00
Kubernetes Prow Robot
70dcb0f129
Merge pull request #111618 from Jiawei0227/flocker
cleanup: Remove flocker volume plugins from k8s codebase
2022-08-02 09:16:16 -07:00
Jiawei Wang
9c869b3dfc cleanup: Remove quobyte volume plugins from k8s codebase 2022-08-02 00:47:02 +00:00
Jiawei Wang
ff063889a7 cleanup: Remove flocker volume plugins from k8s codebase
Flocker storage plugin removed from k8s codebase.

Flocker, an early external storage plugin in k8s,
has not been in maintenance and their business is
down. As far as I know, the plugin is not being
used anymore.

This PR removes the whole flocker dependency and
codebase from core k8s to reduce potential security
risks and reduce maintenance work from the sig-storage community.
2022-08-02 00:42:50 +00:00
Sally O'Malley
47e7d8034f
kubelet tracing
Signed-off-by: Sally O'Malley <somalley@redhat.com>
Co-authored-by: David Ashpole <dashpole@google.com>
2022-08-01 12:55:02 -04:00
Kubernetes Prow Robot
451c00cc70
Merge pull request #109263 from FeLvi-zzz/add-kubelet-nodeLabels-validation
validate nodeLabels in kubelet
2022-07-29 21:22:26 -07:00
Kubernetes Prow Robot
17d3eecc7c
Merge pull request #111431 from ialidzhikov/fix/seccomp-default-help-text
Update the feature state in the help text of the `--seccomp-default` flag
2022-07-29 19:29:36 -07:00
Kubernetes Prow Robot
c809129f2c
Merge pull request #103069 from jackfrancis/cmd-kubelet-kubeserver-new-main-kubelet
chore(kubelet): simpler createAndInitKubelet func
2022-07-29 14:29:12 -07:00
Kubernetes Prow Robot
d05780e38d
Merge pull request #109347 from HirazawaUi/master
the err of "GetKubeletContainer" function should not affect the value of "RuntimeCgroups"
2022-07-29 13:17:35 -07:00
Davanum Srinivas
a9593d634c
Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-07-26 13:14:05 -04:00
ialidzhikov
cb4a3d2ca4 Update the feature state in the help text of the --seccomp-default flag 2022-07-26 10:53:24 +03:00
Mark Rossetti
40f3e624a6 Switching everything to use pause:3.8
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
2022-07-21 14:53:15 -07:00
John Howard
c6b0652b89
kubelet: silence flag output on errors (#110728)
* kubelet: silence flag output on errors

Currently, the `--help` text is output on kubelet errors. Currently on
my machine this is 280 lines. Typically kubelet is run by systemd or
similar, starting it a loop. This means when an issue is encountered, we
are spammed by 100s of logs per second, masking the real error.

With this PR, the list of all flags is silenced. Users can still access
them by `kubelet --help` as normal. This same `SilenceUsage` is already
set in the api-server command.

* Update cmd/kubelet/app/server.go

Co-authored-by: Paco Xu <paco.xu@daocloud.io>

Co-authored-by: Paco Xu <paco.xu@daocloud.io>
2022-06-27 11:34:59 -07:00
ialidzhikov
0a83f72214 kubelet: Update deprecation messages from 1.24 to 1.25
Signed-off-by: ialidzhikov <i.alidjikov@gmail.com>
2022-06-18 19:45:50 +03:00
Patrick Ohly
4c6338ac0f logs: replace config methods with functions
API types are only supposed to have methods related to serialization.
2022-06-17 20:22:13 +02:00
Patrick Ohly
ea3f25f49b logs: add alpha+beta feature gates
It is useful to have the ability to control whether alpha or beta features are
enabled. We can group features under LoggingAlphaOptions and LoggingBetaOptions
because the configuration is designed so that each feature individually must be
enabled via its own option.

Currently, the JSON format itself is beta (graduated in 1.23) but additional
options for it were only added in 1.23 and thus are still alpha:

  $ go run ./staging/src/k8s.io/component-base/logs/example/cmd/logger.go --logging-format=json --log-json-split-stream --log-json-info-buffer-size 1M --feature-gates LoggingBetaOptions=false
  [format: Forbidden: Log format json is BETA and disabled, see LoggingBetaOptions feature, options.json.splitStream: Forbidden: Feature LoggingAlphaOptions is disabled, options.json.infoBufferSize: Forbidden: Feature LoggingAlphaOptions is disabled]

  $ go run ./staging/src/k8s.io/component-base/logs/example/cmd/logger.go --logging-format=json --log-json-split-stream --log-json-info-buffer-size 1M
  [options.json.splitStream: Forbidden: Feature LoggingAlphaOptions is disabled, options.json.infoBufferSize: Forbidden: Feature LoggingAlphaOptions is disabled]

This is the same approach that was taken for CPUManagerPolicyAlphaOptions and
CPUManagerPolicyBetaOptions.

In order to test this without modifying the global feature gate in a test file,
ValidateKubeletConfiguration must take a feature gate as argument.
2022-06-17 20:22:13 +02:00
Patrick Ohly
1aceac797d logs: make LoggingConfiguration an unversioned API
Making the LoggingConfiguration part of the versioned component-base/config API
had the theoretic advantage that components could have offered different
configuration APIs with experimental features limited to alpha versions (for
example, sanitization offered only in a v1alpha1.KubeletConfiguration). Some
components could have decided to only use stable logging options.

In practice, this wasn't done. Furthermore, we don't want different components
to make different choices regarding which logging features they offer to
users. It should always be the same everywhere, for the sake of consistency.

This can be achieved with a saner Go API by dropping the distinction between
internal and external LoggingConfiguration types. Different stability levels of
indidividual fields have to be covered by documentation (done) and potentially
feature gates (not currently done).

Advantages:

- everything related to logging is under component-base/logs;
  previously this was scattered across different packages and
  different files under "logs" (why some code was in logs/config.go
  vs. logs/options.go vs. logs/logs.go always confused me again
  and again when coming back to the code):

  - long-term config and command line API are clearly separated
    into the "api" package underneath that

  - logs/logs.go itself only deals with legacy global flags and
    logging configuration

- removal of separate Go APIs like logs.BindLoggingFlags and
  logs.Options

- LogRegistry becomes an implementation detail, with less code
  and less exported functionality (only registration needs to
  be exported, querying is internal)
2022-06-17 20:22:13 +02:00
Patrick Ohly
4033e64bf1 kubelet: initialize logging even sooner, return error
After the removal of the dynamic kubelet configuration feature it became
possible to initialize logging directly after configuration parsing. The
advantage is that logs emitted by
kubeletconfigvalidation.ValidateKubeletConfiguration and
`klog.InfoS("unsupported configuration ...` already use the intended log
output.

After the code was originally added, Run was replaced by RunE. Taking advantage
of that and returning an error is cleaner.
2022-06-17 20:06:14 +02:00
Kubernetes Prow Robot
4e17f88b7e
Merge pull request #110506 from yangjunmyfm192085/removedockershim-des
Remove the description of the docker shim from the kubelet
2022-06-16 08:54:48 -07:00
JUN YANG
8567f2bd53
Update cmd/kubelet/app/server.go
Co-authored-by: Danielle <dani@builds.terrible.systems>
2022-06-16 08:29:14 +08:00
JunYang
8bfea65f69 Remove the description of the docker shim from the kubelet 2022-06-16 00:01:34 +08:00
Kubernetes Prow Robot
48efb361f3
Merge pull request #110323 from Thearas/docs-ephemeral-storage
docs: add `ephemeral-storage` to `SystemReserved`/`KubeReserved` comment
2022-06-10 13:19:44 -07:00
Kubernetes Prow Robot
70dca66271
Merge pull request #109388 from ialidzhikov/cleanup/experimental-kernel-memcg-notification
kubelet: Remove the deprecated `--experimental-kernel-memcg-notification` flag
2022-06-03 09:30:33 -07:00
Thearas
2457fbc643 docs: add ephemeral-storage to SystemReserved/KubeReserved comment 2022-06-01 16:19:26 +08:00
Davanum Srinivas
50bea1dad8
Move from k8s.gcr.io to registry.k8s.io
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-05-31 10:16:53 -04:00
何庆国10193842
3d14bcb9a4 Log StructuredLog: spelling formatting
Signed-off-by: 何庆国10193842 <he.qingguo@zte.com.cn>
2022-04-26 17:04:06 +08:00
ialidzhikov
c682716e87 kubelet: Remove the deprecated --experimental-kernel-memcg-notification flag
Signed-off-by: ialidzhikov <i.alidjikov@gmail.com>
2022-04-08 10:40:25 +03:00
Soh Takada
5ec2aaa339 validate nodeLabels in kubelet
Signed-off-by: Soh Takada <34182539+FeLvi-zzz@users.noreply.github.com>
2022-04-07 20:27:11 +09:00
HirazawaUi
fc0d38f02f The same err should not judge whether it is empty twice, and the err of "GetKubeletContainer" function should not affect the value of "RuntimeCgroups" 2022-04-07 11:08:25 +08:00
David Ashpole
120da3bb9b
fix copylock vet errors in component-base metrics 2022-03-31 15:07:11 +00:00
Kubernetes Prow Robot
e4690b0fbc
Merge pull request #109123 from dims/switch-to-pause-3.7
Switch to pause 3.7 for Kubernetes 1.24
2022-03-29 20:37:39 -07:00
Kubernetes Prow Robot
5b8dbfbbcf
Merge pull request #108995 from pohly/log-contextual
contextual logging
2022-03-29 17:35:59 -07:00
Davanum Srinivas
f7ad09c447
Switch to pause 3.7
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-03-29 15:36:38 -04: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
Mark Rossetti
2e036ad7c3 Fixing logic for kubelet permissions check on windows
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
2022-03-24 14:57:08 -07:00
Kubernetes Prow Robot
14e8db067e
Merge pull request #108191 from ravisantoshgudimetla/wire-cert-contexts
Wire cert contexts
2022-03-23 11:20:17 -07:00
Mark Rossetti
f63a194d9e Run kubelet in a job object in windows
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
2022-03-15 12:17:52 -07:00
Kubernetes Prow Robot
a41f9e976d
Merge pull request #108107 from aojea/kubelet_http2_heartbeat
kubelet apiserver: be gentle closing connections on heartbeat failures
2022-03-09 01:32:12 -08:00
Ravi Gudimetla
8b84a793b3 API Server Changes
This commit includes all the changes needed for APIServer. Instead of modifying the existing signatures for the methods which either generate or return stopChannel, we generate a context from the channel and use the generated context to be passed to the controllers which are started in APIServer. This ensures we don't have to touch APIServer dependencies.
2022-03-07 09:37:01 -05:00
Kubernetes Prow Robot
d7d121999d
Merge pull request #108480 from wojtek-t/log_golang_envs
Log main golang runtime env vars
2022-03-04 00:10:51 -08:00
Wojciech Tyczyński
ef2e32ab65 Log main golang runtime env vars 2022-03-04 08:04:02 +01:00
Kubernetes Prow Robot
428ec843a5
Merge pull request #107121 from borgerli/fix-kubelet-config-log
1.21 regression: fix regression introduced by PR 100320 - sensitive information would be logged
2022-03-03 00:28:48 -08:00
Jack
91c7f3f66a chore(kubelet): simpler createAndInitKubelet func 2022-02-24 14:20:32 -08:00
Kubernetes Prow Robot
06e107081e
Merge pull request #104732 from mengjiao-liu/remove-flag-experimental-check-node-capabilities-before-mount
kubelet: Remove the deprecated flag `--experimental-check-node-capabilities-before-mount`
2022-02-24 07:56:30 -08:00
Antonio Ojea
39e9b19b88 kubelet: rename closeAllConns to onHeartbeatFailure
Since the behavior of the kubelet OnHeartbeatFailure hook has changed
to close only the idle connections, rename this function to match
the semantics.
2022-02-18 16:30:22 +01:00
Antonio Ojea
ac22287051 kubelet apiserver: be gentle closing connections on heartbeat failures 2022-02-14 17:32:24 +01:00
Matthias Bertschy
9500ee9d9c container_manager: use oomScoreAdj instead of default when set 2022-02-12 15:23:13 +01:00
Ciprian Hacman
0819451ea6 Clean up logic for deprecated flag --container-runtime in kubelet
Signed-off-by: Ciprian Hacman <ciprian@hakman.dev>
2022-02-10 13:26:59 +02:00
Kubernetes Prow Robot
8d01b02c60
Merge pull request #107096 from hakman/remove_non-masquerade-cidr
Remove deprecated flag --non-masquerade-cidr in kubelet
2022-02-08 12:42:50 -08:00
ahrtr
972dc46a1f replace deprecated io/ioutil with os and io for cmd 2022-02-01 13:59:41 +08:00
Sergey Kanzhelev
7e7bc6d53b remove DynamicKubeletConfig logic from kubelet 2022-01-19 22:38:04 +00:00
Ciprian Hacman
21809043b5 Remove deprecated flag --non-masquerade-cidr in kubelet
Signed-off-by: Ciprian Hacman <ciprian@hakman.dev>
2022-01-19 09:17:26 +02:00
cyclinder
07999dac70 Clean up dockershim flags in the kubelet
Signed-off-by: cyclinder <qifeng.guo@daocloud.io>
Co-authored-by: Ciprian Hacman <ciprian@hakman.dev>
Signed-off-by: Ciprian Hacman <ciprian@hakman.dev>
2022-01-14 16:02:50 +02:00
Kubernetes Prow Robot
b1c204a237
Merge pull request #104774 from kerthcet/bug/fix-kubelet-log-defer-conflict-with-exit
fix kubelet flushlogs not working together with exit
2022-01-06 10:40:32 -08:00
Mengjiao Liu
beda4cafb6 kubelet: Remove the deprecated flag --experimental-check-node-capabilities-before-mount 2022-01-06 11:47:11 +08:00
Kubernetes Prow Robot
4eae933dc7
Merge pull request #106667 from SergeyKanzhelev/updateDeprecationMessages
updated deprecation messages from 1.23 to 1.24
2022-01-04 23:03:20 -08:00
Kubernetes Prow Robot
f5f34166b7
Merge pull request #106954 from saschagrunert/experimental-runtime-flags
Mark `--container-runtime-endpoint` and `--image-service-endpoint` stable
2021-12-20 06:19:25 -08:00
Li Bo
7311aa4131 fix regression introduced by PR 100320 2021-12-18 21:39:24 +08:00
Sascha Grunert
5983850dbc
Mark --container-runtime-endpoint and --image-service-endpoint stable
Since we removed dockershim we now rely on both flags, which therefore
should not marked experimental any more.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-12-10 14:54:10 +01:00
Davanum Srinivas
9405e9b55e
Check in OWNERS modified by update-yamlfmt.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-12-09 21:31:26 -05:00
Kubernetes Prow Robot
cdf3ad823a
Merge pull request #97252 from dims/drop-dockershim
Completely remove in-tree dockershim from kubelet
2021-12-08 12:51:46 -08:00
Davanum Srinivas
bc78dff42e
update files to drop dockershim
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-12-07 15:15:13 -05:00
kerthcet
185e0a041c prefer %w to unwrap errors
Signed-off-by: kerthcet <kerthcet@gmail.com>
2021-11-30 10:56:13 +08:00
Sergey Kanzhelev
a11453efbc remove ReallyCrashForTesting and cleaned up some references to HandleCrash behavior 2021-11-29 20:00:10 +00:00
Sergey Kanzhelev
54a279e0b0 updated deprecation messages from 1.23 to 1.24 2021-11-24 21:58:47 +00:00
Kubernetes Prow Robot
1304dfd73e
Merge pull request #106520 from pohly/log-print-flags
kubelet: print flags after initializing logging
2021-11-18 01:53:02 -08:00
Patrick Ohly
316ac13d00 kubelet: print flags after initializing logging
If done too soon, the klog.V() calls are ignored because the log verbosity
isn't set. In Kubernetes 1.22, the verbosity was set, but not the logging
format.
2021-11-18 07:53:16 +01:00
Hanna Lee
a7daeb37af Convert one more utilflag.IPVar to &utilflag.IPVar 2021-11-17 08:56:01 +01:00
Hanna Lee
30ea05ae7b Update IPVar and IPPortVar functions to have pointer receivers to fix 'ineffective assignment' 2021-11-17 08:56:00 +01:00
Kubernetes Prow Robot
1f6d5caa9a
Merge pull request #105437 from cmssczy/update-kubelet-configuration
migrate --register-with-taints to KubeletConfiguration
2021-11-16 17:44:00 -08:00
Oksana Naumov
3af11fc12d Add support for Portworx to csi-translation lib
Signed-off-by: Oksana Naumov <trierra.dev@gmail.com>
2021-11-16 13:26:09 -08:00
Kubernetes Prow Robot
45f77ca4ba
Merge pull request #104844 from aojea/clientgo_close_idle
CloseIdleConnections of wrapped Transport RoundTrippers
2021-11-16 08:45:27 -08:00
Antonio Ojea
15ea255457 don't use a custom dialer for the kubelet
Don't use a custom dialer for the kubelet if is not rotating
certificates, so we can reuse TCP connections because we don't need
a customer dialer.

Kubelet needs to be able to recover from stale http connections.
HTTP2 has a mechanism to detect broken connections by sending periodical pings.
HTTP1 only can have one persistent connection, and it will close all Idle connections
once the Kubelet heartbet fails. However, since there are many edge cases that we can't
control, users can still opt-in to the previous behavior for closing the connections by
setting the environment variable DISABLE_HTTP2.
2021-11-16 15:39:30 +01:00
caozhiyuan
bad4faf1b9 migrate --register-with-taints to KubeletConfiguration 2021-11-16 19:10:36 +08:00
kerthcet
9600e8d93b fix kubelet flushlogs not working together with os.Exit()
Signed-off-by: kerthcet <kerthcet@gmail.com>
2021-11-16 13:27:37 +08:00
Humble Chirammal
7c40eb9ae0 Add support for rbd plugin to csi-translation-lib
In support of csi-migration proposal here:
https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/csi-migration.md

Will help with migration of in-tree RBD plugin ( kubernetes.io/rbd)
to RBD CSI driver ( rbd.csi.ceph.com ).

Fixes https://github.com/kubernetes/enhancements/issues/2923

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2021-11-15 23:46:29 +05:30
Patrick Ohly
25907036ea kubelet: avoid deprecation remark for traditional logging flags
Just because the options can now also be set via a configuration file does not
mean that the command line flags should not be used anymore.
2021-11-03 12:02:48 +01: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
Debabrata Panigrahi
89062fea47
Updated kubelet server references about 4h hardcoded timeout (#104735)
* Updated non idle logging time

* Update cmd/kubelet/app/options/options.go

Co-authored-by: Jordan Liggitt <jordan@liggitt.net>

Co-authored-by: Jordan Liggitt <jordan@liggitt.net>
2021-10-20 09:23:57 -07:00
Patrick Ohly
00e4a599f6 command lines: always show flags with hyphens
All Kubernetes commands should show flags with hyphens in their help text even
when the flag originally was defined with underscore. Converting a command to
this style is not breaking its command line API because the old-style parameter
with underscore is accepted as alias.

The easiest solution to achieve this is to set normalization shortly before
running the command in the new central cli.Run or the few places where that
function isn't used yet.

There may be some texts which depends on normalization at flag definition time,
like the --logging-format usage warning. Those get generated assuming that
hyphens will be used.
2021-09-30 13:46:49 +02:00
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