Commit Graph

251 Commits

Author SHA1 Message Date
Sergey Kanzhelev
ee53488f19 fix golint issues in pkg/kubelet/container 2020-06-19 15:48:08 +00:00
David Eads
4da0e64bc1 reduce race risk in kubelet for missing KUBERNETES_SERVICE_HOST 2020-05-29 17:11:19 -04:00
Jordan Liggitt
591e0043c8 Revert "Merge pull request 89667 from kmala/kubelet"
This reverts commit fa785a5706, reversing
changes made to cf13f8d994.
2020-05-21 13:30:14 -04: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
Kubernetes Prow Robot
fa785a5706
Merge pull request #89667 from kmala/kubelet
Check for sandboxes before deleting the pod from apiserver
2020-05-19 23:40:18 -07: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
Keerthan Reddy,Mala
70e2559aca use runtime sandbox status instead of calling cri 2020-04-13 14:36:34 -07:00
Keerthan Reddy,Mala
aae8a2847a Check for sandboxes before deleting the pod from apiserver 2020-04-13 14:36:34 -07:00
Kevin Taylor
9fd48b4039 Remove VolumeSubpathEnvExpansion Feature Gate 2020-03-27 16:28:33 +00:00
Clayton Coleman
c26653ced9
kubelet: Also set PodIPs when assign a host network PodIP
When we clobber PodIP we should also overwrite PodIPs and not rely
on the apiserver to fix it for us - this caused the Kubelet status
manager to report a large string of the following warnings when
it tried to reconcile a host network pod:

```
 I0309 19:41:05.283623    1326 status_manager.go:846] Pod status is inconsistent with cached status for pod "machine-config-daemon-jvwz4_openshift-machine-config-operator(61176279-f752-4e1c-ac8a-b48f0a68d54a)", a reconciliation should be triggered:
   &v1.PodStatus{
           ... // 5 identical fields
           HostIP:                "10.0.32.2",
           PodIP:                 "10.0.32.2",
 -         PodIPs:                []v1.PodIP{{IP: "10.0.32.2"}},
 +         PodIPs:                []v1.PodIP{},
           StartTime:             s"2020-03-09 19:41:05 +0000 UTC",
           InitContainerStatuses: nil,
           ... // 3 identical fields
   }
```

With the changes to the apiserver, this only happens once, but it is
still a bug.
2020-03-09 18:15:32 -04:00
Yu-Ju Hong
2364c10e2e
kubelet: Don't delete pod until all container status is available
After a pod reaches a terminal state and all containers are complete
we can delete the pod from the API server. The dispatchWork method
needs to wait for all container status to be available before invoking
delete. Even after the worker stops, status updates will continue to
be delivered and the sync handler will continue to sync the pods, so
dispatchWork gets multiple opportunities to see status.

The previous code assumed that a pod in Failed or Succeeded had no
running containers, but eviction or deletion of running pods could
still have running containers whose status needed to be reported.

This modifies earlier test to guarantee that the "fallback" exit
code 137 is never reported to match the expectation that all pods
exit with valid status for all containers (unless some exceptional
failure like eviction were to occur while the test is running).
2020-03-04 13:34:25 -05:00
Jan Safranek
2c1b743766 Promote block volume features to GA 2020-02-28 20:48:38 +01:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -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
yuxiaobo
81e9f21f83 Correct spelling mistakes
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2019-11-06 20:25:19 +08: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
Travis Rhoden
935c23f2ad
Move HostUtil to pkg/volume/util/hostutil
This patch moves the HostUtil functionality from the util/mount package
to the volume/util/hostutil package.

All `*NewHostUtil*` calls are changed to return concrete types instead
of interfaces.

