Commit Graph

354 Commits (e1a1aa211224fcd9b213420b80b2ae680669683d)

Author SHA1 Message Date
Christoph Blecker 97b2992dc1
Update gofmt for go1.11 2018-10-05 12:59:38 -07:00
k8s-ci-robot 6c1688712d
Merge pull request #68181 from Pingan2017/golint
fix golint failures - some packages under /pkg/kubelet
2018-09-28 01:56:26 -07:00
Derek Carr 5f473bc8e1 Kubelet should not create a new pod sandbox if all containers are done 2018-09-27 14:21:50 -04:00
Benjamin Elder 8b56eb8588 hack/update-gofmt.sh 2018-09-24 12:21:29 -07:00
Benjamin Elder f828c6f662 hack/update-bazel.sh 2018-09-24 12:03:24 -07:00
Benjamin Elder 088cf3c37b find & replace version import 2018-09-24 12:03:24 -07:00
Pingan2017 158552ff35 fix golint failures - /pkg/kubelet/images 2018-09-17 10:52:25 +08:00
Yu-Ju Hong a1f7ae7ab3 kubelet: skip initializing/using the RuntimeClass in standalone mode
In standalone mode, kubelet will not be configured to talk to an
apiserver. The RuntimeClass manager should be disabled in this case.
2018-09-11 13:21:53 -07:00
Tim Allclair 63f3bc1b7e
Implement RuntimeClass support for the Kubelet & CRI 2018-09-04 13:45:11 -07:00
Sandor Szücs 588d2808b7
fix #51135 make CFS quota period configurable, adds a cli flag and config option to kubelet to be able to set cpu.cfs_period and defaults to 100ms as before.
It requires to enable feature gate CustomCPUCFSQuotaPeriod.

Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
2018-09-01 20:19:59 +02:00
Jess Frazelle 31ffd9f881
vendor: update docker cadvisor winterm
This vendor change was purely for the changes in docker to allow for
setting the Masked and Read-only paths.

See: moby/moby#36644

But because of the docker dep update it also needed cadvisor to be
updated and winterm due to changes in pkg/tlsconfig in docker

See: google/cadvisor#1967

Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-08-30 11:40:05 -04:00
Jess Frazelle dbf7186bee
update jsonlog path for updated vendor
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-08-30 11:40:05 -04:00
Jess Frazelle 30dcca6233
ProcMount: add api options and feature gate
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-08-30 11:40:02 -04:00
Kubernetes Submit Queue cd06419973
Merge pull request #67369 from tianshapjq/should-not-eventf-directly
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

should not event directly

