Commit Graph

23556 Commits (9a21343b20ba414c72bffddfc08dc568e939c470)

Author SHA1 Message Date
Antoine Pelisse d7eec6b51d Revert "Enable batch/v1beta1.CronJobs by default" 2017-08-31 09:54:16 -07:00
Kubernetes Submit Queue bc35234269 Merge pull request #51536 from php-coder/fix_typo_in_api_doc
Automatic merge from submit-queue (batch tested with PRs 50775, 51397, 51168, 51465, 51536)

Fix typo in API docs

Typo fix for https://github.com/kubernetes/kubernetes/pull/47019#discussion_r135780591

xref #47019

CC @jessfraz @simo5
2017-08-30 15:14:36 -07:00
Kubernetes Submit Queue ffcd6d1dce Merge pull request #51465 from soltysh/cronjob_beta
Automatic merge from submit-queue (batch tested with PRs 50775, 51397, 51168, 51465, 51536)

Enable batch/v1beta1.CronJobs by default

This PR moves to CronJobs beta entirely, enabling `batch/v1beta1` by default.

Related issue: #41039 

@erictune @janetkuo ptal

```release-note
Promote CronJobs to batch/v1beta1.
```
2017-08-30 15:14:32 -07:00
Kubernetes Submit Queue 3019daa1dc Merge pull request #51168 from smarterclayton/fix_transport_wrap
Automatic merge from submit-queue (batch tested with PRs 50775, 51397, 51168, 51465, 51536)

Allow bearer requests to be proxied by kubectl proxy

Use a fake transport to capture changes to the request and then surface
them back to the end user.

Fixes #50466

@liggitt no tests yet, but works locally
2017-08-30 15:14:29 -07:00
Kubernetes Submit Queue 6f4a15f922 Merge pull request #51627 from php-coder/fix_godoc
Automatic merge from submit-queue

Fix godoc comments

This PR fixes godoc comments.

CC @simo5
2017-08-30 13:12:37 -07:00
Kubernetes Submit Queue 374e631626 Merge pull request #50757 from NickrenREN/local-storage-limitrange
Automatic merge from submit-queue

Add local ephemeral storage support in LimitRange

**Special notes for your reviewer**:
For a single local ephemeral storage resource

xref #43607 

**Release note**:
```release-note
Add local ephemeral storage support to LimitRange
```

/assign @jingxu97 
cc @ddysher
2017-08-30 13:12:23 -07:00
Kubernetes Submit Queue e794dce445 Merge pull request #48936 from jsafrane/aws-key-check
Automatic merge from submit-queue

AWS: check validity of KSM key before creating a new encrypted disk.

AWS CreateVolume call does not check if referenced encryption key actually exists and returns a valid new AWS EBS volume even though an invalid key was specified. Later on it removes the EBS silently when its encryption fails.

To work around this buggy behavior we manually check that the key exists before calling CreateVolume.

Fixes #48438

/sig aws

Please review carefully. Can we safely assume that Kubernetes controller-manager can read encryption keys?

```release-note
aws: Kubernetes now checks existence of provided KSM (Key Management Service) key before creating an encrypted AWS EBS.
```
2017-08-30 08:05:56 -07:00
Kubernetes Submit Queue 022919d1a4 Merge pull request #51483 from yujuhong/e2e-net-tiers
Automatic merge from submit-queue

e2e: Add tests for network tiers in GCE

This test depends on #51301, which adds the new feature. Only the `e2e: Add tests for network tiers in GCE` commit is new.
#51301 should pass this new test.
2017-08-30 06:55:35 -07:00
Slava Semushin 19e9e027bb Fix godoc comments. 2017-08-30 15:22:47 +02:00
Kubernetes Submit Queue a0fe767fa5 Merge pull request #51539 from saad-ali/enableAlphaGCEDiskAPI
Automatic merge from submit-queue (batch tested with PRs 51439, 51361, 51140, 51539, 51585)

Enable alpha GCE disk API

This PR builds on top of #50467 to allow the GCE disk API to use either the alpha or stable APIs.

