Commit Graph

4305 Commits (e6dbe5f57eecca4d804a9679014d5cbfd821f383)

Author SHA1 Message Date
Tim Hockin 98d693e9d2 Merge pull request #39837 from foxyriver/modify-comment
modify-comment
2017-02-21 16:33:47 -06:00
Kubernetes Submit Queue b201ac2f8f Merge pull request #41457 from alejandroEsc/ae/kubelet/debug2
Automatic merge from submit-queue

Log that debug handlers have been turned on.

**What this PR does / why we need it**: PR allows user to have a message in logs that debug handlers are on. It should allow the operator to know and automate a check for the case where debug has been left on. 

**Release note**:
```
NONE
```
2017-02-21 10:51:32 -08:00
Jeff Peeler 8fb1b71c66 Implements projected volume driver
Proposal: kubernetes/kubernetes#35313
2017-02-20 12:56:04 -05:00
Kubernetes Submit Queue 7236af6162 Merge pull request #39373 from apprenda/fix_configmap
Automatic merge from submit-queue (batch tested with PRs 39373, 41585, 41617, 41707, 39958)

Fix ConfigMaps for Windows

**What this PR does / why we need it**: ConfigMaps were broken for Windows as the existing code used linux specific file paths. Updated the code in `kubelet_getters.go` to use `path/filepath` to get the directories. Also reverted back the code in `secret.go` as updating `kubelet_getters.go` to use `path/filepath` also fixes `secrets`

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes https://github.com/kubernetes/kubernetes/issues/39372

```release-note
Fix ConfigMap for Windows Containers.
```

cc: @pires
2017-02-19 13:50:37 -08:00
Jacob Simpson 855627e5cb Rotate the kubelet certificate when about to expire.
Changes the kubelet so it doesn't use the cert/key files directly for
starting the TLS server. Instead the TLS server reads the cert/key from
the new CertificateManager component, which is responsible for
requesting new certificates from the Certificate Signing Request API on
the API Server.
2017-02-17 17:42:35 -08:00
Kubernetes Submit Queue 7bbafd259c Merge pull request #41626 from derekwaynecarr/improve-kubelet-volume-logging
Automatic merge from submit-queue (batch tested with PRs 41649, 41658, 41266, 41371, 41626)

Understand why kubelet cannot cleanup orphaned pod dirs

**What this PR does / why we need it**:
Understand if we are unable to clean up orphaned pod directories due to a failure to read the directory versus paths still existing to improve ability to debug error situations.
2017-02-17 16:38:41 -08:00
Jacob Simpson b9f3e91041 Split `RequestNodeCertificate` function.
Split the `RequestNodeCertificate` function so it can be called with
different arguments.
2017-02-17 07:40:48 -08:00
Derek Carr f1b7621f42 kubelet volumes cleanupOrphanedPodDirs does not distinguish error from found volume paths 2017-02-17 09:07:54 -05:00
Kubernetes Submit Queue 98d1cffe05 Merge pull request #37036 from dcbw/docker-gc-teardown-pods
Automatic merge from submit-queue (batch tested with PRs 40505, 34664, 37036, 40726, 41595)

dockertools: call TearDownPod when GC-ing infra pods

The docker runtime doesn't tear down networking when GC-ing pods.
rkt already does so make docker do it too. To ensure this happens,
infra pods are now always GC-ed rather than gating them by
containersToKeep.

This prevents IPAM from leaking when the pod gets killed for
some reason outside kubelet (like docker restart) or when pods
are killed while kubelet isn't running.

Fixes: https://github.com/kubernetes/kubernetes/issues/14940
Related: https://github.com/kubernetes/kubernetes/pull/35572
2017-02-16 17:05:12 -08:00
Kubernetes Submit Queue 05c05de798 Merge pull request #41569 from yujuhong/add_healthcheck
Automatic merge from submit-queue (batch tested with PRs 38101, 41431, 39606, 41569, 41509)

Report node not ready on failed PLEG health check

Report node not ready if PLEG health check fails.
2017-02-16 15:49:18 -08:00
Kubernetes Submit Queue 6376ad134d Merge pull request #39606 from NickrenREN/kubelet-pod
Automatic merge from submit-queue (batch tested with PRs 38101, 41431, 39606, 41569, 41509)

optimize killPod() and syncPod() functions

make sure that one of the two arguments must be non-nil: runningPod, status ,just like the function note says
and judge the return value in syncPod() function before setting podKilled
2017-02-16 15:49:17 -08:00
Kubernetes Submit Queue 4515f72824 Merge pull request #38101 from CaoShuFeng/haripin_nsenter
Automatic merge from submit-queue (batch tested with PRs 38101, 41431, 39606, 41569, 41509)