**What this PR does / why we need it**:
should not event directly, using recordContainerEvent() to generate ref and deduplicate events instead.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
none
```
2018-08-28 16:18:13 -07:00
Laszlo Janosi a6da2b1472 K8s SCTP support implementation for the first pull request
The requested Service Protocol is checked against the supported protocols of GCE Internal LB. The supported protocols are TCP and UDP.

SCTP is not supported by OpenStack LBaaS. If SCTP is requested in a Service with type=LoadBalancer, the request is rejected. Comment style is also corrected.

SCTP is not allowed for LoadBalancer Service and for HostPort. Kube-proxy can be configured not to start listening on the host port for SCTP: see the new SCTPUserSpaceNode parameter

changed the vendor github.com/nokia/sctp to github.com/ishidawataru/sctp. I.e. from now on we use the upstream version.

netexec.go compilation fixed. Various test cases fixed

SCTP related conformance tests removed. Netexec's pod definition and Dockerfile are updated to expose the new SCTP port(8082)

SCTP related e2e test cases are removed as the e2e test systems do not support SCTP

sctp related firewall config is removed from cluster/gce/util.sh. Variable name sctp_addr is corrected to sctpAddr in pkg/proxy/ipvs/proxier.go

cluster/gce/util.sh is copied from master
2018-08-27 05:56:27 +00:00
Kubernetes Submit Queue c65f65cf6a
Merge pull request #65065 from sjenning/reduce-backoff-logging
Automatic merge from submit-queue (batch tested with PRs 66177, 66185, 67136, 67157, 65065). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubelet: reduce logging for backoff situations

xref https://bugzilla.redhat.com/show_bug.cgi?id=1555057#c6

Pods that are in `ImagePullBackOff` or `CrashLoopBackOff` currently generate a lot of logging at the `glog.Info()` level.  This PR moves some of that logging to `V(3)` and avoids logging in situations where the `SyncPod` only fails because pod are in a BackOff error condition.

@derekwaynecarr @liggitt
2018-08-15 02:09:20 -07:00
tianshapjq 27c5ced809 should not event directly 2018-08-14 14:35:47 +08:00
Yu-Ju Hong 390b158db9 kubelet: plumb context for log requests
This allows kubelets to stop the necessary work when the context has
been canceled (e.g., connection closed), and not leaking a goroutine
and inotify watcher waiting indefinitely.
2018-08-10 17:35:46 -07:00
Lantao Liu 3193a4a469 Fix RunAsGroup. 2018-07-06 15:42:26 -07:00
Jeff Grafton 23ceebac22 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
Jeff Grafton a725660640 Update to gazelle 0.12.0 and run hack/update-bazel.sh 2018-06-22 16:22:18 -07:00
Kubernetes Submit Queue aa25539ef6
Merge pull request #64451 from wgliang/master.remove-kubelet
Automatic merge from submit-queue (batch tested with PRs 64688, 64451, 64504, 64506, 56358). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

cleanup some dead kubelet code

**Release note**:

```release-note
NONE
```
2018-06-20 05:48:11 -07:00
Seth Jennings f1551798e4 reduce logging for backoff situations 2018-06-13 13:25:20 -05:00
Kubernetes Submit Queue b6f75ac30e
Merge pull request #63717 from ingvagabund/promote-sysctl-annotations-to-fields
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Promote sysctl annotations to fields

#


**What this PR does / why we need it**:

Promoting experimental sysctl feature from annotations to API fields.

**Special notes for your reviewer**:

Following sysctl KEP: https://github.com/kubernetes/community/pull/2093

**Release note**:

```release-note
The Sysctls experimental feature has been promoted to beta (enabled by default via the `Sysctls` feature flag). PodSecurityPolicy and Pod objects now have fields for specifying and controlling sysctls. Alpha sysctl annotations will be ignored by 1.11+ kubelets. All alpha sysctl annotations in existing deployments must be converted to API fields to be effective.
```

**TODO**:

* [x] - Promote sysctl annotation in Pod spec
* [x] - Promote sysctl annotation in PodSecuritySpec spec
* [x] - Feature gate the sysctl
* [x] - Promote from alpha to beta
* [x] - docs PR - https://github.com/kubernetes/website/pull/8804
2018-06-06 00:47:36 -07:00
Seth Jennings 6729add11c sysctls: create feature gate to track promotion 2018-06-06 00:23:11 +02:00
Jan Chaloupka 3cc15363bc Run make update 2018-06-06 00:12:40 +02:00
Jan Chaloupka ab616a88b9 Promote sysctl annotations to API fields 2018-06-05 23:17:00 +02:00
Pengfei Ni 6da502e016 Setup windows security context in CRI 2018-06-05 09:27:40 +08:00
Lantao Liu aeb6cacf01 Remove direct and indirect streaming runtime interface. 2018-05-29 15:08:15 -07:00
Guoliang Wang 9449a4372e cleanup some dead kubelet code 2018-05-29 22:38:01 +08:00
Lantao Liu 4bb16659ee Make kubelet `ReadLogs` backward compatible.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-04-27 16:03:29 -07:00
Kubernetes Submit Queue 284e8182a4
Merge pull request #63160 from sjenning/no-waitlogs-stopped-pod
Automatic merge from submit-queue (batch tested with PRs 63252, 63160). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubelet: logs: do not wait when following terminated container

Currently, a `kubectl logs -f` on a terminated container will output the logs, wait 5 seconds (`stateCheckPeriod`), then return.  The 5 seconds delay should not occur as the container is terminated and unable to generate additional log messages.

This PR puts a check at the beginning of `waitLogs()` to avoid doing the wait when the container is not running.

@derekwaynecarr @smarterclayton
2018-04-27 12:27:05 -07:00
Seth Jennings 5da3a1d514 kubelet: logs: do not wait on following terminated container 2018-04-26 16:53:54 -05:00
Kubernetes Submit Queue a38a02792b
Merge pull request #62662 from wangzhen127/runtime-default
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Change seccomp annotation from "docker/default" to "runtime/default"

**What this PR does / why we need it**:
This PR changes seccomp annotation from "docker/default" to "runtime/default", so that it is can be applied to all kinds of container runtimes. This PR is a followup of [#1963](https://github.com/kubernetes/community/pull/1963).

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #39845

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-04-26 14:33:53 -07:00
Kubernetes Submit Queue c778d871e0
Merge pull request #58740 from YuxiJin-tobeyjin/add-ut-for-kuberuntime-gc
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add ut for kuberuntime-gc

**What this PR does / why we need it**:
Add ut for kuberuntime-gc to cover more situations:
1) Add two uncovered cases to test sandbox-gc 
(1)  When there are more than one exited sandboxes,the older exited sandboxes without containers for existing pods should be garbage collected;
(2)  Even though there are more than one exited sandboxes,the older exited sandboxes with containers for existing pods should not be garbage collected. 
2) Add one uncovered case to test container-gc
(1)  To cover the situation when allSourcesReady is set false;

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
 "NONE"
```
2018-04-19 12:27:19 -07:00
Zhen Wang e102633ae8 Change docker/default to runtime/default 2018-04-19 10:39:53 -07:00
Kubernetes Submit Queue 03b80bd2c7
Merge pull request #62416 from sjenning/fix-waitlogs-err-msg
Automatic merge from submit-queue (batch tested with PRs 62455, 62465, 62427, 62416, 62411). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kuberuntime: logs: reduce logging level on waitLogs msg

