Commit Graph

4920 Commits (7ffa2faeacb213d25c86ab91a2ce5b67f30b9c33)

Author SHA1 Message Date
Kubernetes Submit Queue 50c6211850 Merge pull request #48518 from smarterclayton/separate_cert_man
Automatic merge from submit-queue (batch tested with PRs 48518, 48525, 48269)

Move the kubelet certificate management code into a single package

Code is very similar and belongs together. Will allow future cert callers to potentially make this more generic, as well as to make it easier reuse code elsewhere.
2017-07-06 13:34:42 -07:00
Kubernetes Submit Queue 9cfb0ae565 Merge pull request #48508 from mengqiy/fix_term
Automatic merge from submit-queue

fix cross build

Fix the issue introduced in #48299 which breaks cross-build (https://github.com/kubernetes/kubernetes/pull/48299#issuecomment-312846398).
move setsize.go and setsize_unsupported.go back to util/term for kubelet.
move unmark_windows.go as well.

```release-note
NONE
```
2017-07-06 00:08:49 -07:00
Clayton Coleman b8e662fcea
Move the kubelet certificate management code into a single package
Code is very similar and belongs together.
2017-07-05 18:11:49 -04:00
Kubernetes Submit Queue 145976f72a Merge pull request #48194 from k82cn/k8s_48173
Automatic merge from submit-queue (batch tested with PRs 47327, 48194)

Checked container spec when killing container.

**What this PR does / why we need it**:
Checked container spec when getting container, return error if failed.

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

**Release note**:
```release-note-none
```
2017-07-05 14:21:39 -07:00
Kubernetes Submit Queue 67da2da32f Merge pull request #47327 from xingzhou/remove-error
Automatic merge from submit-queue (batch tested with PRs 47327, 48194)

Remove useless error

While doing https://github.com/kubernetes/kubernetes/pull/44898, found an useless return error.

**Release note**:
```
None
```
2017-07-05 14:21:36 -07:00
Kubernetes Submit Queue 154bf490bb Merge pull request #47700 from JulienBalestra/rkt-systemd-unit-limitnofile
Automatic merge from submit-queue (batch tested with PRs 47700, 48464, 48502)

Provide a way to setup the limit NO files for rkt Pods

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

This PR allows to customize the Systemd unit files for rkt pods.
We start with the `systemd-unit-option.rkt.kubernetes.io/LimitNOFILE` to allows to run workloads like etcd, ES in kubernetes with rkt.

**Special notes for your reviewer**:

Once again, I followed @yifan-gu guidelines.
I made a basic check over the values given inside the `systemd-unit-option.rkt.kubernetes.io/LimitNOFILE` (integer and > 0).
If this check fails: I simply ignore the field.
The other implementation would be to fail the whole SetUpPod.

We discussed using a key like `rkt.kubernetes.io/systemd-unit-option/LimitNOFILE` but the validation only allows a single `/` in this field:
```The Deployment "tiller" is invalid: spec.template.annotations: Invalid value: "rkt.kubernetes.io/systemd-unit-option/LimitNOFILE": a qualified name must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName',  or 'my.name',  or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]') with an optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')```

**Release note**:

```release-note 
NONE
```
2017-07-05 13:27:43 -07:00
ymqytw ce561b2044 fix cross build for windows 2017-07-05 12:42:41 -07:00
Kubernetes Submit Queue e14d9a7ffd Merge pull request #48091 from rpothier/kubenet-ipv6
Automatic merge from submit-queue (batch tested with PRs 45467, 48091, 48033, 48498)

Allow Kubenet with ipv6

When running kubenet with IPv6, there is a panic as there
is IPv4 specific code the Event function.
With this change, Event will support IPv4 and IPv6



**What this PR does / why we need it**:
This PR allows kubenet to use IPv6. Currently there is a panic in kubenet_linux.go
as there is IPv4 specific code.

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

**Special notes for your reviewer**:

**Release note**:

```release-note-NONE
```
2017-07-05 12:37:31 -07:00
zhangxiaoyu-zidif e6c95e7a5c fix-review 2017-07-05 15:40:51 +08:00
Xing Zhou 37f9e13025 Remove useless error 2017-07-03 14:59:54 +08:00
Klaus Ma 549360cf91 Checked container spec when killing container. 2017-07-02 11:00:38 +08:00
JulienBalestra 9f37efcf7e Provide a way to setup the limit NO files for rkt Pods 2017-07-01 18:57:52 +02:00
Kubernetes Submit Queue 21038e362c Merge pull request #48313 from timstclair/lint
Automatic merge from submit-queue (batch tested with PRs 48317, 48313, 48351, 48357, 48115)