[hairpin] fix argument of nsenter

**Release note**:

```release-note
None
```

We should use:
	nsenter --net=netnsPath -- -F some_command
instend of:
	nsenter -n netnsPath -- -F some_command
Because "nsenter -n netnsPath" get an error output:
	# nsenter -n /proc/67197/ns/net ip addr
	nsenter: neither filename nor target pid supplied for ns/net

If we really want use -n, we need to use -n in such format:
	# sudo nsenter -n/proc/67197/ns/net ip addr
2017-02-16 15:49:10 -08:00
Dan Williams 20e1cdb97c dockertools: tear down dead infra containers in SyncPod()
Dead infra containers may still have network resources allocated to
them and may not be GC-ed for a long time.  But allowing SyncPod()
to restart an infra container before the old one is destroyed
prevents network plugins from carrying the old network details
(eg IPAM) over to the new infra container.
2017-02-16 13:51:19 -06:00
Dan Williams 4d7d7faa81 dockertools: clean up networking when garbage-collecting pods
The docker runtime doesn't tear down networking when GC-ing pods.
rkt already does so make docker do it too. To ensure this happens,
networking is always torn down for the container even if the
container itself is not deleted.

This prevents IPAM from leaking when the pod gets killed for
some reason outside kubelet (like docker restart) or when pods
are killed while kubelet isn't running.

Fixes: https://github.com/kubernetes/kubernetes/issues/14940
Related: https://github.com/kubernetes/kubernetes/pull/35572
2017-02-16 13:51:19 -06:00
Dan Williams dc2fd511ab dockertools: use network PluginManager to synchronize pod network operations
We need to tear down networking when garbage collecting containers too,
and GC is run from a different goroutine in kubelet.  We don't want
container network operations running for the same pod concurrently.
2017-02-16 13:51:19 -06:00
Dan Williams 4c3cc67385 rkt: use network PluginManager to synchronize pod network operations 2017-02-16 13:51:19 -06:00
Dan Williams aafd5c9ef6 dockershim: use network PluginManager to synchronize pod network operations 2017-02-16 13:51:19 -06:00
Dan Williams 60525801c1 kubelet/network: move mock network plugin to pkg/kubelet/network/testing 2017-02-16 13:48:32 -06:00
Dan Williams 5633d7423a kubelet: add network plugin manager with per-pod operation locking
The PluginManager almost duplicates the network plugin interface, but
not quite since the Init() function should be called by whatever
actually finds and creates the network plugin instance.  Only then
does it get passed off to the PluginManager.

The Manager synchronizes pod-specific network operations like setup,
teardown, and pod network status.  It passes through all other
operations so that runtimes don't have to cache the network plugin
directly, but can use the PluginManager as a wrapper.
2017-02-16 13:48:32 -06:00
Kubernetes Submit Queue 3c606cdd20 Merge pull request #41456 from dashpole/pod_volume_cleanup
Automatic merge from submit-queue (batch tested with PRs 41466, 41456, 41550, 41238, 41416)

Delay Deletion of a Pod until volumes are cleaned up

#41436 fixed the bug that caused #41095 and #40239 to have to be reverted.  Now that the bug is fixed, this shouldn't cause problems.

 @vishh @derekwaynecarr @sjenning @jingxu97 @kubernetes/sig-storage-misc
2017-02-16 10:14:05 -08:00
Yu-Ju Hong 5bb43a3a24 Report node not ready on failed PLEG health check 2017-02-16 09:00:22 -08:00
Kubernetes Submit Queue 11bf535e03 Merge pull request #41434 from freehan/cri-kubenet-error
Automatic merge from submit-queue (batch tested with PRs 41531, 40417, 41434)

[CRI] beef up network teardown in  StopPodSandbox

1. Added CheckpointNotFound error to allow dockershim to conduct error handling
2. Retry network teardown if failed

ref: https://github.com/kubernetes/kubernetes/issues/41225
2017-02-15 23:01:09 -08:00
Kubernetes Submit Queue ddf4a0cad5 Merge pull request #40417 from jsravn/fix-reconciler-external-updates-race
Automatic merge from submit-queue (batch tested with PRs 41531, 40417, 41434)

Always detach volumes in operator executor

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

Instead of marking a volume as detached immediately in Kubelet's
reconciler, delegate the marking asynchronously to the operator
executor. This is necessary to prevent race conditions with other
operations mutating the same volume state.

An example of one such problem:

1. pod is created, volume is added to desired state of the world
2. reconciler process starts
3. reconciler starts MountVolume, which is kicked off asynchronously via
   operation_executor.go
4. MountVolume mounts the volume, but hasn't yet marked it as mounted
5. pod is deleted, volume is removed from desired state of the world
6. reconciler reaches detach volume section, detects volume is no longer in desired state of world,
   removes it from volumes in use