Lots of occurrences of this msg coming from `waitLogs()`:
```
E0411 13:17:04.589338    7645 logs.go:383] Container "4fbf541ed1900c4670216a6a1ecf752cd07ac430f5547c5497fbc4b78e564b78" is not running (state="CONTAINER_EXITED")
E0411 14:02:18.168502    7645 logs.go:383] Container "dba4c535666d05310889965418592727047320743a233e226e2266b399836150" is not running (state="CONTAINER_EXITED")
E0411 14:02:41.342645    7645 logs.go:383] Container "a946289b36fe3c375c29dce020005424f3b980237892253d42b8bd8bfb595756" is not running (state="CONTAINER_EXITED")
E0411 14:02:49.907317    7645 logs.go:383] Container "e1d6014330e7422c03ae6db501d4fb296a4501355517cb60e2f910f54741361d" is not running (state="CONTAINER_EXITED")
```
Added in https://github.com/kubernetes/kubernetes/pull/55140

This message prints whenever something is watching the log when the container dies.

The comment right after the error msg say "this is normal" and thus should not be logged at Error level.

@derekwaynecarr @feiskyer @Random-Liu
2018-04-12 08:54:21 -07:00
Seth Jennings c58b0183f2 kuberuntime: logs: reduce logging level on waitLogs msg 2018-04-11 13:12:04 -05:00
Kubernetes Submit Queue 6816227dfc
Merge pull request #59027 from YuxiJin-tobeyjin/add-ut-for-legacyLogSymlink
Automatic merge from submit-queue (batch tested with PRs 59027, 62333, 57661, 62086, 61584). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add UT case to cover the func legacyLogSymlink  in legacy.go

**What this PR does / why we need it**:

Add UT case to cover the func legacyLogSymlink in legacy.go.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
"NONE"
```
2018-04-10 22:53:12 -07:00
Kubernetes Submit Queue 502c99f2a2
Merge pull request #60851 from aveshagarwal/master-rhbz-1548987
Automatic merge from submit-queue (batch tested with PRs 60759, 60531, 60923, 60851, 58717). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Do not create dangling legacy symlink

Do not create dangling legacy symlink if the new symlink to container logs does not exist.
These dangling legacy symlink are later removed by kube runtime gc, so it's better if we do not
create them in the first place to avoid unnecessary work from kube runtime gc. This situation occurs when docker uses journald logging driver.  

**What this PR does / why we need it**:
This PR fixes an issue where dangling symlink are being created.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
None.
```
@derekwaynecarr @sjenning @dashpole @kubernetes/sig-node-pr-reviews
2018-03-20 15:34:37 -07:00
Avesh Agarwal 81081128f4 Do not create dangling legacy symlink if the new symlink to container logs does not exist.
These dangling legacy symlink are removed by kube runtime gc, so it's better if we do not
create them in the first place to avoid unnecessary work from kube runtime gc.
2018-03-05 16:40:43 -05:00
Jan Safranek 5110db5087 Lock subPath volumes
Users must not be allowed to step outside the volume with subPath.
Therefore the final subPath directory must be "locked" somehow
and checked if it's inside volume.

