Commit Graph

29142 Commits (10b8665a1c9dd5714b13130fcbf5c04f7f658178)

Author SHA1 Message Date
Kubernetes Submit Queue 2ff0bc2b8a
Merge pull request #63967 from deads2k/rbac-06-external
Automatic merge from submit-queue (batch tested with PRs 62025, 63851, 64077, 63967, 63991). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

switch rbac to external

The overall trajectory of the project is towards external types.  Having all helpers agree on the version they operate on makes life much easier.  We've already written one RBAC controller (role aggregation) and more may follow.  `v1` has been around for a while now and we know that any future changes have to reliably roundtrip through it.  This pull switches all the core helpers over to use the external types.

@kubernetes/sig-auth-pr-reviews 

```release-note
`kubectl auth reconcile` only works with rbac.v1
```
2018-05-22 08:40:26 -07:00
Kubernetes Submit Queue 220d16edc0
Merge pull request #64077 from CaoShuFeng/get_test
Automatic merge from submit-queue (batch tested with PRs 62025, 63851, 64077, 63967, 63991). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove one duplicated unit test

Unit test `TestGetAllListObjects` is exactly the same with unit test `TestGetListObjects`.



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

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

**Special notes for your reviewer**:
/assign @soltysh 
**Release note**:
```release-note
NONE
```
2018-05-22 08:40:23 -07:00
Kubernetes Submit Queue 007e936c6d
Merge pull request #63851 from WanLinghao/ctl_create_aggegated_rules
Automatic merge from submit-queue (batch tested with PRs 62025, 63851, 64077, 63967, 63991). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Make kubectl could create clusterrole with aggregation rules

**What this PR does / why we need it**:
The clusterrole aggregation rule features are available since v1.9:
https://kubernetes.io/docs/admin/authorization/rbac/#aggregated-clusterroles
This patch makes kubectl could create clusterrole with aggregation rules.
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-22 08:40:20 -07:00
Kubernetes Submit Queue 48b5fd9182
Merge pull request #62025 from hanxiaoshuai/bugfix0402
Automatic merge from submit-queue (batch tested with PRs 62025, 63851, 64077, 63967, 63991). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

check error when parse field failed

**What this PR does / why we need it**:
check error when parse field failed
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-22 08:40:16 -07:00
David Eads ff743c7f4f generated 2018-05-22 08:17:05 -04:00
David Eads 092714ea0f switch rbac to external 2018-05-22 08:17:05 -04:00
Kubernetes Submit Queue e85b81bbee
Merge pull request #59566 from stewart-yu/ipvsGAkubeadm
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Automatically load ipvs required kernel modules in kubeadm