7. MountVolume tries to mark mount, throws an error because
   volume is no longer in actual state of world list. After this, kubelet isn't aware of the mount
   so doesn't try to unmount again.
8. controller-manager tries to detach the volume, this fails because it
   is still mounted to the OS.
9. EBS gets stuck indefinitely in busy state trying to detach.



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

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-02-15 23:01:07 -08:00
Alejandro Escobar 024d750370 making log statement clearer. 2017-02-15 19:49:52 -08:00
NickrenREN b40e575076 optimize killPod() and syncPod() functions
make sure that one of the two arguments must be non-nil: runningPod, status ,just like the function note says
and judge the return value in syncPod() function before setting podKilled
2017-02-16 09:13:23 +08:00
Kubernetes Submit Queue d60d8a7b92 Merge pull request #41104 from apprenda/kubeadm_client-go_move
Automatic merge from submit-queue

kubeadm: Migrate to client-go

**What this PR does / why we need it**: Finish the migration for kubeadm to use client-go wherever possible

**Which issue this PR fixes**: fixes #https://github.com/kubernetes/kubeadm/issues/52

**Special notes for your reviewer**: /cc @luxas @pires 

**Release note**:
```release-note
NONE
```
2017-02-15 16:01:22 -08:00
Kubernetes Submit Queue a1afc024cb Merge pull request #34931 from nhlfr/cadvisor-container-info-table
Automatic merge from submit-queue