Cleanup lint errors in the pkg/kubelet/server/... directory

Cleanup some issues that were found while experimenting with https://github.com/alecthomas/gometalinter on the `pkg/kubelet/server/...` directories.
2017-06-30 19:54:26 -07:00
Kubernetes Submit Queue 73a94eac9e Merge pull request #48299 from mengqiy/kubectl_term
Automatic merge from submit-queue (batch tested with PRs 47918, 47964, 48151, 47881, 48299)

move term to kubectl/util

move term from pkg/util/term to pkg/kubectl/util/term

remove dependency of `k8s.io/kubernetes/pkg/util/term` for `pkg/kubelet/dockershim/exec.go` and `pkg/kubelet/dockershim/exec.go`

Ref: https://github.com/kubernetes/kubernetes/issues/48209

```release-note
NONE
```
/assign @apelisse @monopole 

cc: @pwittrock
2017-06-30 18:42:42 -07:00
Kubernetes Submit Queue 57dddce815 Merge pull request #47918 from jiayingz/unit-test
Automatic merge from submit-queue (batch tested with PRs 47918, 47964, 48151, 47881, 48299)

Add unit test coverage for nvidiaGPUManager initialization

Part of #47750 

```release-note
NONE
```
2017-06-30 18:42:35 -07:00
ymqytw f0ce897277 move term to kubectl/util 2017-06-30 15:00:24 -07:00
Dan Williams 36a54bd5a4 kubelet: remove NET_PLUGIN_CAPABILITY_SHAPING
This was effectively unused with v1.5 and later when kubelet stopped
doing internal shaping and delegated all shaping to plugins.
2017-06-30 11:51:22 -05:00
Dan Williams 5b8ad3f7c5 kubelet: remove unused bandwidth shaping teardown code
Since v1.5 and the removal of --configure-cbr0:

0800df74ab "Remove the legacy networking mode --configure-cbr0"

kubelet hasn't done any shaping operations internally.  They
have all been delegated to network plugins like kubenet or
external CNI plugins.  But some shaping code was still left
in kubelet, so remove it now that it's unused.
2017-06-30 11:51:22 -05:00
Kubernetes Submit Queue 956acc2bd8 Merge pull request #47643 from CaoShuFeng/golang.org/x/exp/inotify
Automatic merge from submit-queue (batch tested with PRs 46336, 47643)

Fix invalid filename in kubelet log

Fixes: https://github.com/kubernetes/kubernetes/issues/47641
**Release note**:

```
NONE
```
2017-06-29 16:20:32 -07:00
Tim St. Clair e9795e3742
Cleanup lint errors in the pkg/kubelet/server/... directory 2017-06-29 15:58:07 -07:00
Kubernetes Submit Queue 1cca341b17 Merge pull request #47850 from dcbw/checkpoint-hostnetwork
Automatic merge from submit-queue (batch tested with PRs 47850, 47835, 46197, 47250, 48284)

dockershim: checkpoint HostNetwork property

To ensure kubelet doesn't attempt network teardown on HostNetwork
containers that no longer exist but are still checkpointed, make
sure we preserve the HostNetwork property in checkpoints.  If
the checkpoint indicates the container was a HostNetwork one,
don't tear down the network since that would fail anyway.

Related: https://github.com/kubernetes/kubernetes/issues/44307#issuecomment-299548609

@freehan @kubernetes/sig-network-misc
2017-06-29 15:16:37 -07:00
Jiaying Zhang fee83f65d4 Add unit test coverage for nvidiaGPUManager initialization
Part of #47750

```release-note
NONE
```
2017-06-29 10:17:05 -07:00
Kubernetes Submit Queue c9ad8dcde0 Merge pull request #47900 from yiqinguo/yiqinguo_add_type_judgment
Automatic merge from submit-queue

Add type conversion judgment

If do not type conversion judgment, there may be panic.

**Release note**:
```release-note
NONE
```
2017-06-29 04:00:18 -07:00
xiangpengzhao 53c536b59c
Implement GetCapacity in container_manager_unsupported 2017-06-29 10:22:57 +08:00
Kubernetes Submit Queue b697222103 Merge pull request #47827 from yiqinguo/yiqinguo_repeat_type_coversions
Automatic merge from submit-queue

Remove repeat type conversions

Here is the type of conversion for the variable is repeated.

**Release note**:
```release-note
NONE
```
2017-06-28 18:21:46 -07:00
Kubernetes Submit Queue 13a7fdc83f Merge pull request #48123 from msau42/fix-allocatable-race
Automatic merge from submit-queue (batch tested with PRs 48123, 48079)