CC @freehan
2017-08-30 03:59:35 -07:00
Kubernetes Submit Queue 99c5295fdd Merge pull request #51140 from ConnorDoyle/cpu-manager-interfaces
Automatic merge from submit-queue (batch tested with PRs 51439, 51361, 51140, 51539, 51585)

CPU manager interfaces.

Please review / merge #51132 first.
Blocker for CPU manager #49186 (3 of 6)

@sjenning @derekwaynecarr
2017-08-30 03:59:32 -07:00
Kubernetes Submit Queue 5f8d229585 Merge pull request #51361 from yastij/iscsi-handle-failedMount
Automatic merge from submit-queue (batch tested with PRs 51439, 51361, 51140, 51539, 51585)

Iscsi handle failed mount

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

**Which issue this PR fixes**: fixes #50556

**Special notes for your reviewer**:

**Release note**:

```release-note
None
```
2017-08-30 03:59:30 -07:00
Slava Semushin 227236bd0c Fix typo in docs. 2017-08-30 12:33:37 +02:00
Kubernetes Submit Queue 99a9ee5a3c Merge pull request #51544 from sttts/sttts-deepcopy-pkg-api
Automatic merge from submit-queue (batch tested with PRs 51228, 50185, 50940, 51544, 51543)

pkg/api: simplify deepcopy calls
2017-08-29 23:54:32 -07:00
Kubernetes Submit Queue 583c4a442a Merge pull request #51228 from wongma7/mount-options-sc
Automatic merge from submit-queue

Add storageClass.mountOptions and use it in all applicable plugins

split off from https://github.com/kubernetes/kubernetes/pull/50919 and still dependent on it. cc @gnufied


issue: https://github.com/kubernetes/features/issues/168

```release-note
Add mount options field to StorageClass. The options listed there are automatically added to PVs provisioned using the class.
```
2017-08-29 23:48:32 -07:00
Kubernetes Submit Queue 4d5fc46536 Merge pull request #50998 from zjj2wry/set-env
Automatic merge from submit-queue (batch tested with PRs 51377, 46580, 50998, 51466, 49749)