kubelet: Make cadvisor GetContainerInfo tests table driven
2017-02-15 15:14:28 -08:00
Derek McQuay 70e7d64b46 kubeadm: moved import to client-go, where possible
Some imports dont exist yet (or so it seems) in client-go (examples
being:

  - "k8s.io/kubernetes/pkg/api/validation"
  - "k8s.io/kubernetes/pkg/util/initsystem"
  - "k8s.io/kubernetes/pkg/util/node"

one change in kubelet to import to client-go
2017-02-15 13:06:15 -08:00
Kubernetes Submit Queue 3bc575c91f Merge pull request #33550 from rtreffer/kubelet-allow-multiple-dns-server
Automatic merge from submit-queue

Allow multipe DNS servers as comma-seperated argument for kubelet --dns

This PR explores how kubectls "--dns" could be extended to specify multiple DNS servers for in-cluster PODs. Testing on the local libvirt-coreos cluster shows that multiple DNS server are injected without issues.

Specifying multiple DNS servers increases resilience against
- Packet drops
- Single server failure

I am debugging services that do 50+ DNS requests for a single incoming interactive request, thus highly increase the chance of a slowdown (+5s) due to a single packet drop. Switching to two DNS servers will reduce the impact of the issues (roughly +1s on glibc, 0s on musl, error-rate goes down to error-rate^2).

Note that there is no need to change any runtime related code as far as I know. In the case of "default" dns the /etc/resolv.conf is parsed and multiple DNS server are send to the backend anyway. This only adds the same capability for the clusterFirst case.

I've heard from @thockin that multiple DNS entries are somehow considered. I've no idea what was considered, though. This is what I would like to see for our production use, though.

```release-note
NONE
```
2017-02-15 12:45:32 -08:00
Minhan Xia 4ca2642dd3 update bazel 2017-02-15 10:06:49 -08:00
Minhan Xia 3cc837878f retry StopPodSandbox on Network teardown failure 2017-02-15 10:06:41 -08:00
David Ashpole 1d38818326 Revert "Merge pull request #41202 from dashpole/revert-41095-deletion_pod_lifecycle"
This reverts commit ff87d13b2c, reversing
changes made to 46becf2c81.
2017-02-15 08:44:03 -08:00
Michal Rostecki 4ed087e01f kubelet: Make cadvisor GetContainerInfo tests table driven 2017-02-15 16:15:21 +01:00
Kubernetes Submit Queue dd696683b7 Merge pull request #40647 from NickrenREN/secretManager
Automatic merge from submit-queue (batch tested with PRs 41360, 41423, 41430, 40647, 41352)

optimize NewSimpleSecretManager and cleanupOrphanedPodCgroups
2017-02-15 05:06:11 -08:00
Kubernetes Submit Queue d47ffa08c7 Merge pull request #41423 from yujuhong/better_logging
Automatic merge from submit-queue (batch tested with PRs 41360, 41423, 41430, 40647, 41352)

kubelet: reduce extraneous logging for pods using host network

For pods using the host network, kubelet/shim should not log
error/warning messages when determining the pod IP address.
2017-02-15 05:06:08 -08:00
Kubernetes Submit Queue 3a6fa67f59 Merge pull request #39179 from NickrenREN/killpod
Automatic merge from submit-queue (batch tested with PRs 41196, 41252, 41300, 39179, 41449)

record ReduceCPULimits result err info if err returned

record ReduceCPULimits result err info if err returned for debug
2017-02-15 04:14:15 -08:00
Kubernetes Submit Queue a57967f47b Merge pull request #41436 from dashpole/status_bug
Automatic merge from submit-queue

Fix bug in status manager TerminatePod

In TerminatePod, we previously pass pod.Status to updateStatusInternal.  This is a bug, since it is the original status that we are given.  Not only does it skip updates made to container statuses, but in some cases it reverted the pod's status to an earlier version, since it was being passed a stale status initially.

This was the case in #40239 and #41095.  As shown in #40239, the pod's status is set to running after it is set to failed, occasionally causing very long delays in pod deletion since we have to wait for this to be corrected.

This PR fixes the bug, adds some helpful debugging statements, and adds a unit test for TerminatePod (which for some reason didnt exist before?).

@kubernetes/sig-node-bugs @vish @Random-Liu
2017-02-14 21:03:31 -08:00
Kubernetes Submit Queue c485e76fe0 Merge pull request #41378 from yujuhong/enable_cri
Automatic merge from submit-queue

Make EnableCRI default to true

This change makes kubelet to use the CRI implementation by default,
unless the users opt out explicitly by using --enable-cri=false.
For the rkt integration, the --enable-cri flag will have no effect
since rktnetes does not use CRI.

Also, mark the original --experimental-cri flag hidden and deprecated,
so that we can remove it in the next release. If both flags are specified,
the --enable-cri flag overrides the --experimental-cri flag.
2017-02-14 19:22:36 -08:00
Minhan Xia 012acad32e add CheckpointNotFound error 2017-02-14 16:55:51 -08:00
Kubernetes Submit Queue fe4a254a70 Merge pull request #41176 from tanshanshan/fix-little2
Automatic merge from submit-queue

fix comment 

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

fix comment 

Thanks.

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-02-14 16:41:45 -08:00
Yu-Ju Hong fb94f441ce Set EnableCRI to true by default
This change makes kubelet to use the CRI implementation by default,
unless the users opt out explicitly by using --enable-cri=false.
For the rkt integration, the --enable-cri flag will have no effect
since rktnetes does not use CRI.

Also, mark the original --experimental-cri flag hidden and deprecated,
so that we can remove it in the next release.
2017-02-14 16:15:51 -08:00
Yu-Ju Hong 77286c38d3 kubelet: reduce extraneous logging for pods using host network
For pods using the host network, kubelet/shim should not log
error/warning messages when determining the pod IP address.
2017-02-14 16:09:42 -08:00
Alejandro Escobar 5d71eb4b05 added log message to capture that log handlers have been turned on. 2017-02-14 14:58:59 -08:00
David Ashpole c612e09acd use the status we modify, not original 2017-02-14 13:36:20 -08:00
Yu-Ju Hong 9fa1ad29fd kubelet: handle containers in the "created" state 2017-02-14 07:51:35 -08:00
NickrenREN 31bfefca3c optimize NewSimpleSecretManager and cleanupOrphanedPodCgroups
remove NewSimpleSecretManager second return value and cleanupOrphanedPodCgroups's return since they will never return err
2017-02-14 09:47:05 +08:00
James Ravn 9992bd23c2 Mark detached only if no pending operations
To safely mark a volume detached when the volume controller manager is used.

An example of one such problem:

1. pod is created, volume is added to desired state of the world
2. reconciler process starts
3. reconciler starts MountVolume, which is kicked off asynchronously via
   operation_executor.go
4. MountVolume mounts the volume, but hasn't yet marked it as mounted
5. pod is deleted, volume is removed from desired state of the world
6. reconciler detects volume is no longer in desired state of world,
   removes it from volumes in use
7. MountVolume tries to mark volume in use, throws an error because
   volume is no longer in actual state of world list.
8. controller-manager tries to detach the volume, this fails because it
   is still mounted to the OS.
9. EBS gets stuck indefinitely in busy state trying to detach.
2017-02-13 11:51:44 +00:00
Pengfei Ni 81b9064ca4 Fix typo of defualt 2017-02-11 22:28:24 +08:00
Random-Liu 8177030957 Change timeout for ExecSync, RunPodSandbox and PullImage. 2017-02-10 16:09:19 -08:00
Kubernetes Submit Queue e9de1b0221 Merge pull request #40992 from k82cn/rm_empty_line
Automatic merge from submit-queue (batch tested with PRs 41236, 40992)

Removed unnecessarly empty line.
2017-02-10 05:38:42 -08:00