Commit Graph

4350 Commits (35c2e70dd1af1479a9d6d8f23697e42763f4bc74)

Author SHA1 Message Date
deads2k c2ae6d5b40 remove api to util dependency hiding types 2017-01-25 08:28:28 -05:00
Kubernetes Submit Queue df42444742 Merge pull request #40216 from sttts/sttts-more-cutoffs
Automatic merge from submit-queue (batch tested with PRs 39260, 40216, 40213, 40325, 40333)

genericapiserver: more dependency cutoffs

- cut-off pkg/api.Resource and friends - lgtm
- authn plugins -> k8s.io/apiserver - 
- webhook authz plugin -> k8s.io/apiserver - lgtm
- ~~pkg/cert -> k8s.io/apimachinery (will rebase on @deads2k's PR also moving it)~~
- split pkg/config into kubelet config merger and flags - lgtm
- split feature gate between generic apiserver and kube - lgtm
- move pkg/util/flag into k8s.io/apiserver - lgtm
2017-01-24 16:26:00 -08:00
Kubernetes Submit Queue aacb222085 Merge pull request #40344 from smarterclayton/move_all_options
Automatic merge from submit-queue

Move remaining *Options to metav1

Primarily delete options, but will remove all internal references to non-metav1 options (except ListOptions).

Still working through it @sttts @deads2k
2017-01-24 14:11:38 -08:00
Dr. Stefan Schimanski 2b8e938128 Update generated files 2017-01-24 20:56:03 +01:00
Dr. Stefan Schimanski 82826ec273 pkg/util/flag: move to k8s.io/apiserver 2017-01-24 20:56:03 +01:00
Dr. Stefan Schimanski a6b2ebb50c pkg/flag: make feature gate extensible and split between generic and kube 2017-01-24 20:56:03 +01:00
Dr. Stefan Schimanski 56d60cfae6 pkg/util: move flags from pkg/util/config to pkg/util/flags 2017-01-24 20:56:03 +01:00
Kubernetes Submit Queue 92c5457854 Merge pull request #40327 from yujuhong/rm_code
Automatic merge from submit-queue (batch tested with PRs 39275, 40327, 37264)

dockertools: remove some dead code

Remove `dockerRoot` that's not used anywhere.
2017-01-24 10:52:10 -08:00
Kubernetes Submit Queue 284dfb270e Merge pull request #39275 from ivan4th/fix-bad-fake-runtime-time-values
Automatic merge from submit-queue

Fix bad time values in kubelet FakeRuntimeService

These values don't affect tests but they can be confusing
for developers looking at the code for reference.
2017-01-24 10:50:14 -08:00
Clayton Coleman be6d2933df
refactor: Move *Options references to metav1 2017-01-24 13:41:51 -05:00
Clayton Coleman 7b1c715496
generated: Move references to metav1.*Options 2017-01-24 13:41:48 -05:00
Jitendra Bhurat 0cbf75c400
kubelet: Fix ConfigMap on Windows. 2017-01-24 18:40:49 +00:00
deads2k 5a8f075197 move authoritative client-go utils out of pkg 2017-01-24 08:59:18 -05:00
Michael Fraenkel 7ddad11058 Use SecretManager when getting secrets for EnvFrom 2017-01-24 05:05:48 -07:00
Kubernetes Submit Queue 43286a82c6 Merge pull request #39981 from fraenkel/optional_configmaps_secrets
Automatic merge from submit-queue

Optional configmaps and secrets

Allow configmaps and secrets for environment variables and volume sources to be optional

Implements approved proposal c9f881b7bb

Release note:
```release-note
Volumes and environment variables populated from ConfigMap and Secret objects can now tolerate the named source object or specific keys being missing, by adding `optional: true` to the volume or environment variable source specifications.
```
2017-01-23 23:06:35 -08:00
Pengfei Ni e2fa0ea87d CRI: verify responses from remote runtime 2017-01-24 10:16:17 +08:00
Michael Fraenkel 4e466040d9 Allow Optional ConfigMap and Secrets
- ConfigMaps and Secrets for Env or Volumes are allowed to be optional
2017-01-23 18:59:49 -07:00
Clayton Coleman 9009c1ac14
generated: informer,client 2017-01-23 17:52:47 -05:00
Clayton Coleman 469df12038
refactor: move ListOptions references to metav1 2017-01-23 17:52:46 -05:00
Clayton Coleman 245b592fac
Convert core code to metav1.ListOptions 2017-01-23 17:52:45 -05:00
Yu-Ju Hong c1d043af18 dockertools: remove some dead code 2017-01-23 14:34:56 -08:00
Kubernetes Submit Queue 13424d874b Merge pull request #40208 from wojtek-t/smart_volume_manager
Automatic merge from submit-queue (batch tested with PRs 40205, 40208)

Make secret volume plugin use secret manager

Ref #19188

@gmarek
2017-01-23 13:40:03 -08:00
Clayton Coleman 6ea557d4b2
Fix tests after new defaulted value added 2017-01-23 12:37:21 -05:00
Clayton Coleman 2bb2604f0b
Limit the size of the termination log and allow log input
Enforce the following limits:

12kb for total message length in container status
4kb for the termination message path file
2kb or 80 lines (whichever is shorter) from the log on error

Fallback to log output if the user requests it.
2017-01-23 12:26:38 -05:00
Clayton Coleman eff134cd5f
Use chmod to bypass umask on termination log file
os.Create() will obey the umask which results in the file being 0644
when injected in the container.
2017-01-23 12:26:37 -05:00
Wojciech Tyczynski e0784f2e00 Propage secret volumes in secret manager 2017-01-23 16:10:01 +01:00
Wojciech Tyczynski bf7138652f SecretVolume using secret manager 2017-01-23 16:10:01 +01:00
Kubernetes Submit Queue 0c41d538fc Merge pull request #40196 from resouer/remove-todo
Automatic merge from submit-queue

Remove TODOs to refactor kubelet labels

To address #39650 completely.

Remove label refactoring TODOs, we don't need them since CRI rollout is on the way.
2017-01-23 05:07:32 -08:00
Harry Zhang 6fd6f0e4a6 Remove TODOs to refactor kubelet labels 2017-01-22 13:07:19 +08:00
Kubernetes Submit Queue 8d5227bb2e Merge pull request #40210 from mikebryant/fix-kubelet-node-deletion-typo
Automatic merge from submit-queue (batch tested with PRs 40250, 40134, 40210)

Typo fix: Change logging function to formatting version

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

Slightly broken logging message:
```
I0120 10:56:08.555712    7575 kubelet_node_status.go:135] Deleted old node object %qkubernetes-cit-kubernetes-cr0-0
```
2017-01-20 18:15:36 -08:00
Kubernetes Submit Queue 470e732d7f Merge pull request #40235 from deads2k/generic-26-listers
Automatic merge from submit-queue (batch tested with PRs 40232, 40235, 40237, 40240)

move listers out of cache to reduce import tree

Moving the listers from `pkg/client/cache` snips links to all the different API groups from `pkg/storage`, but the dreaded `ListOptions` remains.

@sttts
2017-01-20 14:22:51 -08:00
Kubernetes Submit Queue b5929bfb2b Merge pull request #38789 from jessfraz/cleanup-temp-dirs
Automatic merge from submit-queue (batch tested with PRs 37228, 40146, 40075, 38789, 40189)

Cleanup temp dirs

So funny story my /tmp ran out of space running the unit tests so I am cleaning up all the temp dirs we create.
2017-01-20 12:34:58 -08:00
Kubernetes Submit Queue dcf14add92 Merge pull request #37228 from sjenning/teardown-terminated-volumes
Automatic merge from submit-queue (batch tested with PRs 37228, 40146, 40075, 38789, 40189)

kubelet: storage: teardown terminated pod volumes

This is a continuation of the work done in https://github.com/kubernetes/kubernetes/pull/36779

There really is no reason to keep volumes for terminated pods attached on the node.  This PR extends the removal of volumes on the node from memory-backed (the current policy) to all volumes.

@pmorie raised a concern an impact debugging volume related issues if terminated pod volumes are removed.  To address this issue, the PR adds a `--keep-terminated-pod-volumes` flag the kubelet and sets it for `hack/local-up-cluster.sh`.

For consideration in 1.6.

Fixes #35406

@derekwaynecarr @vishh @dashpole

```release-note
kubelet tears down pod volumes on pod termination rather than pod deletion
```
2017-01-20 12:34:52 -08:00
deads2k 1ce0637b27 move listers out of cache to reduce import tree 2017-01-20 15:01:38 -05:00
Kubernetes Submit Queue 54ff406702 Merge pull request #40159 from euank/beware-of-shadows
Automatic merge from submit-queue (batch tested with PRs 40011, 40159)

dockertools/nsenterexec: fix err shadow

The shadow of err meant the combination of `exec-handler=nsenter` +
`tty` + a non-zero exit code meant that the exit code would be LOST
FOREVER 👻

This isn't all that important since no one really used the nsenter exec
handler as I understand it

```release-note
NONE
```
2017-01-20 10:48:45 -08:00
Ivan Shvedunov 7a4ecc5c58 Fix bad time values in kubelet FakeRuntimeService
These values don't affect tests but they can be confusing
for developers looking at the code for reference.
2017-01-20 20:44:04 +03:00
Kubernetes Submit Queue 22a405055d Merge pull request #40170 from deads2k/client-10-restclient
Automatic merge from submit-queue (batch tested with PRs 36693, 40154, 40170, 39033)

make client-go authoritative for pkg/client/restclient

Moves client/restclient to client-go and a util/certs, util/testing as transitives.
2017-01-20 09:18:52 -08:00
Seth Jennings e2750a305a reclaim terminated pod volumes 2017-01-20 11:08:35 -06:00
Kubernetes Submit Queue 53b43d6f8f Merge pull request #40190 from yujuhong/nsenter_exec
Automatic merge from submit-queue (batch tested with PRs 40168, 40165, 39158, 39966, 40190)

dockershim: add support for the 'nsenter' exec handler

This change simply plumbs the kubelet configuration
(--docker-exec-handler) to DockerService.

This fixes #35747.
2017-01-20 08:28:53 -08:00
Kubernetes Submit Queue 0e1a166c4d Merge pull request #39158 from feiskyer/cri-proto3
Automatic merge from submit-queue (batch tested with PRs 40168, 40165, 39158, 39966, 40190)

CRI: upgrade protobuf to v3

For #38854, this PR upgrades CRI protobuf version to v3, and also updated related packages for confirming to new api.  

**Release note**:

```
CRI: upgrade protobuf version to v3.
```
2017-01-20 08:28:49 -08:00
Kubernetes Submit Queue 9841162445 Merge pull request #40165 from Random-Liu/fix-kubelet-owner-file
Automatic merge from submit-queue (batch tested with PRs 40168, 40165, 39158, 39966, 40190)

Small fix in kubelet owner file.

/cc @apelisse @dchen1107 @timstclair
2017-01-20 08:28:47 -08:00
deads2k ee6752ef20 find and replace 2017-01-20 08:04:53 -05:00
deads2k c587b8a21e re-run client-gen 2017-01-20 08:02:36 -05:00
Mike Bryant a507777de8 Change logging function to formatting version 2017-01-20 11:24:05 +00:00
Euan Kemp d55776e85a dockertools/nsenterexec: fix err shadow
The shadow of err meant the combination of `exec-handler=nsenter` +
`tty` + a non-zero exit code meant that the exit code would be LOST
FOREVER 👻

This isn't all that important since no one really used the nsenter exec
handler as I understand it
2017-01-20 01:19:18 -08:00
Kubernetes Submit Queue 2d4d2f913f Merge pull request #39446 from fraenkel/env_secrets
Automatic merge from submit-queue (batch tested with PRs 39446, 40023, 36853)

Create environment variables from secrets

Allow environment variables to be populated from entire secrets.

**Release note**:
```release-note
Populate environment variables from a secrets.
```
2017-01-19 18:53:45 -08:00
Pengfei Ni 53c20e3630 kubelet/kuberuntime: update cri to protobuf v3 2017-01-20 09:55:56 +08:00
Pengfei Ni d4bfcd1fda kubelet/dockershim: update cri to protobuf v3 2017-01-20 09:55:37 +08:00
Pengfei Ni e77e61b3bb kubelet/rktshim: update cri to protobuf v3 2017-01-20 09:55:19 +08:00
Pengfei Ni 76afc7300d kubelet/remote: update cri to protobuf v3 2017-01-20 09:55:07 +08:00
Pengfei Ni 8e4ea2dd15 kubelet/server: update cri to protobuf v3 2017-01-20 09:54:49 +08:00
Pengfei Ni 97fff6a7cf kubelet/api: update cri to protobuf v3 2017-01-20 09:54:28 +08:00
Pengfei Ni 9cab3b4a07 CRI: update protobuf to v3 2017-01-20 09:54:03 +08:00
Kubernetes Submit Queue 51919b4e1e Merge pull request #39772 from mikedanese/v1beta1
Automatic merge from submit-queue

promote certificates api to beta

Mostly posting to see what breaks but also this API is ready to be promoted.

```release-note
Promote certificates.k8s.io to beta and enable it by default. Users using the alpha certificates API should delete v1alpha1 CSRs from the API before upgrading and recreate them as v1beta1 CSR after upgrading.
```

@kubernetes/api-approvers @jcbsmpsn @pipejakob
2017-01-19 17:48:16 -08:00
Yu-Ju Hong f9479ed84b dockershim: add support for the 'nsenter' exec handler
This change simply plumbs the kubelet configuration
(--docker-exec-handler) to DockerService.
2017-01-19 16:23:48 -08:00
Mike Danese 44b7246568 autogenerated 2017-01-19 14:24:45 -08:00
Mike Danese 96c146c8f2 promote certificates.k8s.io to beta 2017-01-19 13:13:20 -08:00
gmarek 3c0d2bb1f0 Add SecretManager to Kubelet 2017-01-19 20:12:04 +01:00
Random-Liu 1027b14e3e Small fix in kubelet owner file. 2017-01-19 11:04:57 -08:00
Wojciech Tyczynski 09e4de385c Enable nontrivial secret manager 2017-01-19 19:47:33 +01:00
Wojciech Tyczynski ffd8daf488 SecretManager with caching 2017-01-19 19:47:32 +01:00
Wojciech Tyczynski 85ee9e570b Create SecretManager interface 2017-01-19 19:47:32 +01:00
Michael Fraenkel 13d693d220 Secrets can populate environment variables 2017-01-19 13:46:05 -05:00
Kubernetes Submit Queue e9d4e4341c Merge pull request #40087 from deads2k/generic-24-move-fields
Automatic merge from submit-queue

move pkg/fields to apimachinery

Purely mechanical move of `pkg/fields` to apimachinery.  

Discussed with @lavalamp on slack.  Moving this an `labels` to apimachinery.

@liggitt any concerns?  I think the idea of field selection should become generic and this ends up shared between client and server, so this is a more logical location.
2017-01-19 08:48:17 -08:00
Kubernetes Submit Queue 05c2a0825e Merge pull request #38871 from k82cn/k8s_25318
Automatic merge from submit-queue

Made multi-scheduler graduated to Beta and then v1.

fixes #25318
2017-01-19 07:58:51 -08:00
deads2k 11e8068d3f move pkg/fields to apimachinery 2017-01-19 09:50:16 -05:00
Kubernetes Submit Queue ac857a5ade Merge pull request #40106 from deads2k/client-09-switch
Automatic merge from submit-queue

make client-go more authoritative

Builds on https://github.com/kubernetes/kubernetes/pull/40103

This moves a few more support package to client-go for origination.  
 1. restclient/watch - nodep
 1. util/flowcontrol - used interface
 1. util/integer, util/clock - used in controllers and in support of util/flowcontrol
2017-01-19 06:34:49 -08:00
deads2k c47717134b move utils used in restclient to client-go 2017-01-19 07:55:14 -05:00
Klaus Ma c8c4b81963 Made multi-scheduler graduated to Beta and then v1. 2017-01-19 20:16:01 +08:00
Dr. Stefan Schimanski 3d9449a353 genericapiserver: fix imports 2017-01-19 13:06:47 +01:00
Kubernetes Submit Queue 0144fae64f Merge pull request #29666 from vefimova/fix_29270
Automatic merge from submit-queue

Fixed merging of host's and dns' search lines

Fixed forming of pod's Search line in resolv.conf:
 - exclude duplicates while merging of host's and dns' search lines to form pod's one
 - truncate pod's search line if it exceeds resolver limits: is > 255 chars and containes > 6 searches
 - monitoring the resolv.conf file which is used by kubelet (set thru --resolv-conf="") and logging and eventing if search line in it consists of more than 3 entries (or 6 if Cluster Domain is set) or its lenght is > 255 chars
 - logging and eventing when a pod's search line is > 255 chars or containes > 6 searches during forming

Fixes #29270

**Release note**:

```release-note
Fixed forming resolver search line for pods: exclude duplicates, obey libc limitations, logging and eventing appropriately.
```
2017-01-19 01:37:50 -08:00
Kubernetes Submit Queue 5ca25bea21 Merge pull request #36528 from apelisse/owners-pkg-kubelet
Automatic merge from submit-queue

Curating Owners: pkg/kubelet

cc @euank @vishh @dchen1107 @feiskyer @yujuhong @yifan-gu @derekwaynecarr @saad-ali

In an effort to expand the existing pool of reviewers and establish a
two-tiered review process (first someone lgtms and then someone
experienced in the project approves), we are adding new reviewers to
existing owners files.


If You Care About the Process:
------------------------------

We did this by algorithmically figuring out who’s contributed code to
the project and in what directories.  Unfortunately, that doesn’t work
well: people that have made mechanical code changes (e.g change the
copyright header across all directories) end up as reviewers in lots of
places.

Instead of using pure commit data, we generated an excessively large
list of reviewers and pruned based on all time commit data, recent
commit data and review data (number of PRs commented on).

At this point we have a decent list of reviewers, but it needs one last
pass for fine tuning.

Also, see https://github.com/kubernetes/contrib/issues/1389.

TLDR:
-----

As an owner of a sig/directory and a leader of the project, here’s what
we need from you:

1. Use PR https://github.com/kubernetes/kubernetes/pull/35715 as an example.

2. The pull-request is made editable, please edit the `OWNERS` file to
remove the names of people that shouldn't be reviewing code in the
future in the **reviewers** section. You probably do NOT need to modify
the **approvers** section. Names asre sorted by relevance, using some
secret statistics.

3. Notify me if you want some OWNERS file to be removed.  Being an
approver or reviewer of a parent directory makes you a reviewer/approver
of the subdirectories too, so not all OWNERS files may be necessary.

4. Please use ALIAS if you want to use the same list of people over and
over again (don't hesitate to ask me for help, or use the pull-request
above as an example)
2017-01-18 13:14:25 -08:00
Antoine Pelisse 3d82265340 Update OWNERS approvers and reviewers: pkg/kubelet 2017-01-18 10:27:11 -08:00
Jordan Liggitt e49554501f
Use versioned Taint/Toleration/AllowPods objects when marshalling 2017-01-18 12:52:14 -05:00
deads2k 4f915039e4 move pkg/client/transport to client-go 2017-01-18 07:56:01 -05:00
Kubernetes Submit Queue 180936f8df Merge pull request #39826 from shyamjvs/fake-docker-client-fix
Automatic merge from submit-queue

Made tracing of calls and container lifecycle steps in FakeDockerClient optional

Fixes #39717 

Slightly refactored the FakeDockerClient code and made tracing optional (but enabled by default).

@yujuhong @Random-Liu
2017-01-17 21:11:36 -08:00
Clayton Coleman 9a2a50cda7
refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
Shyam Jeedigunta 814c850fe5 Made tracing of calls and container lifecycle steps in FakeDockerClient optional 2017-01-17 18:56:39 +01:00
vefimova d925439727 Fixed forming of pod's Search line in resolv.conf:
- exclude duplicates while merging of host's and dns' search lines to form pod's one
 - truncate pod's search line if it exceeds resolver limits: is > 255 chars and containes > 6 searches
 - monitoring the resolv.conf file which is used by kubelet (set thru --resolv-conf="") and logging and eventing if search line in it consists of more than 3 entries
   (or 6 if Cluster Domain is set) or its lenght is > 255 chars
 - logging and eventing when a pod's search line is > 255 chars or containes > 6 searches during forming
Fixes #29270
2017-01-17 13:18:26 +00:00
Julien Balestra 3841690dbf Kubelet-rkt: Add useful informations for Ops on the Kubelet Host
Create a Systemd SyslogIdentifier inside the [Service]
Create a Systemd Description inside the [Unit]
2017-01-17 10:29:50 +01:00
Kubernetes Submit Queue d270ec0ed2 Merge pull request #37680 from mfojtik/report-pod-name
Automatic merge from submit-queue

Report the Pod name and namespace when kubelet fails to sync the container

This helps debugging problems with SELinux (and other problems related to the Docker failed to run the container) as currently only the UUID of the Pod is reported:

```
Error syncing pod 670f607d-b5a8-11a4-b673-005056b7468b, skipping: failed to "StartContainer" for "deployment" with RunContainerError: "runContainer: Error response from daemon: Relabeling content in /usr is not allowed."
```

Here it would be useful to know what pod in which namespace is trying to mount the "/usr".
2017-01-16 23:59:44 -08:00
deads2k 8686d67c80 move pkg/util/rand 2017-01-16 16:04:03 -05:00
Michal Fojtik 34db84efe2
Report the Pod name and namespace when kubelet fails to sync the container 2017-01-16 16:44:56 +01:00
deads2k 77b4d55982 mechanical 2017-01-16 09:35:12 -05:00
Kubernetes Submit Queue eb9f953496 Merge pull request #39876 from deads2k/generic-20-deps-03
Automatic merge from submit-queue

move more things to apiserver

```
pkg/genericapiserver/api/handlers/negotiation/ -> apiserver/pkg/handlers/negotiation
pkg/genericapiserver/api/metrics -> apiserver/pkg/metrics
pkg/genericapiserver/api/request -> apiserver/pkg/request
pkg/util/wsstream -> apiserver/pkg/util/wsstream
plugin/pkg/auth/authenticator/request/headerrequest -> apiserver/pkg/authentication/request/headerrequest
plugin/pkg/webhook -> apiserver/pkg/webhook
```

and mechanicals.

`k8s.io/kubernetes/pkg/genericapiserver/routes/data/swagger` needs to be sorted out.
2017-01-16 04:14:37 -08:00
Kubernetes Submit Queue e73e749459 Merge pull request #39679 from errows/fix_sucessfully_typos
Automatic merge from submit-queue (batch tested with PRs 39417, 39679)

Fix 2 `sucessfully` typos

**What this PR does / why we need it**: Only fixes two typos in comments/logging

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-01-14 19:51:09 -08:00
Kubernetes Submit Queue 5b629d83a2 Merge pull request #39303 from NickrenREN/eviction-manager
Automatic merge from submit-queue (batch tested with PRs 37505, 39844, 39525, 39109, 39303)

remove NewManager() return err
2017-01-13 14:33:35 -08:00
deads2k 31b6ba4e94 mechanicals 2017-01-13 16:33:09 -05:00
Kubernetes Submit Queue a6fa5c2bfd Merge pull request #39814 from deads2k/api-58-multi-register
Automatic merge from submit-queue

replace global registry in apimachinery with global registry in k8s.io/kubernetes

We'd like to remove all globals, but our immediate problem is that a shared registry between k8s.io/kubernetes and k8s.io/client-go doesn't work.  Since client-go makes a copy, we can actually keep a global registry with other globals in pkg/api for now.

@kubernetes/sig-api-machinery-misc @lavalamp @smarterclayton @sttts
2017-01-13 12:37:02 -08:00
Kubernetes Submit Queue 7dd815221c Merge pull request #39838 from foxyriver/add-break
Automatic merge from submit-queue

break from the for loop

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

exit loop, because the following actions will not affect the result

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-01-13 11:43:48 -08:00
deads2k f1176d9c5c mechanical repercussions 2017-01-13 08:27:14 -05:00
Kubernetes Submit Queue 3fa44312ad Merge pull request #38631 from ncdc/fix-kubelet-cadvisor-build-tags
Automatic merge from submit-queue

Fix cadvisor_unsupported.go build tags

Make it so cadvisor_unsupported.go is used for linux without cgo or
non-linux/windows OSes.
2017-01-12 21:32:39 -08:00
Kubernetes Submit Queue 9a88687e24 Merge pull request #37865 from yujuhong/decouple_lifecycle
Automatic merge from submit-queue

kubelet: remove the pleg health check from healthz

This prevents kubelet from being killed when docker hangs.

Also, kubelet will report node not ready if PLEG hangs (`docker ps` + `docker inspect`).
2017-01-12 19:10:14 -08:00
foxyriver b35dc8ecd7 break from the for loop 2017-01-13 09:34:31 +08:00
foxyriver 659c7df3c6 modify-comment 2017-01-13 09:27:23 +08:00
Kubernetes Submit Queue 082ce00eca Merge pull request #39478 from rrati/pod-affinity-api-fields
Automatic merge from submit-queue (batch tested with PRs 39803, 39698, 39537, 39478)

[scheduling] Moved pod affinity and anti-affinity from annotations to api fields #25319

Converted pod affinity and anti-affinity from annotations to api fields

Related: #25319
Related: #34508

**Release note**:
```Pod affinity and anti-affinity has moved from annotations to api fields in the pod spec.  Pod affinity or anti-affinity that is defined in the annotations will be ignored.```
2017-01-12 15:06:33 -08:00
Kubernetes Submit Queue ee49906c45 Merge pull request #39661 from NickrenREN/clientset-redundant-modify
Automatic merge from submit-queue

fix redundant alias clientset

remove redundant alias clientset
2017-01-12 13:29:16 -08:00
Robert Rati 6a3ad93d6c [scheduling] Moved pod affinity and anti-affinity from annotations to api
fields. #25319
2017-01-12 14:54:29 -05:00
NickrenREN ad1f0d30e0 delete ErrorTimeout() function and modify Umask() args
ErrorTimeout is never used
2017-01-12 11:05:30 +08:00
NickrenREN a12dea14e0 fix redundant alias clientset 2017-01-12 10:21:05 +08:00
Kubernetes Submit Queue 4ac5f278c5 Merge pull request #38742 from timstclair/cri-exec-long
Automatic merge from submit-queue

[CRI] Don't include user data in CRI streaming redirect URLs

Fixes: https://github.com/kubernetes/kubernetes/issues/36187

Avoid userdata in the redirect URLs by caching the {Exec,Attach,PortForward}Requests with a unique token. When the redirect URL is created, the token is substituted for the request params. When the streaming server receives the token request, the token is used to fetch the actual request parameters out of the cache.

For additional security, the token is generated using the secure random function, is single use (i.e. the first request with the token consumes it), and has a short expiration time.

/cc @kubernetes/sig-node
2017-01-11 17:16:07 -08:00
Tim St. Clair c17f3ee367
Don't include user data in CRI streaming redirect URLs 2017-01-11 13:40:43 -08:00
deads2k c4fae4e690 mechanical repercussions 2017-01-11 15:20:36 -05:00
Kubernetes Submit Queue 636902c759 Merge pull request #39731 from apprenda/dockertools_fix
Automatic merge from submit-queue

Fix kubelet cross build

**What this PR does / why we need it**: Cross builds are not passing for MacOS and Windows. We are expecting Windows binaries for `kubelet` and `kube-proxy` to be released by the first time with 1.5.2 to be released later today.

**Which issue this PR fixes**:
fixes #39005
fixes #39714

**Special notes for your reviewer**: /cc @feiskyer @smarterclayton @vishh this should be P0 in order to be merged before 1.5.2 and obviously fix the cross build.
2017-01-11 10:53:27 -08:00
Kubernetes Submit Queue bc861bf756 Merge pull request #39475 from deads2k/generic-14-apimachinery
Automatic merge from submit-queue (batch tested with PRs 39475, 38666, 39327, 38396, 39613)

Create k8s.io/apimachinery repo

Don't panic.

The diff is quite large, but its all generated change.  The first few commits are where are all the action is.  I built a script to find the fanout from 
```
k8s.io/kubernetes/pkg/apimachinery/registered
k8s.io/kubernetes/pkg/runtime/serializer
k8s.io/kubernetes/pkg/runtime/serializer/yaml
k8s.io/kubernetes/pkg/runtime/serializer/streaming
k8s.io/kubernetes/pkg/runtime/serializer/recognizer/testing 
```

It copied 
```
k8s.io/kubernetes/pkg/api/meta
k8s.io/kubernetes/pkg/apimachinery
k8s.io/kubernetes/pkg/apimachinery/registered
k8s.io/kubernetes/pkg/apis/meta/v1
k8s.io/kubernetes/pkg/apis/meta/v1/unstructured
k8s.io/kubernetes/pkg/conversion
k8s.io/kubernetes/pkg/conversion/queryparams
k8s.io/kubernetes/pkg/genericapiserver/openapi/common - this needs to renamed post-merge.  It's just types
k8s.io/kubernetes/pkg/labels
k8s.io/kubernetes/pkg/runtime
k8s.io/kubernetes/pkg/runtime/schema
k8s.io/kubernetes/pkg/runtime/serializer
k8s.io/kubernetes/pkg/runtime/serializer/json
k8s.io/kubernetes/pkg/runtime/serializer/protobuf
k8s.io/kubernetes/pkg/runtime/serializer/recognizer
k8s.io/kubernetes/pkg/runtime/serializer/recognizer/testing
k8s.io/kubernetes/pkg/runtime/serializer/streaming
k8s.io/kubernetes/pkg/runtime/serializer/versioning
k8s.io/kubernetes/pkg/runtime/serializer/yaml
k8s.io/kubernetes/pkg/selection
k8s.io/kubernetes/pkg/types
k8s.io/kubernetes/pkg/util/diff
k8s.io/kubernetes/pkg/util/errors
k8s.io/kubernetes/pkg/util/framer
k8s.io/kubernetes/pkg/util/json
k8s.io/kubernetes/pkg/util/net
k8s.io/kubernetes/pkg/util/runtime
k8s.io/kubernetes/pkg/util/sets
k8s.io/kubernetes/pkg/util/validation
k8s.io/kubernetes/pkg/util/validation/field
k8s.io/kubernetes/pkg/util/wait
k8s.io/kubernetes/pkg/util/yaml
k8s.io/kubernetes/pkg/watch
k8s.io/kubernetes/third_party/forked/golang/reflect
```

The script does the import rewriting and gofmt.  Then you do a build, codegen, bazel update, and it produces all the updates.

If we agree this is the correct approach.  I'll create a verify script to make sure that no one messes with any files in the "dead" packages above.

@kubernetes/sig-api-machinery-misc @smarterclayton @sttts @lavalamp @caesarxuchao 

`staging/prime-apimachinery.sh && hack/update-codegen.sh && nice make WHAT="federation/cmd/federation-apiserver/ cmd/kube-apiserver" && hack/update-openapi-spec.sh && hack/update-federation-openapi-spec.sh && hack/update-codecgen.sh && hack/update-codegen.sh && hack/update-generated-protobuf.sh && hack/update-bazel.sh`
2017-01-11 09:14:49 -08:00
Paulo Pires f4edaf2b8c
dockertools: disable swap on Linux since it's unsupported.
Refs #39005
2017-01-11 17:07:53 +00:00
Paulo Pires dacc363605
dockertools: fix Windows implementation.
Fixes #39005
Fixes #39714
2017-01-11 17:07:52 +00:00
Kubernetes Submit Queue cd55e1b259 Merge pull request #39714 from feiskyer/fix
Automatic merge from submit-queue (batch tested with PRs 39714, 39646)

dockertools: fix build on OSX

#39005 introduces a build problem on OSX. This PR fixes it.

Refer [here](https://github.com/kubernetes/kubernetes/pull/39005#issuecomment-271781026).
2017-01-11 08:00:47 -08:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Kubernetes Submit Queue 1fbb22e115 Merge pull request #39702 from mikedanese/kubelet-csr
Automatic merge from submit-queue (batch tested with PRs 39684, 39577, 38989, 39534, 39702)

kubelet: request client auth certificates from certificate API.

This fixes kubeadm and --experiment-kubelet-bootstrap.

cc @liggitt
2017-01-10 22:24:17 -08:00
Kubernetes Submit Queue 3f9f7471af Merge pull request #38989 from sjenning/set-qos-field
Automatic merge from submit-queue (batch tested with PRs 39684, 39577, 38989, 39534, 39702)

Set PodStatus QOSClass field

This PR continues the work for https://github.com/kubernetes/kubernetes/pull/37968

It converts all local usage of the `qos` package class types to the new API level types (first commit) and sets the pod status QOSClass field in the at pod creation time on the API server in `PrepareForCreate` and in the kubelet in the pod status update path (second commit).  This way the pod QOS class is set even if the pod isn't scheduled yet.

Fixes #33255

@ConnorDoyle @derekwaynecarr @vishh
2017-01-10 22:24:13 -08:00
Pengfei Ni 1f17a47f4e dockertools: fix build on OSX 2017-01-11 14:08:30 +08:00
Kubernetes Submit Queue d3c0914a14 Merge pull request #39005 from brendandburns/windows
Automatic merge from submit-queue (batch tested with PRs 38212, 38792, 39641, 36390, 39005)

Set MemorySwap to zero on Windows

Fixes https://github.com/kubernetes/kubernetes/issues/39003

@dchen1107 @michmike @kubernetes/sig-node-misc
2017-01-10 19:48:16 -08:00
Kubernetes Submit Queue addc6cae4a Merge pull request #38212 from mikedanese/kubeletauth
Automatic merge from submit-queue (batch tested with PRs 38212, 38792, 39641, 36390, 39005)

Generate a kubelet CA and kube-apiserver cert-pair for kubelet auth.

cc @cjcullen
2017-01-10 19:48:09 -08:00
Mike Danese d2032fd83c kubelet: request client auth certificates from certificate API. 2017-01-10 17:57:39 -08:00
Yu-Ju Hong ec0e99c2ed Check the health of PLEG when updating the node status 2017-01-10 16:34:00 -08:00
Yu-Ju Hong 03106dd1cb kubelet: remove the pleg health check from healthz/
If docker hangs, we don't want kubelet to get killed as well.
2017-01-10 16:32:46 -08:00
Kubernetes Submit Queue 65d6a5c6a8 Merge pull request #39455 from kubernetes/revert-39306-oom_score_adj
Automatic merge from submit-queue (batch tested with PRs 39486, 37288, 39477, 39455, 39542)

Revert "Small improve for GetContainerOOMScoreAdjust"

Reverts kubernetes/kubernetes#39306

This does not help current code healthy, let's revert it to avoid further confusing.
2017-01-10 14:33:17 -08:00
Seth Jennings e2402b781b set qos class field in pod status 2017-01-10 16:31:52 -06:00
Seth Jennings 4c30459e49 switch from local qos types to api types 2017-01-10 10:54:30 -06:00
Marc-Antoine Ross c01c7023a0 Fix 2 `sucessfully` typos 2017-01-10 10:37:45 -05:00
Brendan Burns c050826fea Set MemorySwap to zero on Windows 2017-01-09 23:08:48 -08:00
deads2k 1df5b658f2 switch webhook to clientgo 2017-01-09 16:53:24 -05:00
Kubernetes Submit Queue 0bbb49d2d5 Merge pull request #39479 from fraenkel/podkiller
Automatic merge from submit-queue

Avoid panic when stopping the podKiller

use a mutex instead of a channel

fixes #38857
2017-01-06 16:02:16 -08:00
Kubernetes Submit Queue aa7509989b Merge pull request #39318 from NickrenREN/eviction-manager-start
Automatic merge from submit-queue

remove eviction-manager start return err
2017-01-06 11:55:41 -08:00
Kubernetes Submit Queue 402abd23ef Merge pull request #39493 from sjenning/fix-null-deref
Automatic merge from submit-queue (batch tested with PRs 39493, 39496)

kubelet: fix nil deref in volume type check

An attempt to address memory exhaustion through a build up of terminated pods with memory backed volumes on the node in PR https://github.com/kubernetes/kubernetes/pull/36779 introduced this.

For the `VolumeSpec`, either the `Volume` or `PersistentVolume` field is set, not both.  This results in a situation where there is a nil deref on PVs.  Since PVs are inherently not memory-backend, only local/temporal volumes should be considered.

This needs to go into 1.5 as well.

Fixes #39480

@saad-ali @derekwaynecarr @grosskur @gnufied

```release-note
fixes nil dereference when doing a volume type check on persistent volumes
```
2017-01-06 08:44:18 -08:00
NickrenREN 85e6076fab remove eviction-manager start return err
Start() function will never return err,we do not need the return value
2017-01-06 09:32:16 +08:00
Jeff Grafton 20d221f75c Enable auto-generating sources rules 2017-01-05 14:14:13 -08:00
Seth Jennings c4e6725236 fix nil deref 2017-01-05 15:36:42 -06:00
Michael Fraenkel fb3a1d6851 Avoid panic when stopping the podKiller
use a mutex instead of a channel
2017-01-05 14:52:24 -05:00
deads2k 4d7fcae85a mechanicals 2017-01-05 11:14:27 -05:00
Harry Zhang 9712fe8455 Revert "Small improve for GetContainerOOMScoreAdjust" 2017-01-05 09:54:11 +08:00
Michael Fraenkel f6c9ab4312 Check if key is a valid after prefix is prepended
- Allow invalid keys to become valid by requiring a prefix
2017-01-04 17:26:44 -05:00
Kubernetes Submit Queue 5ee52e8bce Merge pull request #39384 from deads2k/generic-01-start-staging
Automatic merge from submit-queue

Start moving genericapiserver to staging

This moves `pkg/auth/user` to `staging/k8s.io/genericapiserver/pkg/authentication/user`.  I'll open a separate pull into the upstream gengo to support using `import-boss` on vendored folders to support staging.

After we agree this is the correct approach and see everything build, I'll start moving other packages over which don't have k8s.io/kubernetes deps.

@kubernetes/sig-api-machinery-misc @lavalamp 
@sttts @caesarxuchao ptal
2017-01-04 12:06:34 -08:00
Jess Frazelle db75904b42
fix when os.Remove should be os.RemoveAll
Signed-off-by: Jess Frazelle <acidburn@google.com>
2017-01-04 10:34:06 -08:00
Jess Frazelle 7db9c8b454
cleanup fooPodContainerDir in /tmp
Signed-off-by: Jess Frazelle <acidburn@google.com>
2017-01-04 10:27:08 -08:00
Jess Frazelle a2dbd456a7
cleanup all /tmp/kubelet_test files
Signed-off-by: Jess Frazelle <acidburn@google.com>
2017-01-04 10:26:24 -08:00
deads2k ca58ec0237 mechanical changes for move 2017-01-04 10:27:05 -05:00
Kubernetes Submit Queue 2cc9650e7e Merge pull request #39306 from hex108/oom_score_adj
Automatic merge from submit-queue (batch tested with PRs 38084, 39306)

Small improve for GetContainerOOMScoreAdjust

In `GetContainerOOMScoreAdjust`, make logic more clear for the case `oomScoreAdjust >= besteffortOOMScoreAdj`. If `besteffortOOMScoreAdj`  is defined to another value(e.g. 996), suppose `oomScoreAdjust` is 999, the function will return 998(which equals 999 - 1) instead of 995(996 -1).
2017-01-04 07:18:07 -08:00
Kubernetes Submit Queue 9b726d6b8f Merge pull request #38687 from ivan4th/remove-dockerlegacyservice-comment-from-kubelet
Automatic merge from submit-queue

Remove DockerLegacyService comment from kubelet
2017-01-03 23:28:22 -08:00
Kubernetes Submit Queue 819535b96a Merge pull request #36245 from fraenkel/env_configmap
Automatic merge from submit-queue (batch tested with PRs 38433, 36245)

Allow pods to define multiple environment variables from a whole ConfigMap

Allow environment variables to be populated from ConfigMaps

- ConfigMaps represent an entire set of EnvVars
- EnvVars can override ConfigMaps


fixes #26299
2017-01-03 23:28:09 -08:00
Kubernetes Submit Queue fe391d7bb0 Merge pull request #37350 from chentao1596/delete-meaningless-judgments
Automatic merge from submit-queue (batch tested with PRs 39280, 37350, 39389, 39390, 39313)

delete meaningless judgments

What this PR does / why we need it:
      Whether "err" is nil or not, "err" can be return, so the judgment "err !=nil " is unnecessary
2017-01-03 18:25:10 -08:00
Kubernetes Submit Queue 9eaf1aa38f Merge pull request #39273 from NickrenREN/kubelet-node-status
Automatic merge from submit-queue (batch tested with PRs 39001, 39104, 35978, 39361, 39273)

delete SetNodeStatus() function and fix some function notes words
2017-01-03 17:18:12 -08:00
CJ Cullen d0997a3d1f Generate a kubelet CA and kube-apiserver cert-pair for kubelet auth.
Plumb through to kubelet/kube-apiserver on gci & cvm.
2017-01-03 14:30:45 -08:00
Andy Goldstein 92a429887a Fix cadvisor_unsupported.go build tags
Make it so cadvisor_unsupported.go is used for linux without cgo or
non-linux/windows OSes.
2017-01-03 13:06:10 -05:00
Kubernetes Submit Queue 1cee8c45d6 Merge pull request #39237 from NickrenREN/pod-manager
Automatic merge from submit-queue (batch tested with PRs 39092, 39126, 37380, 37093, 39237)

Add unit test function to test DeletePod
2017-01-03 09:45:26 -08:00
Michael Fraenkel 2d803afc98 ConfigMaps populate environment variables 2017-01-03 11:02:15 -05:00
Dr. Stefan Schimanski 87dd990bb7 Move pkg/api.{Context,RequestContextMapper} into pkg/genericapiserver/api/request 2017-01-03 14:57:33 +01:00
NickrenREN 3bb75064fb fix GetVolumeInUse() function
Since we just want to get volume name info, each volume name just need to added once. desiredStateOfWorld.GetVolumesToMount() will return volume and pod binding info,
if one volume is mounted to several pods, the volume name will be return several times. That is not what we want in this function.
We can add a new function to only get the volume name info or judge whether the volume name is added to the desiredVolumesMap array.
2017-01-03 14:04:15 +08:00
NickrenREN 350c8dbbba remove duplicate function notes 2017-01-03 14:00:01 +08:00
NickrenREN cda80d684c optimize podSandboxChanged and fix function notes 2017-01-03 13:54:32 +08:00
NickrenREN fd336cde07 drop SetNodeStatus() function and fix some function notes words
drop SetNodeStatus() Since it is never called now. klet.defaultNodeStatusFuncs() is set to klet.setNodeStatusFuncs now and setNodeStatus() function is called by other functions.
2017-01-03 11:26:50 +08:00
NickrenREN 0f35ce1af3 drop NewManager() return err
NewManager will never return err,drop it
2017-01-03 11:24:12 +08:00
NickrenREN 2fa0935c19 Add unit test function to test DeletePod
Add unit test function to test DeletePod() of podManager
2017-01-03 11:08:39 +08:00
Jeff Grafton fae627dd65 Update generated for 2017 2017-01-01 23:11:09 -08:00
Kubernetes Submit Queue f5d9c430e9 Merge pull request #39298 from feiskyer/images
Automatic merge from submit-queue

Kubelet: add image ref to ImageService interfaces

This PR adds image ref (digest or ID, depending on runtime) to PullImage result, and pass image ref in CreateContainer instead of image name. It also

* Adds image ref to CRI's PullImageResponse
* Updates related image puller
* Updates related testing utilities

~~One remaining issue is: it breaks some e2e tests because they [checks image repoTags](https://github.com/kubernetes/kubernetes/blob/master/test/e2e/framework/util.go#L1941) while docker always returns digest in this PR. Should we update e2e test or continue to return repoTags in `containerStatuses.image`?~~

Fixes #38833.
2016-12-30 22:51:18 -08:00
Pengfei Ni 67a5bf8454 Rename imageservice.IsImagePresent to GetImageRef 2016-12-31 08:36:55 +08:00
Pengfei Ni 1de92a91e9 Return repoTags instead of digest in containerStatuses.image 2016-12-30 10:48:49 +08:00
Kubernetes Submit Queue d97f125ddf Merge pull request #39050 from mikedanese/gazel-bump
Automatic merge from submit-queue

bump gazel: pick up some new unit tests
2016-12-29 15:19:18 -08:00
Kubernetes Submit Queue c7063fd6c0 Merge pull request #39300 from feiskyer/kubenet
Automatic merge from submit-queue (batch tested with PRs 39307, 39300)

kubenet: define KubenetPluginName for all platforms

This PR moved KubenetPluginName to a general file for all platforms.

Fixes #39299.

cc/ @yifan-gu @freehan
2016-12-29 13:35:03 -08:00
Mike Danese 161c391f44 autogenerated 2016-12-29 13:04:10 -08:00
Jun Gong e417fd2faa Small improve for GetContainerOOMScoreAdjust 2016-12-29 21:25:43 +08:00
Pengfei Ni 394aad9d6b rkt: add image ref to ImageService interfaces 2016-12-29 16:53:09 +08:00
Pengfei Ni 9d52b761cc kuberuntime/dockershim: add image ref to ImageService interfaces 2016-12-29 16:53:01 +08:00
Pengfei Ni fafccad384 dockertools: add image ref to ImageService interfaces 2016-12-29 16:52:43 +08:00
Pengfei Ni fcbf39ea54 dockertools: add image ref to ImageService interfaces 2016-12-29 16:31:14 +08:00
Pengfei Ni 37fc81be0e kubelet/images: return image ref in EnsureImageExists 2016-12-29 16:31:14 +08:00
Pengfei Ni ba5a684c4c CRI: add image ref to PullImageResponse 2016-12-29 16:31:14 +08:00
Pengfei Ni cac38615ac kubecontainer: add image ref to ImageService interfaces 2016-12-29 16:31:14 +08:00
Kubernetes Submit Queue 9a428cc5e0 Merge pull request #39184 from feiskyer/dockertools
Automatic merge from submit-queue

dockertools: don't test linux-specific cases on OSX

There are a few test cases in dockertools are linux-specific. This PR moves them to docker_manager_linux_test.go

Fixes #39183.
2016-12-29 00:14:22 -08:00
Pengfei Ni 25dee7dd83 kubenet: define KubenetPluginName for all platforms 2016-12-29 15:39:16 +08:00
Kubernetes Submit Queue f1c8b7581d Merge pull request #36446 from jonboulle/master
Automatic merge from submit-queue (batch tested with PRs 39053, 36446)

CRI: clarify purpose of annotations

Add language to make it explicit that annotations are not to be altered
by runtimes, and should only be used for features that are opaque to the
Kubernetes APIs. Unfortunately there are currently exceptions
introduced in [1][1], but this change makes it clear that they are to be
changed and that no more such semantic-affecting annotations should be
introduced.

In the spirit of the discussion and conclusion in [2][2].

Also captures the link between the annotations returned by various
status queries and those supplied in associated configs.

[1]: https://github.com/kubernetes/kubernetes/pull/34819
[2]: https://github.com/kubernetes/kubernetes/issues/30819#issuecomment-253369441
2016-12-28 19:07:06 -08:00
Kubernetes Submit Queue 281053d666 Merge pull request #38155 from freehan/cleanup-txqueue
Automatic merge from submit-queue (batch tested with PRs 39218, 38155)

clean up logic that configs TX queue length

fix: #25143
2016-12-28 16:10:03 -08:00
Kubernetes Submit Queue 41956a682d Merge pull request #39254 from freehan/cleanup-exec-networkplugin
Automatic merge from submit-queue

Remove 'exec' network plugin - use CNI instead

fixes: #38639
2016-12-28 14:00:48 -08:00
Kubernetes Submit Queue c3771cbaf9 Merge pull request #36922 from rkouj/refactor-operation-executor
Automatic merge from submit-queue

Refactor operation_executor to make it testable

**What this PR does / why we need it**:
To refactor operation_executor to make it unit testable

**Release note**:
`NONE`
2016-12-27 19:01:56 -08:00
rkouj e7e3c55ad7 Add unit tests for MountVolume() of operation executor 2016-12-27 16:07:06 -08:00
rkouj d5f7610b82 Refactor operation_executor to make it unit testable 2016-12-27 15:12:16 -08:00
Minhan Xia ff6cdeb9b8 clean up logic that configs TX queue length 2016-12-27 14:43:47 -08:00
Minhan Xia 5e39b3d9c3 clean up exec network plugin 2016-12-27 14:04:57 -08:00
Jing Xu 3fbf68ef68 Add path exist check in getPodVolumePathListFromDisk
Add the path exist check in the function. If the path does not exist,
return empty list and nil error.
2016-12-27 13:32:13 -08:00
Pengfei Ni 16bcafb775 Update bazel 2016-12-23 11:54:16 +08:00
Pengfei Ni 1a67e0ee7a Do not test linux-specific cases on OSX in dockertools 2016-12-23 10:37:10 +08:00
bprashanth 1743c6b6ab Don't evict static pods 2016-12-22 16:22:14 -08:00
Jonathan Boulle 5d982b4a02 CRI: clarify purpose of annotations
Add language to make it explicit that annotations are not to be altered
by runtimes, and should only be used for features that are opaque to the
Kubernetes APIs. Unfortunately there are currently exceptions
introduced in [1][1], but this change makes it clear that they are to be
changed and that no more such semantic-affecting annotations should be
introduced.

In the spirit of the discussion and conclusion in [2][2].

Also captures the link between the annotations returned by various
status queries and those supplied in associated configs.

[1]: https://github.com/kubernetes/kubernetes/pull/34819
[2]: https://github.com/kubernetes/kubernetes/issues/30819#issuecomment-253369441
2016-12-22 11:40:12 +01:00
Kubernetes Submit Queue ab91500f15 Merge pull request #39068 from NickrenREN/imageManager-start
Automatic merge from submit-queue (batch tested with PRs 39076, 39068)

fix image manager Start() function return
2016-12-22 00:27:30 -08:00
Kubernetes Submit Queue ec897a16ab Merge pull request #39076 from NickrenREN/kubelet-volume-test
Automatic merge from submit-queue

add unit test for ListVolumesForPod

the result  of function ListVolumesForPod() checking
2016-12-22 00:27:18 -08:00
Dawn Chen b03fca9783 Fixed an import cycle issue:
import cycle not allowed in test
package k8s.io/kubernetes/pkg/client/restclient (test)
	imports k8s.io/kubernetes/pkg/api/testapi
	imports k8s.io/kubernetes/pkg/apis/componentconfig/install
	imports k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1
	imports k8s.io/kubernetes/pkg/kubelet/qos
	imports k8s.io/kubernetes/pkg/kubelet/pod
	imports k8s.io/kubernetes/pkg/client/clientset_generated/clientset
	imports k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/apps/v1beta1
	imports k8s.io/kubernetes/pkg/client/restclient
2016-12-21 16:34:24 -08:00
Dawn Chen 53931fbce4 assign -998 as the oom_score_adj for critical pods. 2016-12-21 16:07:49 -08:00
Kubernetes Submit Queue 60a34fda0a Merge pull request #38673 from resouer/pod-qos-shim
Automatic merge from submit-queue (batch tested with PRs 39079, 38991, 38673)

Support systemd based pod qos in CRI dockershim

This PR makes pod level QoS works for CRI dockershim for systemd based cgroups. And will also fix #36807
- [x] Add cgroupDriver to dockerService and use docker info api to set value for it
- [x] Add a NOTE that detection only works for docker 1.11+, see [CHANGE LOG](https://github.com/docker/docker/blob/master/CHANGELOG.md#1110-2016-04-13)
- [x] Generate cgroupParent in syntax expected by cgroupDriver
- [x] Set cgroupParent to hostConfig for both sandbox and user container
- [x] Check if kubelet conflicts with cgroup driver of docker

cc @derekwaynecarr @vishh
2016-12-21 08:01:45 -08:00
NickrenREN d27aa34b37 ListVolumesForPod checking
add a function to test the function of ListVolumesForPod()
2016-12-21 19:14:22 +08:00
NickrenREN bb5ccb978e fix image manager Start() function return
realImageGCManager's Start()  function will always return nil,we do not need the err return value,drop it.
2016-12-21 14:58:00 +08:00
Kubernetes Submit Queue f1a763e7d7 Merge pull request #38180 from NickrenREN/vmgr-actual-state
Automatic merge from submit-queue (batch tested with PRs 36888, 38180, 38855, 38590)

fix function notes
2016-12-20 20:33:54 -08:00
Kubernetes Submit Queue 1abb8498aa Merge pull request #36888 from linki/patch-1
Automatic merge from submit-queue (batch tested with PRs 36888, 38180, 38855, 38590)

wrong pod reference in error message for volume attach timeout

**What this PR does / why we need it**:
when a disk mount times out you get the following error:

```
Warning		FailedSync	Error syncing pod, skipping: timeout expired waiting for volumes to attach/mount for pod "nginx"/"default". list of unattached/unmounted volumes=[data]
```

where the pod is referenced by "podname"/"namespace", but should be "namespace"/"podname".

**Which issue this PR fixes**
no issue number

**Special notes for your reviewer**:
untested :(
2016-12-20 20:33:52 -08:00
NickrenREN dc7a0bf65e fix function notes
change the function notes according to the implementations of the function AddPodToVolume()
2016-12-21 10:02:20 +08:00
Kubernetes Submit Queue 5b2823adb9 Merge pull request #38191 from sttts/sttts-move-master-options
Automatic merge from submit-queue

Move non-generic apiserver code out of the generic packages
2016-12-17 01:25:45 -08:00
Kubernetes Submit Queue 699964c972 Merge pull request #38836 from bprashanth/kubelet_critical
Automatic merge from submit-queue

Admit critical pods in the kubelet

Haven't verified in a live cluster yet, just unittested, so applying do-not-merge label.
2016-12-16 17:21:46 -08:00
Dr. Stefan Schimanski 3be6b3c045 pkg/apiserver: remove unused code 2016-12-16 17:47:47 +01:00
Robert Rati 91931c138e [scheduling] Moved node affinity from annotations to api fields. #35518 2016-12-16 11:42:43 -05:00
Kubernetes Submit Queue 87444522d0 Merge pull request #32088 from piosz/fluentd-daemon-set
Automatic merge from submit-queue

Migrated fluentd addon to daemon set

fix #23224
supersedes #23306 

``` release-note
Migrated fluentd addon to daemon set
```
2016-12-15 23:04:40 -08:00
chentao1596 a359287a1b change log to warn 2016-12-16 15:02:30 +08:00
bprashanth b7409e0038 Sort critical pods before admission 2016-12-15 18:58:13 -08:00
bprashanth afd676d94c Kubelet admits critical pods even under memory pressure 2016-12-15 18:58:09 -08:00
Harry Zhang b36c5cbbec Enable pod qos for systemd in cri
Check kubelet config with docker config
2016-12-16 10:48:36 +08:00
Mike Danese 8fdec87d19 bazel: fix some unit tests 2016-12-15 18:36:22 -08:00
Kubernetes Submit Queue 1981a654a4 Merge pull request #38711 from wojtek-t/get_with_options_in_kubelet
Automatic merge from submit-queue (batch tested with PRs 38803, 38711)

Use Get from cache in apiserver in kubelet

Ref #37473
2016-12-15 05:56:17 -08:00
Piotr Szczesniak c00e57789d Added upgrade story from manifest pod to ds 2016-12-15 13:48:32 +01:00
Kubernetes Submit Queue f49442d433 Merge pull request #38502 from resouer/fix-wrong-comment
Automatic merge from submit-queue (batch tested with PRs 38154, 38502)

Wrong comment to describe docker version

The original comment about minimal docker version fo `room_score_adj` is wrong (though the code is right).

Really sorry for misleading :/
2016-12-14 14:21:53 -08:00
Kubernetes Submit Queue d8efc779ed Merge pull request #38154 from caesarxuchao/rename-release_1_5
Automatic merge from submit-queue (batch tested with PRs 38154, 38502)

Rename "release_1_5" clientset to just "clientset"

We used to keep multiple releases in the main repo. Now that [client-go](https://github.com/kubernetes/client-go) does the versioning, there is no need to keep releases in the main repo. This PR renames the "release_1_5" clientset to just "clientset", clientset development will be done in this directory.

@kubernetes/sig-api-machinery @deads2k 

```release-note
The main repository does not keep multiple releases of clientsets anymore. Please find previous releases at https://github.com/kubernetes/client-go
```
2016-12-14 14:21:51 -08:00
Chao Xu 03d8820edc rename /release_1_5 to /clientset 2016-12-14 12:39:48 -08:00
Harry Zhang 07d1736077 Wrong comment to describe docker version 2016-12-14 08:52:51 +00:00
Kubernetes Submit Queue 6893017b39 Merge pull request #38430 from freehan/cri-docker-network
Automatic merge from submit-queue (batch tested with PRs 38689, 38743, 38734, 38430)

apply sandbox network mode based on network plugin

This allows CRI to use docker's network bridge. Can be combined with noop network plugin. This allows to use docker0 with no further configuration. Good for tools like minikube/hyperkube.
2016-12-13 21:25:36 -08:00
Kubernetes Submit Queue c40404ae9a Merge pull request #38435 from timstclair/remotecmd-refactor
Automatic merge from submit-queue

Refactor remotecommand options parsing

Prerequisite to https://github.com/kubernetes/kubernetes/issues/36187 - This separates the options from the request, so they can be pulled from elsewhere.

/cc @liggitt
2016-12-13 18:12:15 -08:00
Kubernetes Submit Queue 1d3c7ca758 Merge pull request #38348 from euank/doc-our-privilege
Automatic merge from submit-queue (batch tested with PRs 38727, 38726, 38347, 38348)

Add 'privileged' to sandbox to indicate if any container might be privileged in it, document privileged

Right now, the privileged flag is this magic thing which does "whatever Docker does". This documents it to make it a little less magic.

In addition, due to how rkt uses `systemd-nspawn` as an outer layer of isolation in creating the sandbox, it's helpful to know beforehand whether the pod will be privileged so additional security options can be applied earlier / applied at all.

I suspect the same indication will be useful for userns since userns should also occur at the pod layer, but it's possible that will be a separate/additional field.


cc @lucab @jonboulle @yujuhong @feiskyer @kubernetes/sig-node 


```release-note
NONE
```
2016-12-13 17:31:53 -08:00
Kubernetes Submit Queue 63cf217b92 Merge pull request #38347 from euank/remove-extra-hn-check
Automatic merge from submit-queue (batch tested with PRs 38727, 38726, 38347, 38348)

kubelet: remove redundant hostNetwork helper

Trivial cleanup.
2016-12-13 17:31:51 -08:00
Tim St. Clair bc3ade7454
Refactor remotecommand options parsing 2016-12-13 16:09:23 -08:00
Minhan Xia 04c3757a06 apply sandbox network mode based on network plugin 2016-12-13 16:00:23 -08:00
Wojciech Tyczynski 6e336bfab6 Use Get from cache in apiserver in kubelet 2016-12-13 17:14:56 +01:00
Dan Winship c788793868 Port remaining code to pkg/util/version 2016-12-13 08:53:24 -05:00
Ivan Shvedunov b45a8f30c5 Remove DockerLegacyService comment from kubelet
The comment is obsolete as there's no more DockerLegacyService.
2016-12-13 13:46:09 +03:00
Kubernetes Submit Queue 8abbedae54 Merge pull request #38315 from mikedanese/pin-gazel
Automatic merge from submit-queue

Pin gazel to a version and support cgo

This fixes the bazel build.

@krousey who is buildcop
2016-12-12 19:32:29 -08:00
Kubernetes Submit Queue 22db6c99a7 Merge pull request #38589 from runcom/fix-ImageStatus-comment
Automatic merge from submit-queue

CRI: fix ImageStatus comment

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

GRPC cannot encode `nil` (CRI-O itself panic while trying to encode `nil` for `ImageStatus`). This PR fixes `ImageStatus` comment to say that when the image does not exist the call returns a response having `Image` set to `nil` (instead of saying implementors should return `nil` directly).

/cc @mrunalp @vishh @feiskyer 

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-12-12 17:30:11 -08:00
Mike Danese c87de85347 autoupdate BUILD files 2016-12-12 13:30:07 -08:00
Kubernetes Submit Queue f12eda8777 Merge pull request #38457 from resouer/fix-cgroup-cri
Automatic merge from submit-queue (batch tested with PRs 38419, 38457, 38607)

Fix pod level QoS does not works on CRI dockershim

Fixes: https://github.com/kubernetes/kubernetes/issues/38458

We did set `CgroupParent ` in `CreateContainer`, but the `HostConfig.Resources` which `CgroupParent` belongs to is override by the following code:

```
hc.CgroupParent = lc.GetCgroupParent()

...

hc.Resources = dockercontainer.Resources{
	Memory:     rOpts.GetMemoryLimitInBytes(),
...
}
```

That's why `HostConfig.CgroupParent` is always empty and pod level QoS does not work.
2016-12-12 12:48:07 -08:00
Kubernetes Submit Queue 12147a3cd6 Merge pull request #38630 from ncdc/fix-threshold-notifier-build-tags
Automatic merge from submit-queue (batch tested with PRs 38453, 36672, 38629, 34966, 38630)

Fix threshold notifier build tags

Fix threshold notifier build tags so the linux version is only built if cgo is
enabled, and the unsupported version is built if it's either not linux or not
cgo.
2016-12-12 11:41:12 -08:00
Andy Goldstein 89ea5ac9c1 Fix threshold notifier build tags
Fix threshold notifier build tags so the linux version is only built if cgo is
enabled, and the unsupported version is built if it's either not linux or not
cgo.
2016-12-12 11:56:07 -05:00
Seth Jennings a40b15d8bd error in setNodeStatus func should not abort node status update 2016-12-12 09:29:24 -06:00
Kubernetes Submit Queue 07312ee4b5 Merge pull request #38527 from derekwaynecarr/reduce-max-wait-time
Automatic merge from submit-queue

Fail kubelet is runtime is unresponsive for 30 seconds

Fixes https://github.com/kubernetes/kubernetes/issues/30534
2016-12-11 20:29:19 -08:00
Antonio Murdaca fba6e0a625
CRI: fix ImageStatus comment
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-12-11 18:43:41 +01:00
Kubernetes Submit Queue b72c006eb3 Merge pull request #34554 from derekwaynecarr/quota-storage-class
Automatic merge from submit-queue (batch tested with PRs 37270, 38309, 37568, 34554)

Ability to quota storage by storage class

Adds the ability to quota storage by storage class.
1. `<storage-class>.storageclass.storage.k8s.io/persistentvolumeclaims` - quota the number of claims with a specific storage class
2. `<storage-class>.storageclass.storage.k8s.io/requests.storage` - quota the cumulative request for storage in a particular storage class.

For example:

```
$ cat quota.yaml
apiVersion: v1
kind: ResourceQuota
metadata:
  name: storage-quota
spec:
  hard:
    requests.storage: 100Gi
    persistentvolumeclaims: 100
    gold.storageclass.storage.k8s.io/requests.storage: 50Gi
    gold.storageclass.storage.k8s.io/persistentvolumeclaims: 5
    silver.storageclass.storage.k8s.io/requests.storage: 75Gi
    silver.storageclass.storage.k8s.io/persistentvolumeclaims: 10
    bronze.storageclass.storage.k8s.io.kubernetes.io/requests.storage: 100Gi
    bronze.storageclass.storage.k8s.io/persistentvolumeclaims: 15
$ kubectl create -f quota.yaml
$ cat pvc-bronze.yaml
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  generateName: pvc-bronze-
  annotations:
    volume.beta.kubernetes.io/storage-class: "bronze"
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 8Gi
$ kubectl create -f pvc-bronze.yaml
$ kubectl get quota storage-quota -o yaml
apiVersion: v1
kind: ResourceQuota
...
status:
  hard:
    bronze.storageclass.storage.k8s.io/persistentvolumeclaims: "15"
    bronze.storageclass.storage.k8s.io/requests.storage: 100Gi
    gold.storageclass.storage.k8s.io/persistentvolumeclaims: "5"
    gold.storageclass.storage.k8s.io/requests.storage: 50Gi
    persistentvolumeclaims: "100"
    requests.storage: 100Gi
    silver.storageclass.storage.k8s.io/persistentvolumeclaims: "10"
    silver.storageclass.storage.k8s.io/requests.storage: 75Gi
  used:
    bronze.storageclass.storage.k8s.io/persistentvolumeclaims: "1"
    bronze.storageclass.storage.k8s.io/requests.storage: 8Gi
    gold.storageclass.storage.k8s.io/persistentvolumeclaims: "0"
    gold.storageclass.storage.k8s.io/requests.storage: "0"
    persistentvolumeclaims: "1"
    requests.storage: 8Gi
    silver.storageclass.storage.k8s.io/persistentvolumeclaims: "0"
    silver.storageclass.storage.k8s.io/requests.storage: "0"
```
2016-12-09 14:11:21 -08:00
Derek Carr af6c8a2479 Reduce max container runtime wait time 2016-12-09 16:40:13 -05:00
Kubernetes Submit Queue 43233caaf0 Merge pull request #37871 from Random-Liu/use-patch-in-kubelet
Automatic merge from submit-queue (batch tested with PRs 36692, 37871)

Use PatchStatus to update node status in kubelet.

Fixes https://github.com/kubernetes/kubernetes/issues/37771.

This PR changes kubelet to update node status with `PatchStatus`.

@caesarxuchao @ymqytw told me that there is a limitation of current `CreateTwoWayMergePatch`, it doesn't support primitive type slice which uses strategic merge.
* I checked the node status, the only primitive type slices in NodeStatus are as follows, they are not using strategic merge:
  * [`ContainerImage.Names`](https://github.com/kubernetes/kubernetes/blob/master/pkg/api/v1/types.go#L2963)
  * [`VolumesInUse`](https://github.com/kubernetes/kubernetes/blob/master/pkg/api/v1/types.go#L2909)
* Volume package is already [using `CreateStrategicMergePath` to generate node status update patch](https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/volume/attachdetach/statusupdater/node_status_updater.go#L111), and till now everything is fine. 

@yujuhong @dchen1107 
/cc @kubernetes/sig-node
2016-12-09 11:29:11 -08:00
Derek Carr 459a7a05f1 Ability to quota storage by storage class 2016-12-09 13:26:59 -05:00
Harry Zhang 9170e94e2d Fix cgroupParent is wrongly set in dockershim 2016-12-09 09:22:05 +00:00
Wojciech Tyczynski aa7da5231f Update bazel files 2016-12-09 09:42:02 +01:00
Wojciech Tyczynski e8d1cba875 GetOptions in client calls 2016-12-09 09:42:01 +01:00
Kubernetes Submit Queue e0c6b99e25 Merge pull request #36887 from hex108/pullImage
Automatic merge from submit-queue (batch tested with PRs 38432, 36887, 38415)

Add --image-pull-stuck-timeout option  to kubelet

In this PR, add --image-pull-stuck-time option to specify the stuck timeout for pulling image.

When docker extracts image layer, there is no progress. The progress will exceed 1m if the layer is big or system is busy. It happend in our cluster, so I add above option to specify the timeout. 

Related error log:
<pre>
[... kube_docker_client.go:29] Cancel pulling image "our_registry/demo/test" because of no progress for 1m0s, latest progress "c914ad57d670": Extracting [==================>] 513.5 MB/513.5MB"
[... docker_manager.go:2254] container start failed: ErrImagePull: net/http: request canceled
</pre>
2016-12-08 20:37:55 -08:00
Kubernetes Submit Queue 362dc81d8e Merge pull request #37713 from yujuhong/log_notready_message
Automatic merge from submit-queue (batch tested with PRs 36736, 35956, 35655, 37713, 38316)

Log the condition when node becomes not ready
2016-12-08 19:51:58 -08:00
Jun Gong 036899ec98 Add --image-pull-progress-deadline option to kubelet 2016-12-09 09:28:57 +08:00
Kubernetes Submit Queue bf1afd97fb Merge pull request #38375 from Random-Liu/add-image-cache
Automatic merge from submit-queue (batch tested with PRs 36419, 38330, 37718, 38244, 38375)

Kubelet: Add image cache.

Fixes #38373.

This should be patched into 1.5.1 to solve the customer issue.

@yujuhong 
/cc @kubernetes/sig-node
2016-12-08 17:14:00 -08:00
Random-Liu beba1ebbf8 Use PatchStatus to update node status in kubelet. 2016-12-08 17:13:59 -08:00
Random-Liu 816f867c62 Add image cache. 2016-12-08 14:04:01 -08:00
Euan Kemp bcd939cb08 kuberuntime: set privileged for sandboxes 2016-12-08 13:11:16 -08:00
Euan Kemp 62148a768b CRI: add privileged to sandbox, document better
Adding the `privileged` bool to the sandbox allows runtimes, like rkt,
to make better security choices in some cases.

This also enumerates what "privileged" actually means and how it
interacts with other options (or more accurately, does not).

The documentation closely matches docker's current behavior because, so
far, that's what privileged has meant.
2016-12-08 13:11:16 -08:00
Jordan Liggitt 6819706adf
Pass addressable values to DeepCopy 2016-12-08 14:16:01 -05:00
Kubernetes Submit Queue 61242f7408 Merge pull request #35939 from xiangpengzhao/minor-cleanup
Automatic merge from submit-queue

Minor cleanup: fix typos

Fix some typos.
2016-12-08 07:41:08 -08:00
Kubernetes Submit Queue 910912ea3b Merge pull request #37364 from foxyriver/status-code
Automatic merge from submit-queue

use status code const to express http status

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

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

Using status code const to express http status.

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```
2016-12-07 22:47:46 -08:00
Euan Kemp 15fc470343 kubelet: remove redundant hostNetwork helper
It did the same thing as the helper in kubecontainer
2016-12-07 17:24:24 -08:00
Kubernetes Submit Queue ca049360e2 Merge pull request #38258 from derekwaynecarr/kernel-memcg-flag
Automatic merge from submit-queue (batch tested with PRs 38318, 38258)

kernel memcg notification enabled via experimental flag

Kubelet integrates with kernel memcg notification API if and only if enabled via experimental flag.
2016-12-07 15:00:10 -08:00
Derek Carr 5b2d1c2c25 Enable kernel memcg notification via additional flag 2016-12-07 10:09:41 -05:00
Pengfei Ni 1140d31d9b Kubelet: only check podUID when it is actually set 2016-12-07 16:35:25 +08:00