feat(#21648 )Add kubectl set env command.

**What this PR does / why we need it**:
#21648
Moved from OpenShift to Kubenetes.
@kargakis @smarterclayton 

**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
NONE
```
2017-08-29 22:57:06 -07:00
Kubernetes Submit Queue 367cdb1a55 Merge pull request #46580 from Huawei-PaaS/kube-proxy-ipvs-pr
Automatic merge from submit-queue (batch tested with PRs 51377, 46580, 50998, 51466, 49749)

Implement IPVS-based in-cluster service load balancing

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

Implement IPVS-based in-cluster service load balancing. It can provide some performance enhancement and some other benefits to kube-proxy while comparing iptables and userspace mode. Besides, it also support more sophisticated load balancing algorithms than iptables (least conns, weighted, hash and so on).

**Which issue this PR fixes**

#17470 #44063

**Special notes for your reviewer**:


* Since the PR is a bit large, I splitted it and move the commits related to ipvs util pkg to PR #48994. Hopefully can make it easier to review.

@thockin @quinton-hoole @kevin-wangzefeng @deepak-vij @haibinxie @dhilipkumars @fisherxu 

**Release note**:

```release-note
Implement IPVS-based in-cluster service load balancing
```
2017-08-29 22:57:03 -07:00
Kubernetes Submit Queue 759ba487b3 Merge pull request #51377 from Random-Liu/streaming-server-stop
Automatic merge from submit-queue

Implement stop function in streaming server.

Implement streaming server stop, so that we could properly stop streaming server.

We need this to properly stop cri-containerd.
2017-08-29 22:33:31 -07:00
Kubernetes Submit Queue aa9417ce91 Merge pull request #49927 from huangjiuyuan/fix-kubelet-option-validation
Automatic merge from submit-queue (batch tested with PRs 49961, 50005, 50738, 51045, 49927)

adding validations on kubelet starting configurations

**What this PR does / why we need it**:
I found some validations of kubelet starting options were missing when I was creating a custom cluster from scratch. The kubelet does not check invalid configurations on `--cadvisor-port`, `--event-burst`, `--image-gc-high-threshold`, etc. I have added some validations in kubelet like validations in `cmd/kube-apiserver/app/options/validation.go`.

**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
Adds additional validation for kubelet in `pkg/kubelet/apis/kubeletconfig/validation`.
```
2017-08-29 21:43:42 -07:00
Kubernetes Submit Queue bb8fed88f6 Merge pull request #51045 from jcbsmpsn/rotate-kubelet-client-certificate-beta
Automatic merge from submit-queue (batch tested with PRs 49961, 50005, 50738, 51045, 49927)

Move rotating kubelet client certificate to beta.

```release-note
Release the kubelet client certificate rotation as beta.
```
2017-08-29 21:43:38 -07:00
Kubernetes Submit Queue b4a2c09ede Merge pull request #50738 from sttts/sttts-deepcopy-calls-controllers
Automatic merge from submit-queue (batch tested with PRs 49961, 50005, 50738, 51045, 49927)

controllers: simplify deepcopy calls
2017-08-29 21:43:35 -07:00
Kubernetes Submit Queue 2cf5118abb Merge pull request #49961 from mtaufen/kubectl-hash
Automatic merge from submit-queue (batch tested with PRs 49961, 50005, 50738, 51045, 49927)

Add --append-hash flag to kubectl create configmap/secret

**What this PR does / why we need it**:
Specifying this new flag will automatically hash the configmap/secret
contents with sha256 and append the first 40 hex-encoded bits of the
hash to the name of the configmap/secret. This is especially useful for
workflows that generate configmaps/secrets from files (e.g.
--from-file).

See this Google doc for more background:
https://docs.google.com/document/d/1x1fJ3pGRx20ujR-Y89HUAw8glUL8-ygaztLkkmQeCdU/edit

**Release note**:
```release-note
Adds --append-hash flag to kubectl create configmap/secret, which will append a short hash of the configmap/secret contents to the name during creation.
```
2017-08-29 21:43:29 -07:00
m1093782566 5ed2b44ca7 implement ipvs mode of kube-proxy
Conflicts:
	pkg/util/ipvs/ipvs_unsupported.go
2017-08-30 10:03:02 +08:00
m1093782566 09a853257f wrapper ipvs API as util 2017-08-30 10:01:21 +08:00
Kubernetes Submit Queue 4457e43e7b Merge pull request #47263 from nikhita/crd-01-validation-types
Automatic merge from submit-queue

apiextensions: validation for customresources

- [x] Add types for validation of CustomResources
- [x] Fix conversion-gen: #49747
- [x] Fix defaulter-gen: kubernetes/gengo#61
- [x] Convert to OpenAPI types
- [x] Validate CR using go-openapi
- [x] Validate CRD Schema
- [x] Add integration tests
- [x] Fix round trip tests: #51204 
- [x] Add custom fuzzer functions
- [x] Add custom conversion functions
- [x] Fix data race while updating CRD: #50098 
- [x] Add feature gate for CustomResourceValidation
- [x] Fix protobuf generation

Proposal: https://github.com/kubernetes/community/pull/708
Additional discussion: https://github.com/kubernetes/kubernetes/issues/49879, https://github.com/kubernetes/kubernetes/pull/50625

**Release note**:

```release-note
Add validation for CustomResources via JSON Schema.
```

/cc @sttts @deads2k
2017-08-29 18:37:10 -07:00
saadali 4ca1dbc589 Enable switching to alpha GCE disk API 2017-08-29 17:23:25 -07:00
Kubernetes Submit Queue 0d17e9deb7 Merge pull request #48574 from sakshamsharma/kms-transformer
Automatic merge from submit-queue

Add Google cloud KMS service for envelope encryption transformer

This adds the required pieces which will allow addition of KMS based encryption providers (envelope transformer).

For now, we will be implementing it using Google Cloud KMS, but the code should make it easy to add support for any other such provider which can expose Decrypt and Encrypt calls.

Writing tests for Google Cloud KMS Service may cause a significant overhead to the testing framework. It has been tested locally and on GKE though.

Upcoming after this PR:
* Complete implementation of the envelope transformer, which uses LRU cache to maintain decrypted DEKs in memory.
* Track key version to assist in data re-encryption after a KEK rotation.

Development branch containing the changes described above: https://github.com/sakshamsharma/kubernetes/pull/4

Envelope transformer used by this PR was merged in #49350 

Concerns #48522 

Planned configuration:
```
kind: EncryptionConfig
apiVersion: v1
resources:
  - resources:
    - secrets
    providers:
    - kms:
        cachesize: 100
        configfile: gcp-cloudkms.conf
        name: gcp-cloudkms
    - identity: {}
```

gcp-cloudkms.conf:
```
[GoogleCloudKMS]
    kms-location: global
    kms-keyring: google-container-engine
    kms-cryptokey: example-key
```
2017-08-29 11:11:10 -07:00
Dr. Stefan Schimanski 362439db64 pkg/api: simplify deepcopy calls 2017-08-29 20:04:05 +02:00
Kubernetes Submit Queue a9c80bc97b Merge pull request #51298 from yujuhong/gce-fakes
Automatic merge from submit-queue (batch tested with PRs 51298, 51510, 51511)

GCE: Add a fake forwarding rule service

Also add more methods to the address service.  These
will be used for testing soon.
2017-08-29 10:38:14 -07:00
Dr. Stefan Schimanski 1d053c4f7c controllers: simplify deepcopy calls 2017-08-29 19:21:24 +02:00
Jacob Simpson a0d81d1abb Move rotating kubelet client certificate to beta. 2017-08-29 09:25:12 -07:00
Nikhita Raghunath 6ba1523a8e Add feature gate for CustomResourceValidation
update feature gates for generic apiserver

Add apiextensions-apiserver features to golint_failures

Ignore alpha feature if gate is disabled
2017-08-29 21:35:12 +05:30
Matthew Wong ca98b8e756 Generated storageClass.mountOptions code 2017-08-29 11:37:36 -04:00
Matthew Wong 5e772b8e4b Add storageClass.mountOptions and use it in all applicable plugins 2017-08-29 11:37:36 -04:00
Kubernetes Submit Queue 25da6e64e2 Merge pull request #48454 from weiwei04/check-job-activeDeadlineSeconds
Automatic merge from submit-queue (batch tested with PRs 44719, 48454)

check job ActiveDeadlineSeconds

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

enqueue a sync task after ActiveDeadlineSeconds

**Which issue this PR fixes** *: 

fixes #32149

**Special notes for your reviewer**:

**Release note**:

```release-note
enqueue a sync task to wake up jobcontroller to check job ActiveDeadlineSeconds in time
```
2017-08-29 08:25:06 -07:00
Kubernetes Submit Queue c98959e770 Merge pull request #44719 from jsafrane/fix-apiserver-crash
Automatic merge from submit-queue (batch tested with PRs 44719, 48454)

Fix handling of APIserver errors when saving provisioned PVs.

When API server crashes *after* saving a provisioned PV and before sending
200 OK, the controller tries to save the PV again. In this case, it gets
AlreadyExists error, which should be interpreted as success and not as error.

Especially, a volume that corresponds to the PV should not be deleted in the
underlying storage.

Fixes #44372

```release-note
NONE
```

@kubernetes/sig-storage-pr-reviews
2017-08-29 08:25:03 -07:00
NickrenREN 370e0becb2 Add feature gate and validate test for local storage limitrange 2017-08-29 20:55:20 +08:00
Wei Wei 46239ea30b check job ActiveDeadlineSeconds 2017-08-29 20:15:11 +08:00
Kubernetes Submit Queue 611036c8c3 Merge pull request #51404 from feiskyer/nonewprivs
Automatic merge from submit-queue (batch tested with PRs 51425, 51404, 51459, 51504, 51488)

Admit NoNewPrivs for remote and rkt runtimes

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

#51347 is aiming to admit NoNewPrivis for remote container runtime, but it didn't actually solve the problem. See @miaoyq 's comments [here](https://github.com/kubernetes/kubernetes/pull/51347#discussion_r135379446).

This PR always admit NoNewPrivs for runtimes except docker, which should fix the problem.

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

Fixes #51319.

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-08-29 04:15:28 -07:00
Kubernetes Submit Queue a9b60b4aa9 Merge pull request #51425 from NickrenREN/remove-scratch-overlay
Automatic merge from submit-queue (batch tested with PRs 51425, 51404, 51459, 51504, 51488)

Remove previous local storage resource name 'scratch" and "overlay"

Remove previous local storage resource name 'scratch" and "overlay"

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

**Special notes for your reviewer**:
Now local ephemeral storage resource name is "ResourceEphemeralStorage",  remove previous names as @vishh  suggested in PR #51070

**Release note**:
```release-note
Remove previous local ephemeral storage resource names: "ResourceStorageOverlay" and "ResourceStorageScratch"
```
2017-08-29 04:15:24 -07:00
Connor Doyle 726bd8e27b Add CPU manager interfaces. 2017-08-29 03:42:17 -07:00
Kubernetes Submit Queue 79d0c2d554 Merge pull request #51300 from caesarxuchao/remove-failure-policy
Automatic merge from submit-queue (batch tested with PRs 50919, 51410, 50099, 51300, 50296)

Remove failure policy from initializer configuration

A few reasons:
* Implementing fail open initializers increases complexity a lot
* We haven't seen strong use cases
* We can always add it back
2017-08-29 03:20:08 -07:00
Kubernetes Submit Queue ecc752153d Merge pull request #50099 from kargakis/clean-d-controller
Automatic merge from submit-queue (batch tested with PRs 50919, 51410, 50099, 51300, 50296)

Remove failure check from deployment controller

@kubernetes/sig-apps-pr-reviews this check is useless w/o automatic rollback so I am removing it.
2017-08-29 03:20:05 -07:00
Kubernetes Submit Queue d25a78a692 Merge pull request #51410 from nicksardo/gce-consume-netproj
Automatic merge from submit-queue (batch tested with PRs 50919, 51410, 50099, 51300, 50296)

GCE: Read networkProjectID param

Fixes #48515 

/assign bowei

The first commit is the original PR cherrypicked. The master's kubelet isn't provided a cloud config path, so the project is retrieved via instance metadata. In the GKE case, this project cannot be retrieved by the master and caused an error.

**Release note**:
```release-note
NONE
```
2017-08-29 03:20:02 -07:00
Kubernetes Submit Queue ae17c1f2bf Merge pull request #50919 from wongma7/mount-options
Automatic merge from submit-queue (batch tested with PRs 50919, 51410, 50099, 51300, 50296)

Take mount options to GA by adding PV.spec.mountOptions

**What this PR does / why we need it**: Implements https://github.com/kubernetes/community/pull/771

issue: https://github.com/kubernetes/features/issues/168

**Special notes for your reviewer**:

TODO:
- ~StorageClass mountOptions~

As described in proposal, this adds PV.spec.mountOptions + mountOptions parameter to every plugin that is both provisionable & supports mount options.

(personally, even having done all the work already, i don't agree w/ the proposal that mountOptions should be SC parameter but... :))

**Release note**:

```release-note
Add mount options field to PersistentVolume spec
```
2017-08-29 03:20:00 -07:00
Kubernetes Submit Queue 12d73c31a9 Merge pull request #51436 from liggitt/initializer-feature
Automatic merge from submit-queue (batch tested with PRs 51471, 50561, 50435, 51473, 51436)

Feature gate initializers field

The metadata.initializers field should be feature gated and disabled by default while in alpha, especially since enforcement of initializer permission that keeps users from submitting objects with their own initializers specified is done via an admission plugin most clusters do not enable yet.

Not gating the field and tests caused tests added in https://github.com/kubernetes/kubernetes/issues/51429 to fail on clusters that don't enable the admission plugin.

This PR:
* adds an `Initializers` feature gate, auto-enables the feature gate if the admission plugin is enabled
* clears the `metadata.initializers` field of objects on create/update if the feature gate is not set
* marks the e2e tests as feature-dependent (will follow up with PR to test-infra to enable the feature and opt in for GCE e2e tests)

```release-note
Use of the alpha initializers feature now requires enabling the `Initializers` feature gate. This feature gate is auto-enabled if the `Initialzers` admission plugin is enabled.
```
2017-08-29 02:22:19 -07:00
Kubernetes Submit Queue cc557e61cc Merge pull request #51473 from bboreham/cadvisor-consistent-labels
Automatic merge from submit-queue (batch tested with PRs 51471, 50561, 50435, 51473, 51436)

Fix inconsistent Prometheus cAdvisor metrics

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

We need this because otherwise kubelet is exposing different sets of Prometheus metrics that randomly include or do not include containers.

See also https://github.com/google/cadvisor/issues/1704; quoting here:

Prometheus requires that all metrics in the same family have the same labels, so we arrange to supply blank strings for missing labels

The function `containerPrometheusLabels()` conditionally adds various metric labels from container labels - pod name, image, etc. However, when it receives the metrics, Prometheus [checks](https://github.com/prometheus/client_golang/blob/master/prometheus/registry.go#L665) that all metrics in the same family have the same label set, and [rejects](https://github.com/prometheus/client_golang/blob/master/prometheus/registry.go#L497) those that do not.

Since containers are collected in (somewhat) random order, depending on which kind is seen first you get one set of metrics or the other.

Changing the container labels function to always add the same set of labels, adding `""` when it doesn't have a real value, eliminates the issue in my testing.

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

Fixes #50151

**Special notes for your reviewer**:

I have made the same fix in two places.  I am 98% sure the one in `cadvisor_linux.go` isn't used and indeed cannot be used, but have not gone fully down that rabbit-hole.

**Release note**:
```release-note
Fix inconsistent Prometheus cAdvisor metrics
```
2017-08-29 02:22:16 -07:00
Kubernetes Submit Queue 9f6c61bba3 Merge pull request #50435 from NickrenREN/localstorage-downwardapi
Automatic merge from submit-queue (batch tested with PRs 51471, 50561, 50435, 51473, 51436)

Add local storage to downwards API

**Release note**:
```release-note
Add local ephemeral storage to downward API 
```


/assign @NickrenREN
2017-08-29 02:22:13 -07:00
Kubernetes Submit Queue b5c5b4a494 Merge pull request #50561 from cblecker/zsh-compinit
Automatic merge from submit-queue (batch tested with PRs 51471, 50561, 50435, 51473, 51436)

Allow zsh completion to be autoloaded by compinit

**What this PR does / why we need it**:
Allows the kubectl zsh autocompletion to be auto loaded by compinit. Had to move the the boilerplate down into the specific shell functions as the compdef needs to be the first line in the definition file.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
kubectl zsh autocompletion will work with compinit
```
2017-08-29 02:22:10 -07:00
Kubernetes Submit Queue 0b0b2a22c5 Merge pull request #51415 from jpbetz/timeout-param-minimal
Automatic merge from submit-queue (batch tested with PRs 50932, 49610, 51312, 51415, 50705)

Add --request-timeout to kube-apiserver to make global request timeout configurable

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

Make the currently hard coded 60 global request timeout in apiserver configurable via a --request-timeout command line flag.

**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/51355

**Special notes for your reviewer**:

We plan to backport this to 1.6 and 1.7. To ease the backport work, we've kept this change to a minimum. After this PR we will submit an additional PR to rename `--min-request-timeout` to something that more clearly describes it's purpose, such as `--long-running-request-timeout-min`.

**Release note**:

```release-note
Add --request-timeout to kube-apiserver to make global request timeout configurable.
```
2017-08-29 01:17:40 -07:00