Commit Graph

181 Commits

Author SHA1 Message Date
Mengjiao Liu
275d832ce2 Upgrade preparation to verify sysctl values containing forward slashes by regex 2021-11-04 11:49:56 +08:00
yxxhero
35df409a7e remove StartedPodsErrorsTotal metrice message
Signed-off-by: yxxhero <aiopsclub@163.com>
2021-09-23 22:18:56 +08: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
Ryan Phillips
30e9a420c4 kubelet: fix sandbox creation error suppression when pods are quickly deleted 2021-08-10 08:55:25 -05:00
Kubernetes Prow Robot
dab6f6a43d
Merge pull request #102344 from smarterclayton/keep_pod_worker
Prevent Kubelet from incorrectly interpreting "not yet started" pods as "ready to terminate pods" by unifying responsibility for pod lifecycle into pod worker
2021-07-08 16:48:53 -07:00
Kubernetes Prow Robot
a9d7526864
Merge pull request #102970 from tkestack/feature-memory-qos
Feature: Support memory qos with cgroups v2
2021-07-08 14:01:36 -07:00
Kubernetes Prow Robot
7c84064a4f
Merge pull request #99000 from verb/1.21-kubelet-metrics
Add kubelet metrics for ephemeral containers
2021-07-08 14:00:55 -07:00
Li Bo
c3d9b10ca8 feature: support Memory QoS for cgroups v2 2021-07-08 09:26:46 +08:00
Clayton Coleman
3eadd1a9ea
Keep pod worker running until pod is truly complete
A number of race conditions exist when pods are terminated early in
their lifecycle because components in the kubelet need to know "no
running containers" or "containers can't be started from now on" but
were relying on outdated state.

Only the pod worker knows whether containers are being started for
a given pod, which is required to know when a pod is "terminated"
(no running containers, none coming). Move that responsibility and
podKiller function into the pod workers, and have everything that
was killing the pod go into the UpdatePod loop. Split syncPod into
three phases - setup, terminate containers, and cleanup pod - and
have transitions between those methods be visible to other
components. After this change, to kill a pod you tell the pod worker
to UpdatePod({UpdateType: SyncPodKill, Pod: pod}).

Several places in the kubelet were incorrect about whether they
were handling terminating (should stop running, might have
containers) or terminated (no running containers) pods. The pod worker
exposes methods that allow other loops to know when to set up or tear
down resources based on the state of the pod - these methods remove
the possibility of race conditions by ensuring a single component is
responsible for knowing each pod's allowed state and other components
simply delegate to checking whether they are in the window by UID.

Removing containers now no longer blocks final pod deletion in the
API server and are handled as background cleanup. Node shutdown
no longer marks pods as failed as they can be restarted in the
next step.

See https://docs.google.com/document/d/1Pic5TPntdJnYfIpBeZndDelM-AbS4FN9H2GTLFhoJ04/edit# for details
2021-07-06 15:55:22 -04:00
Elana Hashman
0deef4610e
Set MemorySwapLimitInBytes for CRI when NodeSwapEnabled 2021-06-29 11:59:02 -07: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
yuzhiquan
bebca30309 comment should have function name as prefix 2021-04-28 15:26:46 +08:00
Lee Verberne
29178fff1c Add kubelet managed pod metrics 2021-04-13 14:13:30 +02:00
Aditi Sharma
461c0c1656 Fix structured logging for kuberuntime_manger.go 2021-03-15 10:13:18 +05:30
Elana Hashman
9fb6e712ff
Override terminationLivenessGracePeriod for probes 2021-03-11 14:38:03 -08:00
Kubernetes Prow Robot
c22f099395
Merge pull request #99841 from adisky/kuberuntime_manager
Migrate pkg/kubelet/kuberuntime/kuberuntime_manager.go to structured logging
2021-03-08 16:27:44 -08:00
Aditi Sharma
45c7608379 Migrate to structured logging
pkg/kubelet/kuberuntime/kuberuntime_manager.go

Signed-off-by: Aditi Sharma <adi.sky17@gmail.com>
2021-03-08 11:27:44 +05:30
Matthias Bertschy
431e6a7044 Move readinessManager updates handling to kubelet 2021-03-05 07:02:25 +01:00
Ryan Phillips
f989adaa18 kubelet: fix create create sandbox delete pod race 2021-02-18 11:22:12 -06:00
changshuchao
42eb85e4fb Made some optimizations, including modifying variable names, omitting unnecessary parentheses, and conflicting variable names and package names.
Signed-off-by: changshuchao <chang.shuchao1@zte.com.cn>
2021-01-16 17:24:08 +08:00
Andrew Sy Kim
51441fd052 kubelet: support alpha credential provider exec plugins
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
2020-11-10 13:44:06 -05:00
Kubernetes Prow Robot
402b94f313
Merge pull request #91469 from kinvolk/rata/fix-kubelet-log-msg
Fix kubelet log message when starting a container
2020-09-21 22:28:46 -07:00
Kubernetes Prow Robot
48d5d204c3
Merge pull request #92614 from tnqn/onfailure-recreate
Don't create a new sandbox for pod with RestartPolicyOnFailure if all containers succeeded
2020-09-03 14:57:40 -07:00
Rodrigo Campos
e6c67c32e1 Fix kubelet log message when starting a container
This code can be called not only when a container is dead and restarted,
but when is started for the first time too. For example, any pod with
initContainer and containers will exhibit this behaviour. The reason is
that in that case, the "if createPodSandbox" path will return the
initContainers only and on the next call to this function this code is
executed to start the containers for the fist time.