[Kubelet] Fix race condition in container manager

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

This fixes a race condition where the container manager capacity map was being updated without synchronization.  It moves the storage capacity detection to kubelet initialization, which happens serially in one thread.

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

**Release note**:

```release-note
Fixes kubelet race condition in container manager.
```
2017-06-28 02:00:07 -07:00
Vishnu kannan 82f7820066 Kubelet:
Centralize Capacity discovery of standard resources in Container manager.
Have storage derive node capacity from container manager.
Move certain cAdvisor interfaces to the cAdvisor package in the process.

This patch fixes a bug in container manager where it was writing to a map without synchronization.

Signed-off-by: Vishnu kannan <vishnuk@google.com>
2017-06-27 18:45:02 -07:00
Robert Pothier d716557f4d Support IPv6 in kubenet_linux.go
When running kubenet with IPv6, there is a panic as there
is IPv4 specific code the Event function.
With this change, Event will support IPv4 and IPv6
2017-06-27 14:36:25 -04:00
Kubernetes Submit Queue 0d84a4fedb Merge pull request #47105 from feiskyer/cleanup
Automatic merge from submit-queue (batch tested with PRs 47038, 47105)

kuberuntime: cleanup TestGenerateContainerConfig

Followup of #47009, cleanup TestGenerateContainerConfig and remove unused expectedConfig.

/assign @yujuhong
2017-06-27 08:29:29 -07:00
Kubernetes Submit Queue cf15b17319 Merge pull request #47484 from allencloud/fix-nit-in-kubelet-server
Automatic merge from submit-queue (batch tested with PRs 47484, 47904, 48034)

fix nits in kubelet server

Signed-off-by: allencloud <allen.sun@daocloud.io>

**What this PR does / why we need it**:
fix nits in kubelet server

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

**Special notes for your reviewer**:
NONE

**Release note**:

```release-note
NONE
```
2017-06-26 22:21:57 -07:00
Kubernetes Submit Queue df41787b1a Merge pull request #47823 from sjenning/fix-waiting-reason
Automatic merge from submit-queue (batch tested with PRs 44058, 48085, 48077, 48076, 47823)

don't pass CRI error through to waiting state reason

Raw gRPC errors are getting into the `Reason` field of the container status `State`, causing it to be output inline on a `kubectl get pod`

xref https://bugzilla.redhat.com/show_bug.cgi?id=1449820

Basically the issue is that the err and msg are reversed in `startContainer()`.  The msg is short and the err is long.  It should be the other way around.

This PR changes `startContainer()` to return a short error that becomes the Reason and the extracted gPRC error description that becomes the Message.

@derekwaynecarr @smarterclayton @eparis
2017-06-26 15:29:33 -07:00
Kubernetes Submit Queue 7800b3ffef Merge pull request #47152 from ublubu/cloud-addresses
Automatic merge from submit-queue

kubelet should let cloud-controller-manager set the node addresses

*Before this change:*

1. cloud-controller-manager sets all the addresses for a node.
2. kubelet on that node replaces these addresses with an incomplete set. (i.e. replace InternalIP and Hostname and delete all other addresses--ExternalIP, etc.)

*After this change:*

kubelet doesn't touch its node's addresses when there is an external cloudprovider.

Fixes #47155

```release-note
NONE
```
2017-06-24 09:31:15 -07:00
Kubernetes Submit Queue d95a8bf66b Merge pull request #47783 from NickrenREN/containerruntime
Automatic merge from submit-queue (batch tested with PRs 47694, 47772, 47783, 47803, 47673)

Make different container runtimes constant

Make different container runtimes constant to avoid hardcode

**Release note**:

```release-note
NONE
```
2017-06-23 08:29:28 -07:00
Kubernetes Submit Queue fcfbfecdfd Merge pull request #47856 from mikedanese/bootstrap-resume
Automatic merge from submit-queue (batch tested with PRs 47915, 47856, 44086, 47575, 47475)

kubelet should resume csr bootstrap

Right now the kubelet creates a new csr object with the same key every
time it restarts during the bootstrap process. It should resume with the
old csr object if it exists. To do this the name of the csr object must
be stable.

Issue https://github.com/kubernetes/kubernetes/issues/47855
2017-06-23 04:06:20 -07:00
Kubernetes Submit Queue 3adb6c630b Merge pull request #47414 from karataliu/wincri5.devwin
Automatic merge from submit-queue (batch tested with PRs 47227, 47119, 46280, 47414, 46696)

Move seccomp helper methods and tests to platform-specific files.

