Commit Graph

19134 Commits (3695e85b345858f919a294c2a3c2e95ee5be5341)

Author SHA1 Message Date
Kubernetes Submit Queue 22e6bd4c8d Merge pull request #40915 from tanshanshan/api-groupversion-unittest
Automatic merge from submit-queue

Improve code coverage for pkg/api/util

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

Improve code coverage for pkg/api/util .

Thanks.

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-02-16 23:15:43 -08:00
Kubernetes Submit Queue 1aa0606a81 Merge pull request #41163 from janetkuo/deployment-cleanup
Automatic merge from submit-queue (batch tested with PRs 41517, 41494, 41163)

Deployment: filter out old RSes that are deleted or with non-zero replicas before cleanup

Fixes #36379

cc @zmerlynn @yujuhong @kargakis @kubernetes/sig-apps-bugs
2017-02-16 21:16:04 -08:00
Kubernetes Submit Queue f0b58a7bed Merge pull request #41570 from deads2k/cli-03-tolerate-missing-shortcut
Automatic merge from submit-queue

only construct shortcutmapper when we have the discovery client

Resource shortnames come from the discoveryclient, so we should only wrap with that mapper when we have the information we need.
2017-02-16 19:45:44 -08:00
Kubernetes Submit Queue 34ffba6cd2 Merge pull request #40726 from humblec/gluster-provclean
Automatic merge from submit-queue (batch tested with PRs 40505, 34664, 37036, 40726, 41595)

Rename provisioner config struct
2017-02-16 17:05:15 -08: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 4f6b229fdf Merge pull request #34664 from ymqytw/filter_annotation_for_describe_secret
Automatic merge from submit-queue (batch tested with PRs 40505, 34664, 37036, 40726, 41595)

filter lastAppliedConfig annotation for describe secret

Temporarily addresses: #23564.
This patch filters out the lastAppliedConfig annotation when describing a secret.

```release-note
kubectl describe no longer prints the last-applied-configuration annotation for secrets.
```
2017-02-16 17:05:10 -08:00
Kubernetes Submit Queue 9443d85c4b Merge pull request #40505 from brendandburns/i18n5
Automatic merge from submit-queue

Extract strings from the rollout command.

@fabianofranz @kubernetes/sig-cli-pr-reviews
2017-02-16 16:45:32 -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
Janet Kuo a265186aaa Deployment: filter out old RSes that are deleted or with non-zero replicas before cleanup 2017-02-16 14:48:10 -08:00
Kubernetes Submit Queue 4ac2749af6 Merge pull request #41022 from thockin/proxy-defer-on-update-events
Automatic merge from submit-queue (batch tested with PRs 41505, 41484, 41544, 41514, 41022)

Proxy defer on update events

This PR is a series of discrete movements in refactoring some of kube-proxy's twistier code in prep to be more async.  It should be reviewed one commit at a time.  Each commit is a smallish movement, which should be easier to examine.  I added significant tests along the way, which, unsurprisingly, found some bugs.
2017-02-16 14:28:24 -08:00
Kubernetes Submit Queue f2888c0a30 Merge pull request #41544 from sttts/sttts-core-group-announce-registered
Automatic merge from submit-queue (batch tested with PRs 41505, 41484, 41544, 41514, 41022)

pkg/api/install: use apimachinery/announce+registered

Make core group a little bit less special.
2017-02-16 14:28:19 -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
deads2k 9b5acdbb88 only construct shortcutmapper when we have the discovery client 2017-02-16 11:38:52 -05:00
Kubernetes Submit Queue f07112f78a Merge pull request #41461 from humblec/humble-reviewer
Automatic merge from submit-queue

Updating reviewer list.
2017-02-16 08:33:12 -08:00
Shyam JVS 2ed7acfbcc Revert "Remove alpha provisioning" 2017-02-16 13:53:55 +01:00
Kubernetes Submit Queue 8ecc256e88 Merge pull request #41014 from gmarek/promote_helpers
Automatic merge from submit-queue

Promote taint helpers from e2e/framework to util/taints

cc @kevin-wangzefeng
2017-02-16 02:43:27 -08:00
Dr. Stefan Schimanski 9156981e73 pkg/api/install: use apimachinery/announce+registered 2017-02-16 11:20:43 +01:00
Kubernetes Submit Queue 8faa9b5d4e Merge pull request #40000 from jsafrane/storage-ga-remove-alpha
Automatic merge from submit-queue

Remove alpha provisioning

This is the first part of https://github.com/kubernetes/features/issues/36

@kubernetes/sig-storage-misc 

**Release note**:
```release-note
Alpha version of dynamic volume provisioning is removed in this release. Annotation
"volume.alpha.kubernetes.io/storage-class" does not have any special meaning. A default storage class
and  DefaultStorageClass admission plugin can be used to preserve similar behavior of Kubernetes cluster,
see https://kubernetes.io/docs/user-guide/persistent-volumes/#class-1 for details.
```
2017-02-16 01:02:06 -08:00
gmarek 6b20bb790f generated 2017-02-16 09:25:27 +01:00
gmarek e1e4370ecd Promote taint addition/removal to api/v1/helpers.go 2017-02-16 09:25:27 +01:00
Kubernetes Submit Queue df4e69bb3b Merge pull request #36718 from k82cn/filed_err_msg
Automatic merge from submit-queue

Replace raw string with const var.

Replace raw string with const string var.
2017-02-16 00:12:15 -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
Kubernetes Submit Queue 2a7c50add6 Merge pull request #41311 from gmarek/taints-comments
Automatic merge from submit-queue

Apply davidopps comments to TaintController PR

Fix #41318