**What this PR does / why we need it**:
This PR is part of [https://github.com/kubernetes/kubernetes/issues/59402](https://github.com/kubernetes/kubernetes/issues/59402), aiming to load kernel modules in kubeadm

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #[https://github.com/kubernetes/kubernetes/issues/59402](https://github.com/kubernetes/kubernetes/issues/59402)

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-22 02:52:16 -07:00
Kubernetes Submit Queue a0036fcae1
Merge pull request #64113 from juanvallejo/jvallejo/remove-uneeded-factory-methods
Automatic merge from submit-queue (batch tested with PRs 63151, 63795, 63553, 64068, 64113). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove LabelsForObject and ResolveImage from factory

**Release note**:
```release-note
NONE
```

Removes the `ResolveImage` and `LabelsForObject` methods from factory_client_access, which are not needed.

cc @soltysh
2018-05-21 21:41:24 -07:00
Kubernetes Submit Queue 6935b755b9
Merge pull request #63553 from rphillips/fixes/checkpoint_logic_on_restore
Automatic merge from submit-queue (batch tested with PRs 63151, 63795, 63553, 64068, 64113). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubelet: fix checkpoint manager logic bug on restore

**What this PR does / why we need it**:
I am testing the new checkpoint logic within the kubelet and ran across a logic bug on API server restores.

Initial PR: https://github.com/kubernetes/kubernetes/pull/56040

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

**Special notes for your reviewer**:
/cc @vikaschoudhary16 

**Release note**:
```release-note
NONE
```
2018-05-21 21:41:18 -07:00
Kubernetes Submit Queue 0ea35f4c61
Merge pull request #63795 from wojtek-t/watching_secret_manager
Automatic merge from submit-queue (batch tested with PRs 63151, 63795, 63553, 64068, 64113). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Implement watch-based secret manager

Initial experiments on 5000-node Kubemark show that apiserver is handling those with no real issues.
That said, we shouldn't enable it in prod without much more extensive scalability tests (so most probably not in 1.11), but having that in would enable easier testing.

@liggitt
2018-05-21 21:41:14 -07:00
stewart-yu 5f4025c029 auto generated file 2018-05-22 11:20:47 +08:00
stewart-yu 2f7941dd08 load kernel modules required by IPVS in kubeadm 2018-05-22 11:20:47 +08:00
Kubernetes Submit Queue 9eb0c35668
Merge pull request #63701 from scf0920/branch-1
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix typo: peirodically->periodically

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-21 18:42:59 -07:00
Kubernetes Submit Queue 8cccc022b0
Merge pull request #64118 from deads2k/cli-65-podspec
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

move updatepodspecforobject out of factory

Updating a podspec is a polymorphic helper, but it isn't a factory method.

@kubernetes/sig-cli-maintainers 
/assign @juanvallejo 

```release-note
NONE
```
2018-05-21 18:42:37 -07:00
Kubernetes Submit Queue 2a989c60ff
Merge pull request #63221 from mtaufen/dkcfg-live-configmap
Automatic merge from submit-queue (batch tested with PRs 63881, 64046, 63409, 63402, 63221). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Kubelet responds to ConfigMap mutations for dynamic Kubelet config

This PR makes dynamic Kubelet config easier to reason about by leaving less room for silent skew scenarios. The new behavior is as follows:
- ConfigMap does not exist: Kubelet reports error status due to missing source
- ConfigMap is created: Kubelet starts using it
- ConfigMap is updated: Kubelet respects the update (but we discourage this pattern, in favor of incrementally migrating to a new ConfigMap)
- ConfigMap is deleted: Kubelet keeps using the config (non-disruptive), but reports error status due to missing source
- ConfigMap is recreated: Kubelet respects any updates (but, again, we discourage this pattern)

This PR also makes a small change to the config checkpoint file tree structure, because ResourceVersion is now taken into account when saving checkpoints. The new structure is as follows:
```
- dir named by --dynamic-config-dir (root for managing dynamic config)
| - meta
  | - assigned (encoded kubeletconfig/v1beta1.SerializedNodeConfigSource object, indicating the assigned config)
  | - last-known-good (encoded kubeletconfig/v1beta1.SerializedNodeConfigSource object, indicating the last-known-good config)
| - checkpoints
  | - uid1 (dir for versions of object identified by uid1)
    | - resourceVersion1 (dir for unpacked files from resourceVersion1)
    | - ...
  | - ...
```


fixes: #61643

```release-note
The dynamic Kubelet config feature will now update config in the event of a ConfigMap mutation, which reduces the chance for silent config skew. Only name, namespace, and kubeletConfigKey may now be set in Node.Spec.ConfigSource.ConfigMap. The least disruptive pattern for config management is still to create a new ConfigMap and incrementally roll out a new Node.Spec.ConfigSource.
```
2018-05-21 17:05:42 -07:00
Kubernetes Submit Queue fe509498c4
Merge pull request #63402 from juanvallejo/jvallejo/move-printer-flags-to-genericclihelpers
Automatic merge from submit-queue (batch tested with PRs 63881, 64046, 63409, 63402, 63221). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

move printer flags to genericclihelpers

**Release note**:
```release-note
NONE
```

Moves all pkg/kubectl/cmd#PrintFlags to pkg/kubectl/genericclioptions
~~Depends on https://github.com/kubernetes/kubernetes/pull/63340~~
~~Depends on https://github.com/kubernetes/kubernetes/pull/63808~~
~~Depends on https://github.com/kubernetes/kubernetes/pull/63928~~
Depends on https://github.com/kubernetes/kubernetes/pull/64107

~Opening now to catch CI failures~

cc @deads2k @soltysh
2018-05-21 17:05:38 -07:00
Kubernetes Submit Queue 6d510f52f2
Merge pull request #63409 from mtaufen/kc-validation-feature-gates
Automatic merge from submit-queue (batch tested with PRs 63881, 64046, 63409, 63402, 63221). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Kubelet config: Validate new config against future feature gates

This fixes an issue with KubeletConfiguration validation, where the             
feature gates set by the new config were not taken into account.                
                                                                                
Also fixes a validation issue with dynamic Kubelet config, where flag           
precedence was not enforced prior to dynamic config validation in the           
controller; this prevented rejection of dynamic configs that don't merge        
well with values set via legacy flags. 

Fixes #63305 

```release-note
NONE
```
2018-05-21 17:05:34 -07:00
Kubernetes Submit Queue 19388204ee
Merge pull request #64046 from yujuhong/log-rotate-beta
Automatic merge from submit-queue (batch tested with PRs 63881, 64046, 63409, 63402, 63221). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Graduate CRIContainerLogRotation to beta

**Release note**:

```release-note
Graduate CRI container log rotation to beta, and enable it by default.
```
2018-05-21 17:05:30 -07:00
David Eads 087140aee9 move updatepodspecforobject out of factory 2018-05-21 17:56:33 -04:00
Ryan Phillips 6469c8e333 kubelet: fix checkpoint manager logic bug on restore 2018-05-21 16:17:48 -05:00
juanvallejo 8fc0bfd287 remove LabelsForObject and ResolveImage from factory 2018-05-21 16:30:46 -04:00
Kubernetes Submit Queue bf790f4467
Merge pull request #63894 from dims/bump-grpc-max-message-size-for-docker-service
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Bump grpc max message size for docker service

**What this PR does / why we need it**:
When we have a lot of containers, we run into the limit in grpc ( https://github.com/grpc/grpc-go/blob/master/clientconn.go#L118 )

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

**Special notes for your reviewer**:
In https://github.com/kubernetes/kubernetes/pull/63977 we fixed the send and receive sizes on the client side. we should fix the docker service too 

**Release note**:

```release-note
NONE
```
2018-05-21 12:47:14 -07:00
juanvallejo d1603c9560 move PrintOptions to genericclioptions 2018-05-21 14:59:41 -04:00
David Eads 3693ed095f remove API dependency on printers 2018-05-21 13:46:53 -04:00
Michael Taufen b5648c3f61 dynamic Kubelet config reconciles ConfigMap updates 2018-05-21 09:03:58 -07:00
xuzhonghu 4be6328126 remove unused gc code 2018-05-21 20:22:37 +08:00
Cao Shufeng 188b2bfabd remove one duplicated unit test 2018-05-21 10:33:49 +08:00
Michael Taufen 647e90341c Kubelet config: Validate new config against future feature gates
This fixes an issue with KubeletConfiguration validation, where the
feature gates set by the new config were not taken into account.

Also fixes a validation issue with dynamic Kubelet config, where flag
precedence was not enforced prior to dynamic config validation in the
controller; this prevented rejection of dynamic configs that don't merge
well with values set via legacy flags.
2018-05-20 13:15:59 -07:00
Davanum Srinivas eb6bd67446
Bump grpc max message size for docker service 2018-05-19 16:52:00 -04:00
Kubernetes Submit Queue b9c07d272c
Merge pull request #63963 from wojtek-t/collapse_configmap_manager
Automatic merge from submit-queue (batch tested with PRs 63598, 63913, 63459, 63963, 60464). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Refactor ConfigMapManager

This is a follow up from https://github.com/kubernetes/kubernetes/pull/63857 to unify SecretManager with ConfigMap manager.

This is more-or-less a copy of that PR for ConfigMapManager, with super minor changes in secretManager code.
2018-05-19 06:49:23 -07:00
Kubernetes Submit Queue 0a2467d849
Merge pull request #63459 from resouer/fix-63427
Automatic merge from submit-queue (batch tested with PRs 63598, 63913, 63459, 63963, 60464). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Check nodeInfo before ecache predicate

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

There's chances during test when nodeInfo is nil which may cause ecache predicate fail with nil pointer.

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

**Special notes for your reviewer**:

Not sure how to reproduce the original issue yet. i.e. why and when `nodeInfo` will become nil in tests is not clear to me, that's why I label it as WIP.

cc @bsalamat who may have more inputs.

**Release note**:

```release-note
NONE
```
2018-05-19 06:49:19 -07:00
Kubernetes Submit Queue 4b0b91ae31
Merge pull request #63598 from nikhita/subresources-to-beta
Automatic merge from submit-queue (batch tested with PRs 63598, 63913, 63459, 63963, 60464). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apiextensions: promote CustomResourcesSubresources to beta

Fixes #62786

This PR promotes the CustomResourcesSubResources feature to beta and makes it enabled by default.

**Release note**:

```release-note
Subresources for custom resources is now beta and enabled by default. With this, updates to the `/status` subresource will disallow updates to all fields other than `.status` (not just `.spec` and `.metadata` as before). Also, `required` can be used at the root of the CRD OpenAPI validation schema when the `/status` subresource is enabled.
```

/assign sttts deads2k 
/sig api-machinery
/area custom-resources
2018-05-19 06:49:12 -07:00
Kubernetes Submit Queue bdac43b635
Merge pull request #63984 from juanvallejo/jvallejo/move-more-helpers-from-factory
Automatic merge from submit-queue (batch tested with PRs 63770, 63776, 64001, 64028, 63984). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Move additional helpers from the factory

**Release note**:
```release-note
NONE
```

~~Builds on https://github.com/kubernetes/kubernetes/pull/63927~~

cc @deads2k @soltysh
2018-05-19 02:11:39 -07:00
Kubernetes Submit Queue 25c36876a2
Merge pull request #64028 from soltysh/job_scaler
Automatic merge from submit-queue (batch tested with PRs 63770, 63776, 64001, 64028, 63984). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Tolarate negative values when calculating job scale progress

**What this PR does / why we need it**:
It might happen that the job controller will complete a job, but the status will still contain information about active pods which during scale down operation will be giving false (non 0) value in [this calculation](1b950d1e8e/pkg/kubectl/cmd/scalejob/scalejob.go (L147)). To prevent that situation we should tolerate non-zero values there. 

/assign @liggitt 

**Release note**:
```release-note
NONE
```
2018-05-19 02:11:36 -07:00
Kubernetes Submit Queue 8a40e5f77f
Merge pull request #64001 from juanvallejo/jvallejo/sort-on-generic-output
Automatic merge from submit-queue (batch tested with PRs 63770, 63776, 64001, 64028, 63984). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

sort on non-tabular output

**Release note**:

```release-note
NONE
```

Enables sorting objects when printing as json, yaml, etc.

cc @soltysh
2018-05-19 02:11:33 -07:00
Kubernetes Submit Queue a915811a98
Merge pull request #63776 from wgliang/master.test-printers
Automatic merge from submit-queue (batch tested with PRs 63770, 63776, 64001, 64028, 63984). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

use subtest for table units (pkg/printers)

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

Go 1.7 added the subtest feature which can make table-driven tests much easier to run and debug. Many table-driven tests in pkg/kubectl are not using this feature.

/kind cleanup

Further reading: [Using Subtests and Sub-benchmarks](https://blog.golang.org/subtests)

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-19 02:11:30 -07:00
Kubernetes Submit Queue 4d786a937d
Merge pull request #63977 from runcom/increase-grpc-resp-size
Automatic merge from submit-queue (batch tested with PRs 60012, 63692, 63977, 63960, 64008). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

pkg: kubelet: remote: increase grpc client default size

Signed-off-by: Antonio Murdaca <runcom@redhat.com>



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

when running lots and lots of containers and having tons of images on a given node, we started seeing this in the logs (with docker):

```
Unable to retrieve pods: rpc error: code = ResourceExhausted desc = grpc: received message larger than max (4208374 vs. 4194304)
```

That's because the grpc client is defaulting to a 4MB response size.
This patch increases the resp size to 8MB to avoid such issue.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
increase grpc client default response size
```
2018-05-18 23:35:20 -07:00
Kubernetes Submit Queue 680e00a656
Merge pull request #63692 from msau42/debug-scheduler
Automatic merge from submit-queue (batch tested with PRs 60012, 63692, 63977, 63960, 64008). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Only override objects from informer when version has increased.

**What this PR does / why we need it**:
We don't want an informer resync to override assumed volumes if the version has not increased.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-18 23:35:17 -07:00
Kubernetes Submit Queue ddf551c24b
Merge pull request #60012 from atlassian/dial-with-context
Automatic merge from submit-queue (batch tested with PRs 60012, 63692, 63977, 63960, 64008). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use Dial with context

**What this PR does / why we need it**:
`net/http/Transport.Dial` field is deprecated:
```go
// DialContext specifies the dial function for creating unencrypted TCP connections.
// If DialContext is nil (and the deprecated Dial below is also nil),
// then the transport dials using package net.
DialContext func(ctx context.Context, network, addr string) (net.Conn, error)

// Dial specifies the dial function for creating unencrypted TCP connections.
//
// Deprecated: Use DialContext instead, which allows the transport
// to cancel dials as soon as they are no longer needed.
// If both are set, DialContext takes priority.
Dial func(network, addr string) (net.Conn, error)
```
This PR switches all `Dial` usages to `DialContext`. Fixes #63455.

**Special notes for your reviewer**:
Also related: https://github.com/kubernetes/kubernetes/pull/59287 https://github.com/kubernetes/kubernetes/pull/58532 https://github.com/kubernetes/kubernetes/issues/815 https://github.com/kubernetes/community/pull/1166 https://github.com/kubernetes/kubernetes/pull/58677 https://github.com/kubernetes/kubernetes/pull/57932

**Release note**:
```release-note
HTTP transport now uses `context.Context` to cancel dial operations. k8s.io/client-go/transport/Config struct has been updated to accept a function with a `context.Context` parameter. This is a breaking change if you use this field in your code.
```
/sig api-machinery
/kind enhancement
/cc @sttts
2018-05-18 23:35:13 -07:00
Kubernetes Submit Queue 2d1f42e0b1
Merge pull request #63902 from vmware/vcp_secrets
Automatic merge from submit-queue (batch tested with PRs 63969, 63902, 63689, 63973, 63978). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Adds a mechanism in vSphere Cloud Provider to get credentials from Kubernetes secrets

**What this PR does / why we need it**:
Currently, vCenter credentials are stored in plain text in vsphere.conf. This PR adds a mechanism in vSphere Cloud Provider to get vCenter credentials from Kubernetes secrets.

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

**Special notes for your reviewer**:
Internally review here: https://github.com/vmware/kubernetes/pull/484
**Workflow:**
1. Create vsphere.conf file with ```secret-name``` and ```secret-namespace```.
	```
	[Global]
	insecure-flag = 1
	secret-name = "vcconf"
	secret-namespace = "kube-system"

	[VirtualCenter "10.160.45.119"]
	port = 443
	datacenters = k8s-dc-1

	[Workspace]
	server = 10.160.45.119
	datacenter = k8s-dc-1
	default-datastore = sharedVMFS-0
	folder = Discovered virtual machine
	```
2. Launch Kubernetes cluster with vSphere Cloud Provider Configured.
3. Create secret with vCenter credentials.
	a. Create base64 encoding for username and password:
	username:
	```	
		> echo -n 'admin' | base64
		YWRtaW4= 
	```
	password:
	```
		> echo -n 'vsphere' | base64
		dnNwaGVyZQ==
	```

	b. kubectl create -f vccredentials.yaml
	```
		#vccredentials.yaml
		apiVersion: v1
		kind: Secret
		metadata:
			name: vcconf
		type: Opaque
		data:
			10.192.44.199.username: YWRtaW4=
			10.192.44.199.password: dnNwaGVyZQ==
	```
4. vSphere Cloud Provider can be used now.

**Note:**
Secrets info can be provided with both (old and new) vSphere Cloud provider configuration formats.


**Tests Done:**
- [x] vSphere Cloud Provider unit test.
- [x] Volume lifecyle with Username and Password in vsphere.conf (for backward compability)
- [x] Volume lifecyle with secrets information in vsphere.conf.
- [x] Update secrets workflow

**Release note**:

```release-note
Adds a mechanism in vSphere Cloud Provider to get credentials from Kubernetes secrets
```
2018-05-18 15:59:15 -07:00
Mikhail Mazurskiy 5e8e570dbd
Use Dial with context 2018-05-19 08:14:37 +10:00
juanvallejo c87cd9c0f6 sort on non-tabular output 2018-05-18 14:27:16 -04:00
Yu-Ju Hong a3593b5aa6 Graduate CRIContainerLogRotation to beta 2018-05-18 10:09:09 -07:00
Kubernetes Submit Queue 77a08ee2d7
Merge pull request #63989 from MrHohn/gce-security-policy
Automatic merge from submit-queue (batch tested with PRs 63569, 63918, 63980, 63295, 63989). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

GCE provider: add wrapper for security policy

**What this PR does / why we need it**:
Generated mock interface for beta backend service and security policy as well.

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

**Special notes for your reviewer**:
/assign @nicksardo   

**Release note**:

```release-note
NONE
```
2018-05-18 09:54:26 -07:00
Kubernetes Submit Queue 7da05eb87b
Merge pull request #63295 from jsafrane/fix-csi-detach-delete
Automatic merge from submit-queue (batch tested with PRs 63569, 63918, 63980, 63295, 63989). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fixed CSI volume detach when the volume is already detached.

**What this PR does / why we need it**:
"VolumeAttachment NotFound" error should be treated as successful detach.

/sig storage
/assign @vladimirvivien @saad-ali

**Special notes for your reviewer**:
Note that the PR changes just 4 lines in attachment code, the rest is unit test refactoring to inject fake errors.

**Release note**:

```release-note
NONE
```
2018-05-18 09:54:22 -07:00
Kubernetes Submit Queue 08a094ca2e
Merge pull request #63569 from hanxiaoshuai/bugfix0509
Automatic merge from submit-queue (batch tested with PRs 63569, 63918, 63980, 63295, 63989). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix a small mistake in function getFieldMeta

**What this PR does / why we need it**:
fix a small mistake in function getFieldMeta
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:
```
if e, found := ext["x-kubernetes-patch-strategy"]; found {
	strategy, ok := e.(string)
	if !ok {
		return apply.FieldMetaImpl{}, fmt.Errorf("Expected string for x-kubernetes-patch-strategy by got %T", s)
	}
}
```
According the judgment above, I think we should print the type of e.
**Release note**:

```release-note
NONE
```
2018-05-18 09:54:11 -07:00
juanvallejo f3a46cf626 move additional methods from factory 2018-05-18 11:49:02 -04:00
Kubernetes Submit Queue 0ef96cbaf4
Merge pull request #61730 from liggitt/deflake-test-cancel-and-readd
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

increase timeout in TestCancelAndReadd

the flakes referenced in #51704 were still seen downstream. the current timeout approach is [known to be faulty](https://github.com/kubernetes/kubernetes/issues/51704#issuecomment-328459239), but fixing the tests has not been prioritized. this increases the timeout sufficiently to avoid flakes in the meantime

```release-note
NONE
```
2018-05-18 07:20:43 -07:00
Maciej Szulik 6eb69dfff7
Tolarate negative values when calculating job scale progress 2018-05-18 15:35:37 +02:00
WanLinghao 5e9e3afb2e kubectl: add aggregation rule support to clusterrole 2018-05-18 19:44:23 +08:00