Commit Graph

3935 Commits (27d096d27d60d32c1978e08db82f28da17333405)

Author SHA1 Message Date
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
Dan Winship c788793868 Port remaining code to pkg/util/version 2016-12-13 08:53:24 -05: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
Kubernetes Submit Queue 97ae7ccb56 Merge pull request #31647 from mikedanese/register-tainted
Automatic merge from submit-queue

add a configuration for kubelet to register as a node with taints

and deprecate --register-schedulable

ref #28687 #29178

cc @dchen1107 @davidopp @roberthbailey
2016-12-06 19:07:54 -08:00
Mike Danese e225625a80 add a configuration for kubelet to register as a node with taints
and deprecate register-schedulable
2016-12-06 10:32:54 -08:00
Bryan Boreham 0cfd09e161 Abandon setting hairpin mode if finding the peer interface fails
Instead of setting it on every bridge-connected interface which may
have unwanted effects on unrelated things installed on the machine.
2016-12-06 14:33:43 +00:00
Kubernetes Submit Queue be5d1724f5 Merge pull request #37420 from zdj6373/kubelet-log
Automatic merge from submit-queue (batch tested with PRs 37208, 37446, 37420)

Kubelet log modification

Keep in line with the other error logs in the function.
After return, the caller records the error log.Delete redundant logs
2016-12-05 04:47:44 -08:00
Clayton Coleman 3454a8d52c
refactor: update bazel, codec, and gofmt 2016-12-03 19:10:53 -05:00
Clayton Coleman 5df8cc39c9
refactor: generated 2016-12-03 19:10:46 -05:00
Kubernetes Submit Queue 5e44666fc1 Merge pull request #34945 from nebril/image-manager-tests-cleanup
Automatic merge from submit-queue

Clean up redundant tests in image_manager_test

There was a lot of overlap between parallel and serialized puller tests,
extracted most of these tests internals to separate functions.
2016-12-02 11:40:59 -08:00
Kubernetes Submit Queue 5960761b9b Merge pull request #36615 from timstclair/cri-attach-tty
Automatic merge from submit-queue

[CRI] Add TTY flag to AttachRequest

Follow up from https://github.com/kubernetes/kubernetes/pull/35661
For https://github.com/kubernetes/kubernetes/issues/29579

- Add TTY to the CRI AttachRequest
- Moves responsibility from the runtime shim to the Kubelet for populating the TTY bool in the request based on the container spec

/cc @euank @feiskyer @kubernetes/sig-node
2016-12-02 07:28:59 -08:00
Kubernetes Submit Queue 4ebc43c25d Merge pull request #37541 from zdj6373/note-error
Automatic merge from submit-queue

Function annotation modification

“return kl.pleg.Healthy()”,Based on the return function,"healty" to "healthy" better
2016-12-02 01:01:00 -08:00
Tim St. Clair cc801e97e8
[CRI] Manage attach TTY in Kubelet 2016-12-01 18:27:55 -08:00
Kubernetes Submit Queue 1e8e965620 Merge pull request #37088 from CaoShuFeng/hold_socket_for_kubenet
Automatic merge from submit-queue

Keep host port socket open for kubenet

fixes #37087


**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
NONE
```

When cni is set to kubenet, kubelet should hold the host port socket,
so that other application in this node could not listen/bind this port
any more. However, the sockets are closed accidentally, because
kubelet forget to reconcile the protocol format before comparing.


@kubernetes/sig-network
2016-12-01 15:06:55 -08:00
Kubernetes Submit Queue d3a14c0454 Merge pull request #37788 from wojtek-t/fix_kubelet_node_status
Automatic merge from submit-queue

While updating NodeStatus, only first get served from cache

Fix #37725
2016-12-01 15:06:53 -08:00