cc @timothysc @kevin-wangzefeng
2017-02-15 21:38:09 -08:00
Kubernetes Submit Queue 84bab780d6 Merge pull request #41425 from ncdc/shared-informers-10-serviceaccount
Automatic merge from submit-queue

Switch serviceaccounts controller to generated shared informers

Originally part of #40097 

cc @deads2k @sttts @liggitt @smarterclayton @gmarek @wojtek-t @timothysc @kubernetes/sig-scalability-pr-reviews
2017-02-15 20:54:17 -08:00
Kubernetes Submit Queue 97212f5b3a Merge pull request #37953 from liggitt/automount
Automatic merge from submit-queue (batch tested with PRs 37137, 41506, 41239, 41511, 37953)

Add field to control service account token automounting

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

* adds an `automountServiceAccountToken *bool` field to `ServiceAccount` and `PodSpec`
* if set in both the service account and pod, the pod wins
* if unset in both the service account and pod, we automount for backwards compatibility

```release-note
An `automountServiceAccountToken *bool` field was added to ServiceAccount and PodSpec objects. If set to `false` on a pod spec, no service account token is automounted in the pod. If set to `false` on a service account, no service account token is automounted for that service account unless explicitly overridden in the pod spec.
```
2017-02-15 20:05:13 -08:00
Kubernetes Submit Queue 6823803772 Merge pull request #41239 from vmware/e2eTestsUpdate-v2
Automatic merge from submit-queue (batch tested with PRs 37137, 41506, 41239, 41511, 37953)

e2e test for storage class diskformat verification for vsphere cloud provider

**What this PR does / why we need it**:
This PR adds a new e2e test for vsphere cloud provider.
Test is to verify diskformat specified in storage-class is being honored while volume creation.

Steps:

1. Create StorageClass with diskformat set to valid type (supported options are `eagerzeroedthick`, `zeroedthick` and `thin`)
2. Create PVC which uses the StorageClass created in step 1.
3. Wait for PV to be provisioned.
4. Wait for PVC's status to become Bound
5. Create POD using PVC on specific node.
6. Wait for Disk to be attached to the node.
7. Get node VM's devices and find PV's Volume Disk.
8. Get Backing Info of the Volume Disk and obtain Property of `VirtualDiskFlatVer2BackingInfo` - `EagerlyScrub` and `ThinProvisioned`
9. Based on the value of `EagerlyScrub` and `ThinProvisioned`, verify if diskformat is correct.
10. Delete POD and Wait for Volume Disk to be detached from the Node.
11. Delete PVC, PV and Storage Class



**Which issue this PR fixes** *
fixes #

**Special notes for your reviewer**:
Test is executed against v1.6.0-alpha.1
Test is failing on v1.4.8

**Release Note**
```release-note
NONE
```
@kerneltime @BaluDontu @abrarshivani please review this PR
2017-02-15 20:05:09 -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 92360ffc5f Merge pull request #41439 from deads2k/apiserver-12-sample-fuzz
Automatic merge from submit-queue (batch tested with PRs 41104, 41245, 40722, 41439, 41502)

add sample fuzzing tests

Make fuzzing tests as simple as possible from both the API installer and the scheme, so its easy to add for api groups and so that I can build a scheme and then make sure I got it right.

@kubernetes/sig-api-machinery-pr-reviews @sttts @mikedanese
2017-02-15 16:28:11 -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
Kubernetes Submit Queue e73e25422f Merge pull request #40907 from cblecker/clientgo-pem-functions
Automatic merge from submit-queue

Move private key parsing from serviceaccount/jwt.go to client-go/util/cert

**What this PR does / why we need it**:
Unify private key parsing from serviceaccount/jwt.go into the client-go library.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*:
Partial fix to #40807 - only private key functions.

**Special notes for your reviewer**:

**Release note**:

```release-note
Move private key parsing from serviceaccount/jwt.go to client-go/util/cert
```
2017-02-15 14:26:34 -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
Jordan Liggitt 0c9fd4fbe7
generated files 2017-02-15 16:04:10 -05:00
Jordan Liggitt 0d6e877de2
Add automountServiceAccountToken field to PodSpec and ServiceAccount types 2017-02-15 16:04:09 -05: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
Tim Hockin 1ce3395e7f Simplify stale-connection detection in kube-proxy 2017-02-15 12:39:49 -08:00
Kubernetes Submit Queue 1ad5cea24e Merge pull request #41261 from ncdc/shared-informers-07-resourcequota
Automatic merge from submit-queue

Switch resourcequota controller to shared informers

Originally part of #40097 

I have had some issues with this change in the past, when I updated `pkg/quota` to use the new informers while `pkg/controller/resourcequota` remained on the old informers. In this PR, both are switched to using the new informers. The issues in the past were lots of flakey test failures in the ResourceQuota e2es, where it would randomly fail to see deletions and handle replenishment. I am hoping that now that everything here is consistently using the new informers, there won't be any more of these flakes, but it's something to keep an eye out for.

I also think `pkg/controller/resourcequota` could be cleaned up. I don't think there's really any need for `replenishment_controller.go` any more since it's no longer running individual controllers per kind to replenish. It instead just uses the shared informer and adds event handlers to it. But maybe we do that in a follow up.

cc @derekwaynecarr @smarterclayton @wojtek-t @deads2k @sttts @liggitt @timothysc @kubernetes/sig-scalability-pr-reviews
2017-02-15 11:37:04 -08:00
Tim Hockin 7046c7efcb Prep to move guts of OnEnpointsUpdate to sync
This makes it more obvious that they run together and makes the upcoming
rate-limited syncs easier.

Also make test use ints for ports, so it's easier to see when a port is
a literal value vs a name.
2017-02-15 10:37:05 -08:00
Tim Hockin cddda17d42 Make healthcheck an interface 2017-02-15 10:37:05 -08:00