**What this PR does / why we need it**:
Seccomp helper methods are for linux only, move them to linux-specific helper file.

As discussed in https://github.com/kubernetes/kubernetes/pull/46744

**Which issue this PR fixes** 

**Special notes for your reviewer**:

**Release note**:
2017-06-22 23:59:26 -07:00
Kubernetes Submit Queue 467705be00 Merge pull request #47195 from dims/bind-cadvisor-on-kubelet-interface
Automatic merge from submit-queue (batch tested with PRs 47922, 47195, 47241, 47095, 47401)

Run cAdvisor on the same interface as kubelet

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

cAdvisor currently binds to all interfaces. Currently the only
solution is to use iptables to block access to the port. We
are better off making cAdvisor to bind to the interface that
kubelet uses for better security.

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

Fixes #11710

**Special notes for your reviewer**:

**Release note**:

```release-note
cAdvisor binds only to the interface that kubelet is running on instead of all interfaces.
```
2017-06-22 21:33:27 -07:00
Dong Liu 4df4ea2bea Move seccomp helper methods and tests to platform-specific files. 2017-06-23 09:49:06 +08:00
allencloud 25881fe30e fix nits in kubelet server
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-06-23 08:21:09 +08:00
Kubernetes Submit Queue dd126ae19c Merge pull request #38431 from NickrenREN/newVolumeMgr-return
Automatic merge from submit-queue

Modify NewVolumeManager() function return value
2017-06-22 16:43:29 -07:00
Mike Danese 627c414c1b kubelet should resume csr bootstrap
Right now the kubelet creates a new csr object with the same key every
time it restarts during the bootstrap process. It should resume with the
old csr object if it exists. To do this the name of the csr object must
be stable. Also using a list watch here eliminates a race condition
where a watch event is missed and the kubelet stalls.
2017-06-22 23:45:15 +02:00
Chao Xu 60604f8818 run hack/update-all 2017-06-22 11:31:03 -07:00
Chao Xu f2d3220a11 run root-rewrite-import-client-go-api-types 2017-06-22 11:30:59 -07:00
Chao Xu cde4772928 run ./root-rewrite-all-other-apis.sh, then run make all, pkg/... compiles 2017-06-22 11:30:52 -07:00
Chao Xu f4989a45a5 run root-rewrite-v1-..., compile 2017-06-22 10:25:57 -07:00
yiqinguo d170b0ca80 Add type conversion judgment 2017-06-22 20:17:28 +08:00
Cao Shufeng 4ee6b42a4d Fix invalid filename in kubelet log
Fixes: https://github.com/kubernetes/kubernetes/issues/47641
2017-06-22 09:45:21 +08:00
Kubernetes Submit Queue 03014f486c Merge pull request #47824 from mbohlool/revert2
Automatic merge from submit-queue (batch tested with PRs 47851, 47824, 47858, 46099)

Revert 44714 manually

#44714 broke backward compatibility for old swagger spec that kubectl still uses. The decision on #47448 was to revert this change but the change was not automatically revertible. Here I semi-manually remove all references to UnixUserID and UnixGroupID and updated generated files accordingly.

Please wait for tests to pass then review that as there may still be tests that are failing.

Fixes #47448

Adding release note just because the original PR has a release note. If possible, we should remove both release notes as they cancel each other.

**Release note**: (removed by caesarxuchao)

UnixUserID and UnixGroupID is reverted back as int64 to keep backward compatibility.
2017-06-21 15:21:14 -07:00
Kubernetes Submit Queue 2f4df7ffa6 Merge pull request #47819 from verult/AlphaStorageStatus
Automatic merge from submit-queue (batch tested with PRs 34515, 47236, 46694, 47819, 47792)

Adding alpha feature gate to node statuses from local storage capacity isolation.

**What this PR does / why we need it**: The Capacity.storage node attribute should not be exposed since it's part of an alpha feature. Added an feature gate.

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

There should be a test for new statuses in the alpha feature. Will include in a different PR.
2017-06-21 13:30:17 -07:00
Dan Williams 5100925a90 dockershim: checkpoint HostNetwork property
To ensure kubelet doesn't attempt network teardown on HostNetwork
containers that no longer exist but are still checkpointed, make
sure we preserve the HostNetwork property in checkpoints.  If
the checkpoint indicates the container was a HostNetwork one,
don't tear down the network since that would fail anyway.

Related: https://github.com/kubernetes/kubernetes/issues/44307#issuecomment-299548609
2017-06-21 13:10:47 -05:00
mbohlool 70c4fe7f4f update generated files 2017-06-21 04:09:08 -07:00