On Windows, we lock the directories. On Linux, we bind-mount the final
subPath into /var/lib/kubelet/pods/<uid>/volume-subpaths/<container name>/<subPathName>,
it can't be changed to symlink user once it's bind-mounted.
2018-03-05 09:14:44 +01:00
Kubernetes Submit Queue a21a750249
Merge pull request #59333 from feiskyer/win
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubelet: setup WindowsContainerResources for windows containers

**What this PR does / why we need it**:

This PR setups WindowsContainerResources for windows containers. It implements proposal here: https://github.com/kubernetes/community/pull/1510.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #56734

**Special notes for your reviewer**:

**Release note**:

```release-note
WindowsContainerResources is set now for windows containers
```
2018-02-27 20:34:13 -08:00
Pengfei Ni b0a49e1970 Update unit tests and bazel files 2018-02-28 09:56:46 +08:00
Pengfei Ni 3c5e493482 Setup windows container config to kubelet CRI 2018-02-28 09:56:41 +08:00
Kubernetes Submit Queue b79fe10730
Merge pull request #54739 from xiangpengzhao/handleerr
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add FailedPostStartHook error message.

**What this PR does / why we need it**:

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #54671

**Special notes for your reviewer**:
/cc @derekwaynecarr 
cc @lovejoy @OJezu

**Release note**:

```release-note
NONE
```
2018-02-27 13:11:39 -08:00
Kubernetes Submit Queue fe0e80e8da
Merge pull request #60181 from verb/pid-enable
Automatic merge from submit-queue (batch tested with PRs 59463, 59719, 60181, 58283, 59966). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Set shared PID namespace mode based on PodSpec

**What this PR does / why we need it**: This PR enables pod process namespace sharing as an alpha feature, as described in [Shared PID Namespace Proposal](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/pod-pid-namespace.md).

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
WIP #1615

**Special notes for your reviewer**:
/assign @dchen1107 

**Release note**:

```release-note
When the `PodShareProcessNamespace` alpha feature is enabled, setting `pod.Spec.ShareProcessNamespace` to `true` will cause a single process namespace to be shared between all containers in a pod.
```
2018-02-23 00:34:26 -08:00
Kubernetes Submit Queue f05a065738
Merge pull request #59713 from hanxiaoshuai/fix0211
Automatic merge from submit-queue (batch tested with PRs 60208, 60084, 60183, 59713, 60096). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use SeekStart, SeekCurrent, and SeekEnd repalace of deprecated constant

**What this PR does / why we need it**:
Use SeekStart, SeekCurrent, and SeekEnd repalace of deprecated constant.
'''
// Deprecated: Use io.SeekStart, io.SeekCurrent, and io.SeekEnd.
const (
	SEEK_SET int = 0 // seek relative to the origin of the file
	SEEK_CUR int = 1 // seek relative to the current offset
	SEEK_END int = 2 // seek relative to the end
)

'''
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-02-22 23:17:38 -08:00
Kubernetes Submit Queue 742c9b158d
Merge pull request #59906 from abhi/log_stats
Automatic merge from submit-queue (batch tested with PRs 54191, 59374, 59824, 55032, 59906). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Adding per container stats for CRI runtimes

**What this PR does / why we need it**

This commit aims to collect per container log stats. The change was proposed as a part of #55905. The change includes change the log path from /var/pod/<pod uid>/containername_attempt.log to /var/pod/<pod uid>/containername/containername_attempt.log. The logs are collected by reusing volume package to collect metrics from the log path.
Fixes #55905

**Special notes for your reviewer:**
cc @Random-Liu

**Release note:**

```
Adding container log stats for CRI runtimes.
```
2018-02-21 19:40:42 -08:00
Lee Verberne b9e8a8a6de Set shared PID namespace mode based on PodSpec 2018-02-22 03:51:35 +01:00