In that case, it is wrong to log that the container is dead and will be
restarted, as it was never started. In fact, the restart count will not
be increased.

This commit just changes this to say that the container is not in the
desired state and should be started. In the end, the kubelet is a state
machine and that is all we really care about.

No tests are added, as the behaviour was correct and tests don't check
logs messages.

Signed-off-by: Rodrigo Campos <rodrigo@kinvolk.io>
2020-08-04 14:58:27 -03:00
Marian Lobur
5d1b3e26af Fix an issue when rotated logs of dead containers are not removed. 2020-07-24 10:06:24 +02:00
Quan Tian
b2b082f54f Don't create a new sandbox for pod with RestartPolicyOnFailure if all containers succeeded
The kubelet would attempt to create a new sandbox for a pod whose
RestartPolicy is OnFailure even after all container succeeded. It caused
unnecessary CRI and CNI calls, confusing logs and conflicts between the
routine that creates the new sandbox and the routine that kills the Pod.

This patch checks the containers to start and stops creating sandbox if
no container is supposed to start.
2020-07-07 22:49:48 +08:00
Kubernetes Prow Robot
14d9b5d758
Merge pull request #92325 from brianpursley/sync-pod-log
Add pod and container name in log message when container fails to start
2020-06-24 04:55:18 -07:00
Brian Pursley
2afc8e0eab Add pod and container name in log message when container fails to start 2020-06-23 12:59:53 -04:00
Sergey Kanzhelev
ee53488f19 fix golint issues in pkg/kubelet/container 2020-06-19 15:48:08 +00:00
Kubernetes Prow Robot
99c50dfd3c
Merge pull request #85225 from DataDog/eric.mountain/cleanup_refmanager_master
Removes container RefManager
2020-05-28 16:37:15 -07:00
Davanum Srinivas
5692926914
Move packages for slightly better UX for consumers
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-20 10:57:46 -04:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
ZP-AlwaysWin
5796b7a32e Repair description 2020-04-17 09:36:38 +08:00
Eric Mountain
22e0ee768b Removes container RefManager 2020-03-16 14:30:57 +01:00
Lee Verberne
9a6d50cb2a Add namespace targeting to the kubelet 2020-01-30 15:31:43 +01:00
Kubernetes Prow Robot
9ddbc90039
Merge pull request #84191 from langyenan/getTypedVersion
invoke getTypedVersion() instead of direct runtime call
2019-12-10 16:04:19 -08:00
ianlang
babdcd0d14 invoke getTypedVersion() instead of direct runtime call 2019-12-09 15:31:45 +08:00
Kubernetes Prow Robot
e624d1b7bf
Merge pull request #85001 from bmoix/fix-golint-kubelet-httpgetter
kubelet: rename HTTPGetter interface
2019-12-06 17:05:53 -08:00
Kubernetes Prow Robot
4e45328e65
Merge pull request #83123 from aramase/dualstack-downward-api
Dualstack downward api
2019-11-14 22:13:42 -08:00
Kubernetes Prow Robot
d3593c07de
Merge pull request #83057 from bclau/windows/containerd
Windows: Fixes termination-file mounting support for containerd
2019-11-13 17:27:36 -08:00
Claudiu Belu
d4d7f58362 Windows: Fixes termination-file mounting for containerd
If Containerd is used on Windows, then we can also mount individual
files into containers (e.g.: termination-log files), which was not
possible with Docker.

Checks if the container runtime is containerd, and if it is, then also
mount the termination-log file.
2019-11-12 23:33:55 -08:00
Matthias Bertschy
66595d54a0 Add startupProbe result handling to kuberuntime 2019-11-13 08:12:54 +01:00
Bernat Moix
fc8ea98890 kubelet: rename HTTPGetter interface 2019-11-08 18:18:59 +01:00
Anish Ramasekar
af4d18ccf9
add status.podIPs in downward api
add host file write for podIPs

update tests

remove import alias

update type check

update type check

remove import alias

update open api spec

add tests

update test

add tests

address review comments

update imports

remove todo and import alias
2019-10-25 09:18:49 -07:00
Kubernetes Prow Robot
e972912fe4
Merge pull request #74881 from qingsenLi/k8s190304-fix-syntactic
fix syntactic error in kuberuntime_manager.go
2019-09-10 14:28:48 -07:00
Tim Allclair
8a495cb5e4 Clean up error messages (ST1005) 2019-08-21 10:40:21 -07:00
Lee Verberne
906286c743 Change order kubelet starts containers
This starts ephemeral containers prior to init containers so that
ephemeral containers will still be started when init containers fail to
start.

Also improves tests and comments with review suggestions.
2019-08-02 19:56:38 +00:00
Lee Verberne
ea212d5d49 Add support for ephemeral containers to the kubelet 2019-07-24 16:24:26 +00:00
Khaled Henidak(Kal)
dba434c4ba kubenet for ipv6 dualstack 2019-07-02 22:26:25 +00:00
Yu-Ju Hong
3fac48f86a kubelet: retry pod sandbox creation when containers were never created
If kubelet never gets past sandbox creation (i.e., never attempted to
create containers for a pod), it should retry the sandbox creation on
failure, regardless of the restart policy of the pod.
2019-06-26 18:19:27 -07:00