All callers are changed to use the `*NewHostUtil*` methods instead of
directly instantiating the concrete types.
2019-08-30 10:14:42 -06:00
Tim Allclair
8a495cb5e4 Clean up error messages (ST1005) 2019-08-21 10:40:21 -07:00
Kubernetes Prow Robot
59d29b67d9
Merge pull request #59484 from verb/debug-kubelet-1
Add support for Ephemeral Containers to the kubelet
2019-08-21 00:29:17 -07:00
Lee Verberne
cb3976c02b Fix returning logs from ephemeral containers 2019-08-20 17:45:38 +00:00
Travis Rhoden
14e25b7c04
Rename HostUtils.ExistsPath to PathExists 2019-08-09 12:40:19 -06: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
Kubernetes Prow Robot
fc9db7a042
Merge pull request #79681 from tedyu/clean-pods-param
Pass desiredPods to CleanupPods
2019-07-11 17:01:47 -07:00
Ted Yu
2242e396d4 Pass desiredPods to CleanupPods 2019-07-03 10:35:13 +08:00
Khaled Henidak(Kal)
dba434c4ba kubenet for ipv6 dualstack 2019-07-02 22:26:25 +00:00
Travis Rhoden
be7da5052f Refactor pkg/util/mount to be more reusable
This patch refactors pkg/util/mount to be more usable outside of
Kubernetes. This is done by refactoring mount.Interface to only contain
methods that are not K8s specific. Methods that are not relevant to
basic mount activities but still have OS-specific implementations are
now found in a mount.HostUtils interface.
2019-06-14 09:35:18 -06:00
Daniel Mueller
9050c510e6 Remove unused variables from computePodPhase
The initialized and failed variables in the computePodPhase function are
effectively write only. Remove them.
2019-04-08 09:09:09 -07:00
Davanum Srinivas
33081c1f07
New staging repository for cri-api
Change-Id: I2160b0b0ec4b9870a2d4452b428e395bbe12afbb
2019-03-26 18:21:04 -04:00
Wei Huang
c5a96b63f4
Revert "kubelet: return mirror pod in GetActivePods()"
This reverts commit c0c93f4a52.
2019-03-07 11:22:27 -08:00
Kubernetes Prow Robot
98fa2c7d32
Merge pull request #74222 from Huang-Wei/kubelet-mirrorpod
kubelet: return mirror pod in GetActivePods()
2019-03-05 13:22:02 -08:00
Kubernetes Prow Robot
0a4308f641
Merge pull request #74529 from liggitt/kubelet-service-links-error
Kubelet service links error
2019-03-05 09:49:59 -08:00
Travis Rhoden
2c4d748bed Refactor subpath out of pkg/util/mount
This patch moves subpath functionality out of pkg/util/mount and into a
new package pkg/volume/util/subpath. NSEnter funtionality is maintained.
2019-02-26 19:59:53 -07:00
Jordan Liggitt
4ac08be206 prevent panic on nil pod.spec.enableServiceLinks 2019-02-25 10:43:29 -05:00
Jordan Liggitt
9788d401e2 Revert "bug: fix segfault when EnableServiceLinks is nil"
This reverts commit e9f1700512.
2019-02-25 10:35:48 -05:00
Kevin Taylor
a64b854137 Implementation of KEP Feature Gate VolumeSubpathEnvExpansion 2019-02-20 01:37:16 +00:00
Wei Huang
c0c93f4a52
kubelet: return mirror pod in GetActivePods() 2019-02-18 12:06:43 -08:00
Joe Julian
e9f1700512
bug: fix segfault when EnableServiceLinks is nil
When upgrading to 1.13, pods that were created prior to the upgrade have
no pod.Spec.EnableServiceLinks set. This causes a segfault and prevents
the pod from ever starting.

Check and set to the default if nil.

Fixes #71749
2019-01-31 11:07:32 -08:00
Kubernetes Prow Robot
ea6acb34d1
Merge pull request #65132 from stewart-yu/stewart-removeunusedtodo
remove unuse todo
2018-12-19 06:51:29 -08:00
stewart-yu
5f11d089b7 remove unused todo in kubelet_pods.go 2018-11-30 12:51:46 +08:00
xichengliudui
68f9dacabf Fix typo: trus->true 2018-11-15 01:36:15 -05:00
Bill Warshaw
ab507dfc1f Write HostAliases aliases on same line per host IP
* change HostAliases to put all aliases for an IP
  on the same line in /etc/hosts rather than writing
  one line per IP-alias pair
* having multiple entries in /etc/hosts for the same IP
  causes issues with DNS resolution for some software
* https://unix.stackexchange.com/questions/102660/hosts-file-is-it-incorrect-to-have-the-same-ip-address-on-multiple-lines
2018-11-11 20:54:52 -05:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
k8s-ci-robot
08351b6d6d
Merge pull request #68230 from bertinatto/remove_mount_propagation_gate
Remove mount propagation feature gate
2018-11-02 01:13:43 -07:00
Fabio Bertinatto
6c9b854542 Remove mount propagation feature gate logic 2018-10-31 15:51:37 +01:00
k8s-ci-robot
63a7e06eb5
Merge pull request #69484 from ddebroy/ddebroy-winpipe1
Correctly handle named pipe host mounts for Windows
2018-10-30 16:15:57 -07:00
Deep Debroy
5da66fd65f Address code review comments
Signed-off-by: Deep Debroy <ddebroy@docker.com>
2018-10-27 00:31:16 -07:00
Deep Debroy
119e2a1d43 Address CR comments and add more tests
Signed-off-by: Deep Debroy <ddebroy@docker.com>
2018-10-26 00:29:27 -07:00