Commit Graph

2802 Commits (e5eb6a21b13217d35878003b18bc5c25c8adbda8)

Author SHA1 Message Date
Kubernetes Submit Queue c178c7fd65
Merge pull request #62005 from mikedanese/svcacctproj
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>.

implement ServiceAccountTokenProjection

design here: https://github.com/kubernetes/community/pull/1973

part of https://github.com/kubernetes/kubernetes/pull/61858

```release-note
Add a volume projection that is able to project service account tokens.
```

part of https://github.com/kubernetes/kubernetes/issues/48408

@kubernetes/sig-auth-pr-reviews @kubernetes/sig-storage-pr-reviews
2018-06-05 09:30:56 -07:00
Kubernetes Submit Queue 0647cff9ff
Merge pull request #64386 from andyzhangx/azuredisk-sizegrow
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>.

Add azuredisk PV size grow feature

**What this PR does / why we need it**:
According to kubernetes/features#284, add size grow feature for azure disk

**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 #56463

**Special notes for your reviewer**:
 - This feature is ony for azure managed disk, and if that disk is already attached to a running VM, disk resize will fail as following:
```
$ kubectl describe pvc pvc-azuredisk
Events:
  Type     Reason              Age               From           Message
  ----     ------              ----              ----           -------
  Warning  VolumeResizeFailed  51s (x3 over 3m)  volume_expand  Error expanding volume "default/pvc-azuredisk" of plugin kubernetes.io/azure-disk : disk.DisksClient#CreateOrUpdate: Failure responding to request: StatusCode=409 -- Original Error: autorest/azure: Service returned an error. Status=409 Code="OperationNotAllowed" Message="Cannot resize disk andy-mg1102-dynamic-pvc-d2d00dd9-6185-11e8-a6c3-000d3a0643a8 while it is attached to running VM /subscriptions/.../resourceGroups/.../providers/Microsoft.Compute/virtualMachines/k8s-agentpool-17607330-0."
```

**How to use this feature**
 - `kubectl edit pvc pvc-azuredisk` to change azuredisk PVC size from 6GB to 10GB
```
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
...
    volume.beta.kubernetes.io/storage-provisioner: kubernetes.io/azure-disk
  creationTimestamp: 2018-05-27T08:13:23Z
  finalizers:
  - kubernetes.io/pvc-protection
  name: pvc-azuredisk
...
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 6Gi
  storageClassName: hdd
  volumeMode: Filesystem
  volumeName: pvc-d2d00dd9-6185-11e8-a6c3-000d3a0643a8
status:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 6Gi
  conditions:
  - lastProbeTime: null
    lastTransitionTime: 2018-05-27T08:14:34Z
    message: Waiting for user to (re-)start a pod to finish file system resize of
      volume on node.
    status: "True"
    type: FileSystemResizePending
  phase: Bound
```

 - After resized, `/mnt/disk` is still 6GB
```
$ kubectl exec -it nginx-azuredisk -- bash
# df -h
Filesystem      Size  Used Avail Use% Mounted on
...
/dev/sdf        5.8G   15M  5.5G   1% /mnt/disk
...
```

 - After user run `sudo resize2fs /dev/sdf` in agent node, `/mnt/disk` becomes 10GB now:
```
$ kubectl exec -it nginx-azuredisk -- bash
# df -h
Filesystem      Size  Used Avail Use% Mounted on
...
/dev/sdf        9.8G   16M  9.3G   1% /mnt/disk
...
```

**Release note**:

```
Add azuredisk size grow feature
```

/sig azure
/assign @feiskyer @karataliu @gnufied 
cc @khenidak
2018-06-05 00:02:34 -07:00
Mike Danese 91feb345aa implement service account token projection 2018-06-04 17:22:08 -07:00
Kubernetes Submit Queue 46d2b47156
Merge pull request #57963 from vikaschoudhary16/priorityclass
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>.

Introduce priority class in the resource quota

**What this PR does / why we need it**:
Implements https://github.com/kubernetes/community/pull/933
**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 #48648 

**Special notes for your reviewer**:
Test Cases are still to be covered. Opening this PR to make discussion convenient with code references.
Will update test cases only after design PR has got merged.

**Release note**:

```release-note
Ability to quota resources by priority
```
/kind feature
/priority important-soon
/sig scheduling
/sig node
/cc @resouer @derekwaynecarr @sjenning @bsalamat @timstclair @aveshagarwal @ravisantoshgudimetla
2018-06-04 15:11:00 -07:00
vikaschoudhary16 3cfe6412c7 Introduce priority class in the resource quota 2018-06-04 16:14:54 -04:00
Cao Shufeng 241422879d Log policy name from pod security policy 2018-06-04 19:24:25 +08:00
andyzhangx 880b7a3bda azuredisk size grow feature
fix comments

fix comments
2018-06-03 13:55:49 +00:00
Mike Spreitzer 640d5b7363 Remove optimization from getWork in resourcequota/controller.go
This change simplifies the code in
plugin/pkg/admission/resourcequota/controller.go by removing the
optimization in getWork that required the caller to NOT call
completeWork if getWork returns the empty list of work.  BTW, the
caller was not obeying that requirement; now the caller's behavior
(which is unchanged) is right.

Fixes #63608
2018-05-31 22:43:54 -07:00
Kubernetes Submit Queue a1c8d3f5f3
Merge pull request #64403 from jsafrane/aws-read-only-attach
Automatic merge from submit-queue (batch tested with PRs 57082, 64325, 64016, 64443, 64403). 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>.

Allow AWS EBS volumes to be attached as ReadOnly.

**Which issue(s) this PR fixes**
Fixes #64402

**Special notes for your reviewer**:
This follows logic e.g. in Cinder volume plugin.

**Release note**:

```release-note
AWS EBS volumes can be now used as ReadOnly in pods.
```

/sig storage
/sig aws
2018-05-30 18:49:23 -07:00
Minhan Xia 9fe2c53624 include patch permission for kubelets 2018-05-30 11:15:47 -07:00
Jan Safranek 8ff0fff065 Allow AWS EBS volumes to be attached as ReadOnly. 2018-05-28 16:24:19 +02:00
Kubernetes Submit Queue 9872a0502b
Merge pull request #64288 from gnufied/take-volume-resize-beta
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 volume resize feature to beta

Move volume resizing feature to beta. 

xref https://github.com/kubernetes/features/issues/284

```release-note
Move Volume expansion to Beta
```
2018-05-26 01:34:17 -07:00
Hemant Kumar 0dd6e75567 Move volume resizing to beta
Update bootstrap policies
2018-05-25 15:32:38 -04:00
Kubernetes Submit Queue a8cf18c0ae
Merge pull request #63232 from lichuqiang/provision_plumbing
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>.

Volume topology aware dynamic provisioning: basic plumbing

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

Split PR https://github.com/kubernetes/kubernetes/pull/63193 for better review
part 1: basic scheduler and controller plumbing

Next: https://github.com/kubernetes/kubernetes/pull/63233

**Which issue(s) this PR fixes** 
Feature: https://github.com/kubernetes/features/issues/561
Design: https://github.com/kubernetes/community/issues/2168

**Special notes for your reviewer**:
/sig storage
/sig scheduling
/assign @msau42 @jsafrane @saad-ali @bsalamat


**Release note**:

```release-note
Basic plumbing for volume topology aware dynamic provisioning
```
2018-05-25 07:58:53 -07:00
lichuqiang 95b530366a Add dynamic provisioning process 2018-05-24 17:12:38 +08:00
xuzhonghu 5caf141650 resourcequota return StatusError when timeout 2018-05-24 16:35:19 +08:00
David Eads 092714ea0f switch rbac to external 2018-05-22 08:17:05 -04:00
Kubernetes Submit Queue f86ec3f764
Merge pull request #63992 from mikedanese/owners
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>.

add mikedanese as an approver in various auth related directories

matching the [subprojects](https://docs.google.com/document/d/1RJvnSPOJ3JC61gerCpCpaCtzQjRcsZ2tXkcyokr6sLY/edit) I work on.



```release-note
NONE
```
2018-05-17 15:47:33 -07:00
Mike Danese f39ec8b333 add myself as an approver in various auth related directories
matching the subprojects I work on:

https://docs.google.com/document/d/1RJvnSPOJ3JC61gerCpCpaCtzQjRcsZ2tXkcyokr6sLY/edit
2018-05-17 11:32:37 -07:00
Kubernetes Submit Queue b3837d004a
Merge pull request #63469 from wojtek-t/allow_list_and_watch_secrets
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>.

Allow for listing & watching individual secrets from nodes

This PR:
- propagates value of `metadata.name` field from fieldSelector to `name` field in RequestInfo (for list and watch requests)
- authorizes list/watch for requests for single secrets/configmaps coming from nodes

As an example:
```
/api/v1/secrets/namespaces/ns?fieldSelector=metadata.name=foo =>
  requestInfo.Name = "foo",
  requestInfo.Verb = "list"
/api/v1/secrets/namespaces/ns?fieldSelector=metadata.name=foo&watch=true =>
  requestInfo.Name = "foo",
  requestInfo.Verb = "list"
```

```release-note
list/watch API requests with a fieldSelector that specifies `metadata.name` can now be authorized as requests for an individual named resource
```
2018-05-17 07:09:43 -07:00
Jordan Liggitt 15bcfd5e00
Prevent nodes from updating taints 2018-05-15 13:54:33 -04:00
wojtekt b2500d41e9 Fix bootstrap roles to allow list/watch secrets/configmaps from nodes 2018-05-15 14:19:21 +02:00
wojtekt f344c5c062 Requires single name for list and watch 2018-05-15 14:19:21 +02:00
Jordan Liggitt 736f5e2349
Revert "authz: nodes should not be able to delete themselves"
This reverts commit 35de82094a.
2018-05-11 09:37:21 -04:00
Jordan Liggitt 8161033be4
Make node restriction admission pod lookups use an informer 2018-05-10 07:53:46 -04:00
Kubernetes Submit Queue b2fe2a0a6d
Merge pull request #59847 from mtaufen/dkcfg-explicit-keys
Automatic merge from submit-queue (batch tested with PRs 63624, 59847). 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>.

explicit kubelet config key in Node.Spec.ConfigSource.ConfigMap

This makes the Kubelet config key in the ConfigMap an explicit part of
the API, so we can stop using magic key names.
    
As part of this change, we are retiring ConfigMapRef for ConfigMap.


```release-note
You must now specify Node.Spec.ConfigSource.ConfigMap.KubeletConfigKey when using dynamic Kubelet config to tell the Kubelet which key of the ConfigMap identifies its config file.
```
2018-05-09 17:55:13 -07:00
Michael Taufen c41cf55a2c explicit kubelet config key in Node.Spec.ConfigSource.ConfigMap
This makes the Kubelet config key in the ConfigMap an explicit part of
the API, so we can stop using magic key names.

As part of this change, we are retiring ConfigMapRef for ConfigMap.
2018-05-08 15:37:26 -07:00
David Eads c5445d3c56 simplify api registration 2018-05-08 18:33:50 -04:00
David Eads 7b4f97aca3 generated 2018-05-08 18:32:44 -04:00
Slava Semushin f49a0fbd5f Replace UserIDRange/GroupIDRange by IDRange in internal type to reduce difference with external type.
We had IDRange in both types prior 9440a68744 commit that splitted it
into UserIDRange/GroupIDRange. Later, in c91a12d205 commit we had to
revert this changes because they broke backward compatibility but
UserIDRange/GroupIDRange struct left in the internal type.

This commit removes these leftovers and reduces the differences
between internal and external types.
2018-05-04 18:31:42 +02:00
David Eads 1f4f22f72d don't block creation on lack of delete powers 2018-05-03 12:04:04 -04:00
Kubernetes Submit Queue b5f61ac129
Merge pull request #62657 from matthyx/master
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>.

Update all script shebangs to use /usr/bin/env interpreter instead of /bin/interpreter

This is required to support systems where bash doesn't reside in /bin (such as NixOS, or the *BSD family) and allow users to specify a different interpreter version through $PATH manipulation.
https://www.cyberciti.biz/tips/finding-bash-perl-python-portably-using-env.html
```release-note
Use /usr/bin/env in all script shebangs to increase portability.
```
2018-05-02 19:44:32 -07:00
Jordan Liggitt ff8cdabfd4
Maintain index of high-cardinality edges in node authorizer graph 2018-05-02 16:05:28 -04:00
Jordan Liggitt ad7d5505b9
clean up vertex/edge deletion 2018-05-02 15:39:50 -04:00
David Eads 9a48066749 update restmapping to indicate fully qualified resource 2018-05-01 16:34:49 -04:00
David Eads ef0d1ab819 remove incorrect static restmapper 2018-05-01 07:51:17 -04:00
Kubernetes Submit Queue 2716de27b1
Merge pull request #56568 from zouyee/sync
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>.

sync code from copy destination

**What this PR does / why we need it**:
sync code from copy destination

**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**:

**Release note**:

```
NONE

```
2018-04-28 18:26:38 -07:00
Kubernetes Submit Queue 55f17933f5
Merge pull request #60741 from zlabjp/optional-subjects
Automatic merge from submit-queue (batch tested with PRs 60890, 63244, 60741, 63254). 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>.

Indicate clusterrolebinding, rolebinding subjects are optional fields

**What this PR does / why we need it**: With this PR, clusterrolebinding and rolebinding subjects are marked optional instead of required. Currently we cannot create clusterrolebinding and rolebinding with subjects are empty using `kubectl create/apply/replace -f`.

```
$ kubectl create rolebinding test --clusterrole view
rolebinding "test" created
$ kubectl get rolebinding test -o yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  creationTimestamp: 2018-03-02T06:58:16Z
  name: test
  namespace: default
  resourceVersion: "5606612"
  selfLink: /apis/rbac.authorization.k8s.io/v1/namespaces/default/rolebindings/test
  uid: 155c5c29-1de7-11e8-9f6f-fa163ec89f2a
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: view
subjects: null
$ kubectl get rolebinding test -o yaml | kubectl replace -f -
error: error validating "STDIN": error validating data: ValidationError(RoleBinding): missing required field "subjects" in io.k8s.api.rbac.v1.RoleBinding; if you choose to ignore these errors, turn validation off with --validate=false
```

**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**: This is a same issue with https://github.com/kubernetes/kubernetes/issues/59403. /cc @liggitt 

**Release note**:

```release-note
NONE
```
2018-04-27 17:43:11 -07:00
Kubernetes Submit Queue dd5f030b02
Merge pull request #63165 from deads2k/api-08-kubeapiversion
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>.

Remove KUBE_API_VERSIONS

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

KUBE_API_VERSIONS is an attempt to control the available serialization of types. It pre-dates the idea that we'll have separate schemes, so it's not a thing that makes sense anymore.

Server-side we've had a very clear message about breaks in the logs for a year "KUBE_API_VERSIONS is only for testing. Things will break.".

Client-side it became progressively more broken as we moved to generic types for CRUD more than a year ago. What is registered doesn't matter when everything is unstructured.

We should remove this piece of legacy since it doesn't behave predictable server-side or client-side.

@smarterclayton @lavalamp
@kubernetes/sig-api-machinery-bugs 

```release-note
KUBE_API_VERSIONS is no longer respected.  It was used for testing, but runtime-config is the proper flag to set.
```
2018-04-26 08:22:36 -07:00
David Eads a68c57155e remove KUBE_API_VERSIONS 2018-04-26 08:27:49 -04:00
Kubernetes Submit Queue becee4c12e
Merge pull request #59367 from colemickens/ptr-flake
Automatic merge from submit-queue (batch tested with PRs 59367, 60007). 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>.

podtolerationrestriction: fix informer race in test

**What this PR does / why we need it**: This fixes test flakes in the PodTolerationRestriction admission controller unit tests. They seem to pass most of the time currently, but modifications I was making for #58818 changed timing and caused it to constantly break.

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

**Special notes for your reviewer**: n/a

Sending this as a one-off because the changes for both of the admin controllers in #58818 require additional discussion. Thanks to @ericchiang for finding it and authoring the commit; I just rebased and sent the PR.

```release-note
NONE
```
2018-04-26 00:43:07 -07:00
David Eads e931158128 generated 2018-04-25 09:02:32 -04:00
David Eads e7fbbe0e3c eliminate indirection from type registration 2018-04-25 09:02:31 -04:00
Kubernetes Submit Queue 15b61bc006
Merge pull request #62818 from mikedanese/selfdelete
Automatic merge from submit-queue (batch tested with PRs 62590, 62818, 63015, 62922, 63000). 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>.

authz: nodes should not be able to delete themselves

@kubernetes/sig-auth-pr-reviews 

```release-note
kubelets are no longer allowed to delete their own Node API object. Prior to 1.11, in rare circumstances related to cloudprovider node ID changes, kubelets would attempt to delete/recreate their Node object at startup. If a legacy kubelet encounters this situation, a cluster admin can remove the Node object:
* `kubectl delete node/<nodeName>`
or grant self-deletion permission explicitly:
* `kubectl create clusterrole self-deleting-nodes --verb=delete --resource=nodes`
* `kubectl create clusterrolebinding self-deleting-nodes --clusterrole=self-deleting-nodes --group=system:nodes`
```
2018-04-24 14:22:13 -07:00
Kubernetes Submit Queue f0b207df2d
Merge pull request #62856 from liggitt/node-authorizer-contention-benchmark
Automatic merge from submit-queue (batch tested with PRs 62409, 62856). 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>.

Add node authorizer contention benchmark

* Makes the node authorization benchmark run in parallel
* Runs the tests a second time with a background goroutine pushing graph modifications at a rate of 100x per second (to test authorization performance with contention on the graph lock).

Graph modifications come from the informers watching objects relevant to node authorization, and only fire when a relevant change is made (for example, most node updates do not trigger a graph modification, only ones which change the node's config source configmap reference; most pod updates do not trigger a graph modification, only ones that set the pod's nodeName or uid)

The results do not indicate bottlenecks in the authorizer, even under higher-than-expected write contention.

```
$ go test ./plugin/pkg/auth/authorizer/node/ -run foo -bench 'Authorization' -benchmem -v
goos: darwin
goarch: amd64
pkg: k8s.io/kubernetes/plugin/pkg/auth/authorizer/node
BenchmarkAuthorization/allowed_node_configmap-8                                 596 ns/op   529 B/op   11 allocs/op    3000000
BenchmarkAuthorization/allowed_configmap-8                                      609 ns/op   529 B/op   11 allocs/op    3000000
BenchmarkAuthorization/allowed_secret_via_pod-8                                 586 ns/op   529 B/op   11 allocs/op    3000000
BenchmarkAuthorization/allowed_shared_secret_via_pod-8                        18202 ns/op   542 B/op   11 allocs/op     100000
BenchmarkAuthorization/disallowed_node_configmap-8                              900 ns/op   691 B/op   17 allocs/op    2000000
BenchmarkAuthorization/disallowed_configmap-8                                   868 ns/op   693 B/op   17 allocs/op    2000000
BenchmarkAuthorization/disallowed_secret_via_pod-8                              875 ns/op   693 B/op   17 allocs/op    2000000
BenchmarkAuthorization/disallowed_shared_secret_via_pvc-8                      1215 ns/op   948 B/op   22 allocs/op    1000000
BenchmarkAuthorization/disallowed_pvc-8                                         912 ns/op   693 B/op   17 allocs/op    2000000
BenchmarkAuthorization/disallowed_pv-8                                         1137 ns/op   834 B/op   19 allocs/op    2000000
BenchmarkAuthorization/disallowed_attachment_-_no_relationship-8                892 ns/op   677 B/op   16 allocs/op    2000000
BenchmarkAuthorization/disallowed_attachment_-_feature_disabled-8               236 ns/op   208 B/op    2 allocs/op   10000000
BenchmarkAuthorization/allowed_attachment_-_feature_enabled-8                   723 ns/op   593 B/op   12 allocs/op    2000000

BenchmarkAuthorization/contentious_allowed_node_configmap-8                     726 ns/op   529 B/op   11 allocs/op    2000000
BenchmarkAuthorization/contentious_allowed_configmap-8                          698 ns/op   529 B/op   11 allocs/op    2000000
BenchmarkAuthorization/contentious_allowed_secret_via_pod-8                     778 ns/op   529 B/op   11 allocs/op    2000000
BenchmarkAuthorization/contentious_allowed_shared_secret_via_pod-8            21406 ns/op   638 B/op   13 allocs/op     100000
BenchmarkAuthorization/contentious_disallowed_node_configmap-8                 1135 ns/op   692 B/op   17 allocs/op    1000000
BenchmarkAuthorization/contentious_disallowed_configmap-8                      1239 ns/op   691 B/op   17 allocs/op    1000000
BenchmarkAuthorization/contentious_disallowed_secret_via_pod-8                 1043 ns/op   692 B/op   17 allocs/op    1000000
BenchmarkAuthorization/contentious_disallowed_shared_secret_via_pvc-8          1404 ns/op   950 B/op   22 allocs/op    1000000
BenchmarkAuthorization/contentious_disallowed_pvc-8                            1177 ns/op   693 B/op   17 allocs/op    1000000
BenchmarkAuthorization/contentious_disallowed_pv-8                             1295 ns/op   834 B/op   19 allocs/op    1000000
BenchmarkAuthorization/contentious_disallowed_attachment_-_no_relationship-8   1170 ns/op   676 B/op   16 allocs/op    1000000
BenchmarkAuthorization/contentious_disallowed_attachment_-_feature_disabled-8   262 ns/op   208 B/op    2 allocs/op   10000000
BenchmarkAuthorization/contentious_allowed_attachment_-_feature_enabled-8       790 ns/op   593 B/op   12 allocs/op    2000000

--- BENCH: BenchmarkAuthorization
   node_authorizer_test.go:592: graph modifications during non-contention test: 0
   node_authorizer_test.go:589: graph modifications during contention test: 6301
   node_authorizer_test.go:590: <1ms=5507, <10ms=128, <25ms=43, <50ms=65, <100ms=135, <250ms=328, <500ms=93, <1000ms=2, >1000ms=0
PASS
ok     k8s.io/kubernetes/plugin/pkg/auth/authorizer/node   112.616s
```

```release-note
NONE
```
2018-04-23 01:35:14 -07:00
Pavel Pospisil d3ddf7eb8b Always Start pvc-protection-controller and pv-protection-controller
After K8s 1.10 is upgraded to K8s 1.11 finalizer [kubernetes.io/pvc-protection] is added to PVCs
because StorageObjectInUseProtection feature will be GA in K8s 1.11.
However, when K8s 1.11 is downgraded to K8s 1.10 and the StorageObjectInUseProtection feature is disabled
the finalizers remain in the PVCs and as pvc-protection-controller is not started in K8s 1.10 finalizers
are not removed automatically from deleted PVCs and that's why deleted PVC are not removed from the system
but remain in Terminating phase.
The same applies to pv-protection-controller and [kubernetes.io/pvc-protection] finalizer in PVs.

That's why pvc-protection-controller is always started because the pvc-protection-controller removes finalizers
from PVCs automatically when a PVC is not in active use by a pod.
Also the pv-protection-controller is always started to remove finalizers from PVs automatically when a PV is not
Bound to a PVC.

Related issue: https://github.com/kubernetes/kubernetes/issues/60764
2018-04-20 19:54:50 +02:00
Mike Danese 35de82094a authz: nodes should not be able to delete themselves 2018-04-20 10:22:07 -07:00
Kubernetes Submit Queue fc7527537f
Merge pull request #62336 from deads2k/rbac-05-scale
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>.

add statefulset scaling permission to admins, editors, and viewers

StatefulSets are missing scale permissions, so users can't scale them.


```release-note
fix permissions to allow statefulset scaling for admins, editors, and viewers
```
2018-04-20 05:31:11 -07:00
Jordan Liggitt 1c6998a2f3
Add node authorizer contention benchmark 2018-04-19 23:11:54 -04:00
Harsh Desai adc71854e2 Add support to resize Portworx volume
Closes #62305

Signed-off-by: Harsh Desai <harsh@portworx.com>

update comment and variable references to GiB

Signed-off-by: Harsh Desai <harsh@portworx.com>

explicitly check volume size after resize and fix size volume spec

Signed-off-by: Harsh Desai <harsh@portworx.com>

If Portworx volume is already greater than new size, skip resize

Signed-off-by: Harsh Desai <harsh@portworx.com>

Allow updated volume to be greater than requested size

Signed-off-by: Harsh Desai <harsh@portworx.com>
2018-04-19 12:14:43 -07:00
Matthias Bertschy 9b15af19b2 Update all script to use /usr/bin/env bash in shebang 2018-04-19 13:20:13 +02:00
Kubernetes Submit Queue 60141cdfd9
Merge pull request #59317 from CaoShuFeng/assert_Equal
Automatic merge from submit-queue (batch tested with PRs 62448, 59317, 59947, 62418, 62352). 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 assert.Equal argument order

Reference:
https://godoc.org/github.com/stretchr/testify/assert#Equal



**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-04-17 16:31:17 -07:00
Kubernetes Submit Queue 229ab73ada
Merge pull request #58784 from wackxu/reminit
Automatic merge from submit-queue (batch tested with PRs 58784, 62057, 62621, 62652, 62656). 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 deprecated initresource admission plugin

**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)*:

xref https://github.com/kubernetes/kubernetes/pull/55375#issuecomment-360329586

**Special notes for your reviewer**:
/assign @piosz @deads2k 

**Release note**:

```release-note
remove deprecated initresource admission plugin
```
2018-04-16 12:58:11 -07:00
Kubernetes Submit Queue 860403dada
Merge pull request #62275 from CaoShuFeng/resourcequota_code
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>.

not return 500 status code for insufficient quota

This is not an unexpected error, so it should not return a 500 code, I think.
@derekwaynecarr 

**Release note**:
```release-note
NONE
```
2018-04-15 15:49:53 -07:00
Kubernetes Submit Queue eca4d0372f
Merge pull request #62471 from mikedanese/certs2
Automatic merge from submit-queue (batch tested with PRs 62486, 62471, 62183). 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>.

sarapprover: remove self node cert

The functionality to bootstrap node certificates is ready but is blocked by a separable issue discussed in: https://github.com/kubernetes/community/pull/1982. The functionality could be useful for power users who want to write their own approvers if the feature could be promoted to beta. In it's current state this feature doesn't help anybody.

I propose that we remove automated approval of node serving certificates for now and work towards getting the node functionality to beta.

cc @awly @kubernetes/sig-auth-pr-reviews 
```release-note
Remove alpha functionality that allowed the controller manager to approve kubelet server certificates.
```
2018-04-13 16:01:10 -07:00
Mike Danese 7665f15b7d sarapprover: remove self node cert
The functionality to bootstrap node certificates is ready but is blocked
by a seperable issue discussed in:
https://github.com/kubernetes/community/pull/1982. The functionality
could be useful for power users who want to write their own approvers if
the feature could be promoted to beta. In it's current state this
feature doesn't help anybody.

I propose that we remove automated approval of node serving certificates
for now and work towards getting the node functionality to beta.
2018-04-13 11:23:51 -07:00
Kubernetes Submit Queue 71e00a6b8e
Merge pull request #61608 from php-coder/psp_move_internal_types_to_policy
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>.

PSP: move internal types to policy API group

**What this PR does / why we need it**:
This is a part of the PSP migration from extensions to policy API group. This PR moves internal types to the its final destination.

**Which issue(s) this PR fixes**:
Addressed to https://github.com/kubernetes/features/issues/5
2018-04-13 05:22:24 -07:00
Kubernetes Submit Queue 39194c1367
Merge pull request #62146 from frodenas/fix-dsc-rbac
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 daemon-set-controller bootstrap RBAC policy

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

Adds a `get` permission for the `controllerrevisions` resource to the `daemon-set-controller` cluster role.

**Which issue(s) this PR fixes** :

Fixes #62145

**Special notes for your reviewer**:

The daemon-sets controller [constructs the history](https://github.com/kubernetes/kubernetes/blob/release-1.9/pkg/controller/daemon/daemon_controller.go#L1116) of the daemon-set, so it needs to [check the controller revisions](https://github.com/kubernetes/kubernetes/blob/release-1.9/pkg/controller/daemon/update.go#L265) for the daemon-set app. See issue above.

**Release note**:

```release-note
Resolves forbidden error when the `daemon-set-controller` cluster role access `controllerrevisions` resources.
```
2018-04-13 00:27:00 -07:00
Slava Semushin 6767e233ed Update generated files.
In order to make it compilable I had to remove these files manually:

pkg/client/listers/extensions/internalversion/podsecuritypolicy.go
pkg/client/informers/informers_generated/internalversion/extensions/internalversion/podsecuritypolicy.go
pkg/client/clientset_generated/internalclientset/typed/extensions/internalversion/podsecuritypolicy.go
pkg/client/clientset_generated/internalclientset/typed/extensions/internalversion/fake/fake_podsecuritypolicy.go
2018-04-11 18:35:24 +02:00
Slava Semushin 8a7d5707d5 PSP: move internal types from extensions to policy. 2018-04-11 18:35:09 +02:00
Kubernetes Submit Queue 56d6f05d23
Merge pull request #61866 from davidz627/fix/CSIe2e
Automatic merge from submit-queue (batch tested with PRs 62192, 61866, 62206, 62360). 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>.

Add CSI External Components ClusterRole to bootstrapped roles 

Added CSI External Components ClusterRole to bootstrapped roles and removed creation from failing e2e test

Fixes: #61781

/sig storage
/kind bug
/assign @liggitt @saad-ali 

```release-note
NONE
```
2018-04-10 23:52:17 -07:00
David Eads d280c115d4 add statefulset scaling permission to admins, editors, and viewers 2018-04-10 08:11:39 -04:00
David Zhu fbbccbf92d Added CSI External Components ClusterRole to bootstrapped roles and removed creation from failing e2e test 2018-04-09 14:16:48 -07:00
Cao Shufeng 1ba7082176 not return 500 status code for insufficient quota 2018-04-09 17:49:09 +08:00
Kubernetes Submit Queue cc2cab1040
Merge pull request #62231 from liggitt/graph-flake
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 graph test sorting

fixes #62222

```release-note
NONE
```
2018-04-06 20:17:14 -07:00
Kubernetes Submit Queue 58c0748b4d
Merge pull request #58807 from CaoShuFeng/audit_annotation_rbac
Automatic merge from submit-queue (batch tested with PRs 61183, 58807). 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>.

Add RBAC information to audit logs

Depends on: https://github.com/kubernetes/kubernetes/pull/58806
**Release note**:
```release-note
RBAC information is included in audit logs via audit.Event annotations:
authorization.k8s.io/decision = {allow, forbid}
authorization.k8s.io/reason = human-readable reason for the decision
```
2018-04-06 19:31:04 -07:00
Jordan Liggitt 7f5def4361
fix graph test sorting 2018-04-06 20:46:25 -04:00
Ferran Rodenas 7dfe037712 Fix daemon-set-controller bootstrap RBAC policy
Signed-off-by: Ferran Rodenas <rodenasf@vmware.com>
2018-04-04 23:24:05 +02:00
Kubernetes Submit Queue c46738a3f0
Merge pull request #60073 from justaugustus/int-to-int32ptr
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>.

Use `pkg/util/pointer` functions instead of self-written versions

**What this PR does / why we need it**:
Replaces instances of module-written `int(32|64)? --> *int(32|64)?` functions with functions from k8s.io/kubernetes/pkg/util/pointer

**Special notes for your reviewer**:

Here's the grep used, based on the comments in:
* https://github.com/kubernetes/kubernetes/pull/59924#issuecomment-366119396
* https://github.com/kubernetes/kubernetes/issues/59971#issue-297766556

```bash
$ git grep -E 'func\ [^ (]+\([^ ]+\ int(32|64)?\)\ \*int(32|64)?' !(vendor|staging) | grep -v pkg/util/pointer

pkg/apis/apps/v1/defaults_test.go:func newInt32(val int32) *int32 {
pkg/apis/apps/v1beta1/defaults_test.go:func newInt32(val int32) *int32 {
pkg/apis/apps/v1beta2/defaults_test.go:func newInt32(val int32) *int32 {
pkg/apis/autoscaling/v1/defaults_test.go:func newInt32(val int32) *int32 {
pkg/apis/autoscaling/v2beta1/defaults_test.go:func newInt32(val int32) *int32 {
pkg/apis/autoscaling/validation/validation_test.go:func newInt32(val int32) *int32 {
pkg/apis/batch/v1/defaults_test.go:func newInt32(val int32) *int32 {
pkg/apis/batch/v1beta1/defaults_test.go:func newInt32(val int32) *int32 {
pkg/apis/core/v1/defaults_test.go:func newInt(val int32) *int32 {
pkg/apis/core/validation/validation_test.go:func newInt32(val int) *int32 {
pkg/apis/extensions/v1beta1/defaults_test.go:func newInt32(val int32) *int32 {
pkg/controller/deployment/sync_test.go:func intOrStrP(val int) *intstr.IntOrString {
pkg/kubectl/autoscale_test.go:func newInt32(value int) *int32 {
plugin/pkg/admission/security/podsecuritypolicy/admission_test.go:func userIDPtr(i int) *int64 {
plugin/pkg/admission/security/podsecuritypolicy/admission_test.go:func groupIDPtr(i int) *int64 {
test/e2e/apps/deployment.go:func intOrStrP(num int) *intstr.IntOrString {
test/e2e/auth/pod_security_policy.go:func intPtr(i int64) *int64 {
test/integration/deployment/util.go:func intOrStrP(num int) *intstr.IntOrString {
```

**Release note**:

```release-note
NONE
```
/kind cleanup
/cc @php-coder 
/assign @tallclair
2018-04-02 16:22:28 -07:00
hangaoshuai 33f389bc1e use handle DeletedFinalStateUnknown objects in function deleteNode 2018-03-30 11:51:39 +08:00
Michael Taufen ab8dc12333 node authorizer sets up access rules for dynamic config
This PR makes the node authorizer automatically set up access rules for
dynamic Kubelet config.

I also added some validation to the node strategy, which I discovered we
were missing while writing this.
2018-03-27 08:49:45 -07:00
Stephen Augustus 09aa0b9c1d pkg/util/pointer: Update `int` pointer functions
* Implement `Int64Ptr` function
* Replace per module functions of `int(32|64)?` --> `*int(32|64)?`
* Update bazel rules
2018-03-27 10:30:01 -04:00
Kubernetes Submit Queue 71050b6f2d
Merge pull request #60519 from bsalamat/auto_prio_class
Automatic merge from submit-queue (batch tested with PRs 60519, 61099, 61218, 61166, 61714). 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 add system critical priority classes at cluster boostrapping

**What this PR does / why we need it**:
We had two PriorityClasses that were hardcoded and special cased in our code base. These two priority classes never existed in API server. Priority admission controller had code to resolve these two names. This PR removes the hardcoded PriorityClasses and adds code to create these PriorityClasses automatically when API server starts.

**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 #60178

ref/ #57471

**Special notes for your reviewer**:

**Release note**:

```release-note
Automatically add system critical priority classes at cluster boostrapping.
```

/sig scheduling
2018-03-26 23:20:05 -07:00
Kubernetes Submit Queue c014cc2740
Merge pull request #56848 from CaoShuFeng/duplicated-validation-psp
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>.

remove duplicated validation from podsecuritypolicy

**Release note**:
```release-note
NONE
```
2018-03-26 00:13:08 -07:00
Kubernetes Submit Queue e40ffd7197
Merge pull request #59172 from fisherxu/removeyear
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>.

Remove YEAR field of all generated files and fix kubernetes boilerplate checker

**What this PR does / why we need it**:
Remove YEAR field of all generated files and fix kubernetes boilerplate checker
xref: [remove YEAR fileds in gengo #91](https://github.com/kubernetes/gengo/pull/91)

**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 [#gengo/issues/24](https://github.com/kubernetes/gengo/issues/24)

**Special notes for your reviewer**:
/cc @thockin @lavalamp @sttts 

**Release note**:

```release-note
NONE
```
2018-03-21 12:44:37 -07:00
Kubernetes Submit Queue 622ad35677
Merge pull request #61115 from php-coder/psp_fix_provider_error_msgs
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>.

PSP: fix strategy name in the error messages

**What this PR does / why we need it**:
This PR corrects strategy names in the error messages.
2018-03-21 04:37:58 -07:00
Kubernetes Submit Queue ca56628912
Merge pull request #60710 from NickrenREN/admission-pv-dir-change
Automatic merge from submit-queue (batch tested with PRs 60710, 60855, 60873, 60895, 60862). 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 `persistentvolume` into `storage` package under `plugin/pkg/admission` 

Sorry for omitting this in the previous PR #60367

**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)*:
Following #60367

**Special notes for your reviewer**:

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

/assign @jsafrane @thockin
2018-03-20 10:34:33 -07:00
Kubernetes Submit Queue c64f19dd1b
Merge pull request #59728 from wgliang/master.append
Automatic merge from submit-queue (batch tested with PRs 59740, 59728, 60080, 60086, 58714). 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>.

more concise to merge the slice

**What this PR does / why we need it**:
more concise to merge the slice

**Special notes for your reviewer**:
2018-03-19 21:34:30 -07:00
Kubernetes Submit Queue 8c2e1cca6b
Merge pull request #59740 from hzxuzhonghu/defaulttoleration-admission
Automatic merge from submit-queue (batch tested with PRs 59740, 59728, 60080, 60086, 58714). 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>.

optimize DefaultTolerationSeconds admission controller

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

As `DefaultTolerationSeconds ` will be enabled by default, so this improves its performance.


**Release note**:

```release-note
NONE
```
2018-03-19 21:34:26 -07:00
Cao Shufeng e87c2c9f27 Log rbac info into advanced audit event 2018-03-19 08:37:53 +08:00
Slava Semushin cee37f2f72 Fix strategy name in the error messages. 2018-03-13 16:21:43 +01:00
fisherxu b49ef6531c regenerated all files and remove all YEAR fields 2018-03-08 17:52:48 +08:00
Bobby (Babak) Salamat 9592a9ecf4 Allow system critical priority classes in API validation 2018-03-06 10:06:58 -08:00
Bobby (Babak) Salamat 515ba9e8d4 autogenerated files 2018-03-06 10:06:58 -08:00
NickrenREN fc78e5ce9e fix references and golint failures 2018-03-03 13:12:03 +08:00
Kazuki Suda 0b96762f1b Update bootstrap policy fixture data 2018-03-03 12:56:10 +09:00
Bobby (Babak) Salamat ebda9584f9 Auto-create system critical prioity classes at API server startup 2018-03-02 16:50:07 -08:00
NickrenREN 808ae60943 move persistentvolume to storage package 2018-03-01 17:26:07 +08:00
Kubernetes Submit Queue 513e67ac02
Merge pull request #55019 from mikedanese/svcacct
Automatic merge from submit-queue (batch tested with PRs 59365, 60446, 60448, 55019, 60431). 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>.

auth: allow nodes to create tokens for svcaccts of pods

ref https://github.com/kubernetes/kubernetes/issues/58790

running on them. nodes essentially have the power to do this today
but not explicitly. this allows agents using the node identity to
take actions on behalf of local pods.

@kubernetes/sig-auth-pr-reviews @smarterclayton 

```release-note
The node authorizer now allows nodes to request service account tokens for the service accounts of pods running on them.
```
2018-02-27 10:50:46 -08:00
Kubernetes Submit Queue 1eb1c00c44
Merge pull request #59674 from jennybuckley/codegen
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>.

code-gen: output golint compliant 'Generated by' comment

New PR instead of reopening #58115 because /reopen did not work.
This won't be ready to merge until the upstream https://github.com/kubernetes/gengo/pull/94 merges. Once that merges, the second commit will be changed to godep-save.sh and update-staging-godeps.sh, and the last commit will be changed to update-all.sh

The failing test is due to the upstream changes not being merged yet

```devel-release-note
Go code generated by the code generators will now have a comment which allows them to be easily identified by golint
```

Fixes #56489
2018-02-27 02:47:05 -08:00
Kubernetes Submit Queue e30b6634c3
Merge pull request #60367 from NickrenREN/admission-sc-dir-change
Automatic merge from submit-queue (batch tested with PRs 60011, 59256, 59293, 60328, 60367). 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 `storageclass` into  `storage` package under `plugin/pkg/admission`

We have two directories `storage` and `storageclass` under package `plugin/pkg/admission` and one subdir `storageobjectinuseprotection` of `storage` now.
- 1. Move `storageclass` into  `storage` being  `storage`'s sub-package since storageclass is one of the storage objects
- 2. fix golint failures

**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-02-26 23:47:59 -08:00
Kubernetes Submit Queue d6153194d9
Merge pull request #59293 from roycaihw/openapi_endpoint
Automatic merge from submit-queue (batch tested with PRs 60011, 59256, 59293, 60328, 60367). 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>.

Serve OpenAPI spec with single /openapi/v2 endpoint

**What this PR does / why we need it**:
We are deprecating format-separated endpoints (`/swagger.json`, `/swagger-2.0.0.json`, `/swagger-2.0.0.pb-v1`, `/swagger-2.0.0.pb-v1.gz`) for OpenAPI spec, and switching to a single `/openapi/v2` endpoint in Kubernetes 1.10. The design doc and deprecation process are tracked at: https://docs.google.com/document/d/19lEqE9lc4yHJ3WJAJxS_G7TcORIJXGHyq3wpwcH28nU

Requested format is specified by setting HTTP headers

header | possible values
-- | --
Accept | `application/json`, `application/com.github.proto-openapi.spec.v2@v1.0+protobuf`
Accept-Encoding | `gzip`

This PR changes dynamic_client (and kubectl as a result) to use the new endpoint. The old endpoints will remain in 1.10 and 1.11, and get removed in 1.12. 

**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
action required: Deprecate format-separated endpoints for OpenAPI spec. Please use single `/openapi/v2` endpoint instead.
```

/sig api-machinery
2018-02-26 23:47:53 -08:00
jennybuckley c8dacd8e63 Run hack/update-all.sh 2018-02-26 17:16:14 -08:00
Mike Danese 363e861aeb rbac: allow system:node role to make TokenRequests for all service accounts 2018-02-26 13:46:19 -08:00
Mike Danese b43cd7307d noderestriction: restrict nodes TokenRequest permission
nodes should only be able to create TokenRequests if:
* token is bound to a pod
* binding has uid and name
* the pod exists
* the pod is running on that node
2018-02-26 13:46:19 -08:00
Mike Danese 2cc75f0a5a auth: allow nodes to create tokones for svcaccts of pods
running on them.
2018-02-26 13:46:19 -08:00
wackxu 97e5c0a3e4 remove default priority cache in Priority admission controller 2018-02-26 11:51:45 +08:00
wackxu a92d892f6b remove deprecated initresource admission plugin 2018-02-26 11:39:45 +08:00
Kubernetes Submit Queue f351d8cddb
Merge pull request #59082 from WanLinghao/package_name_fix
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 package name error

1.priority admission file got wrong package name
2.PriorityPlugin struct should not be public as well as its construct function. 
this patch fix this.



**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-02-25 19:28:10 -08:00
WanLinghao 74fdccc629 fix package name error
modified:   plugin/pkg/admission/priority/admission.go
	modified:   plugin/pkg/admission/priority/admission_test.go
2018-02-26 09:17:36 +08:00
Kubernetes Submit Queue 7499328f39
Merge pull request #59723 from fancyuan/patch-2
Automatic merge from submit-queue (batch tested with PRs 59723, 60379, 60329). 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, this let's -> this lets

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

**Release note**:
```release-note
NONE
```
2018-02-25 00:52:30 -08:00
Kubernetes Submit Queue 8e8601a1cb
Merge pull request #60118 from sbezverk/csi_core_credentials
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>.

Adding credentials support for k8s core CSI  

PR implements changes proposed in: https://github.com/kubernetes/community/pull/1816

```release-note
CSI now allows credentials to be specified on CreateVolume/DeleteVolume, ControllerPublishVolume/ControllerUnpublishVolume, and NodePublishVolume/NodeUnpublishVolume operations
```
2018-02-24 12:36:11 -08:00
NickrenREN cb34a2ca68 fix references 2018-02-24 19:16:51 +08:00
NickrenREN 9d20ea07f5 move storageclass/setdefault into pkg/admission/storage 2018-02-24 16:46:05 +08:00
Serguei Bezverkhi a6ca466859 k8s csi code change 2018-02-23 16:50:43 -05:00
Kubernetes Submit Queue 755ab974e1
Merge pull request #58835 from ravisantoshgudimetla/critical-pod-with-priority
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>.

Critical pod priorityClass addition

**What this PR does / why we need it**:
@bsalamat - Apologies for the delay. This PR is to ensure that all pods with priorityClassName `system-node-critical` and `system-cluster-critical` will be critical pods while preserving backwards compatibility.

**Special notes for your reviewer**:

- Moved some constants and other data structures to scheduler/api/types.go where other constants are present.
- An automatic assignment of critical priorities to pods based on critical pod annotation for backwards compatibility including some unit tests. 
xref:  https://github.com/kubernetes/kubernetes/issues/57471 

**Release note**:

```release-note
Critical pods to use priorityClasses.
```
2018-02-23 11:22:31 -08:00
Slava Semushin 88ae9479d9 Run hack/update-bazel.sh 2018-02-22 19:23:02 +01:00
Slava Semushin 3d4fa8a189 Modify PodSecurityPolicy admission plugin to additionally allow authorizing via "use" verb in policy API group. 2018-02-22 19:23:02 +01:00
Eric Chiang ddefff0c69 podtolerationrestriction: fix informer race in test 2018-02-22 09:28:46 -08:00
ravisantoshgudimetla 7da5a2e4dd Build files generated 2018-02-21 20:53:25 -05:00
ravisantoshgudimetla 68c20ad770 Critical pods priorityClass addition 2018-02-21 20:53:21 -05:00
Kubernetes Submit Queue 34167ded15
Merge pull request #59949 from nicksardo/deprecate-cloud-provider
Automatic merge from submit-queue (batch tested with PRs 59052, 59157, 59428, 59949, 60151). 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>.

Start deprecation of role for `cloud-provider` service account in rbac boostrap

**What this PR does / why we need it**:
See #59686 for reference

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

**Release note**:
```release-note
Action Required: The boostrapped RBAC role and rolebinding for the `cloud-provider` service account is now deprecated. If you're currently using this service account, you must create and apply your own RBAC policy for new clusters.
```
2018-02-21 16:55:41 -08:00
Kubernetes Submit Queue aa98917690
Merge pull request #59052 from pospispa/566-postpone-pvc-deletion-if-used-in-a-pod-bring-to-beta
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>.

Bring PVC Protection feature to Beta

**What this PR does / why we need it**:
Brings PVC Protection feature to Beta.

**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 # N/A

**Special notes for your reviewer**:
xref https://github.com/kubernetes/features/issues/498

**Release note**:

```release-note
PVC Protection alpha feature was renamed to Storage Protection. Storage Protection feature is beta.
```
2018-02-21 16:14:54 -08:00
Kubernetes Submit Queue 2a604f6358
Merge pull request #59991 from bsalamat/default_pc
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>.

Pick the PriorityClass with the lowest value of priority in case more than one global default exists

**What this PR does / why we need it**:
Please see the referenced 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 #59987

**Special notes for your reviewer**:

**Release note**:

```release-note
Priority admission controller picks a global default with the lowest priority value if more than one such default PriorityClass exists.
```

/sig scheduling
cc/ @liggitt
2018-02-21 13:52:00 -08:00
pospispa 19432d212a StorageProtection Brought to Beta in 1.10 Release
PVCProtection feature was renamed to Storage Protection in:
https://github.com/kubernetes/kubernetes/pull/58743
That's why it's renamed when brought into beta.

In addition, StorageProtection feature is brought into beta in 1.10 release.
2018-02-21 16:05:43 +01:00
NickrenREN dad0fa07b7 rename StorageProtection to StorageObjectInUseProtection 2018-02-21 10:48:56 +08:00
Kubernetes Submit Queue 6ba46963f8
Merge pull request #59391 from msau42/topology-beta
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 volume scheduling and local storage to beta

**What this PR does / why we need it**:
* Move the feature gates and APIs for volume scheduling and local storage to beta
* Update tests to use the beta fields
@kubernetes/sig-storage-pr-reviews 

**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 #59390

**Special notes for your reviewer**:

**Release note**:

```release-note
ACTION REQUIRED: VolumeScheduling and LocalPersistentVolume features are beta and enabled by default.  The PersistentVolume NodeAffinity alpha annotation is deprecated and will be removed in a future release.
```
2018-02-20 13:26:07 -08:00
Haowei Cai 2eb3d046ce Add new openapi endpoint in aggregator server 2018-02-20 09:27:35 -08:00
Michelle Au dc1e871828 Add new volume-scheduler cluster role to scheduler 2018-02-16 17:54:10 -08:00
Bobby (Babak) Salamat 6b292822f5 Pick the PriorityClass with the lowest value of priority in case more than one global default exists 2018-02-16 16:59:09 -08:00
Jeff Grafton ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
Nick Sardo 657794eda3 Add deprecation notices 2018-02-15 14:35:49 -08:00
wackxu 9342eff20d rename func ValidatePodSecurityContext to ValidatePod 2018-02-14 10:55:50 +08:00
hzxuzhonghu 82225fd952 optimize DefaultTolerationSeconds admission controller 2018-02-13 11:35:43 +08:00
fancyuan cb91aabba9 fix typo, this let's us -> this lets us
fix typo
2018-02-12 10:53:44 +08:00
Wang Guoliang 31aad75316 more concise to merge the array 2018-02-11 21:27:11 +08:00
Kubernetes Submit Queue 317853c90c
Merge pull request #59464 from dixudx/fix_all_typos
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 all the typos across the project

**What this PR does / why we need it**:
There are lots of typos across the project. We should avoid small PRs on fixing those annoying typos, which is time-consuming and low efficient.

This PR does fix all the typos across the project currently. And with #59463, typos could be avoided when a new PR gets merged.

**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**:
/sig testing
/area test-infra
/sig release
/cc @ixdy 
/assign @fejta 

**Release note**:

```release-note
None
```
2018-02-10 22:12:45 -08:00
Di Xu 48388fec7e fix all the typos across the project 2018-02-11 11:04:14 +08:00
Bobby (Babak) Salamat 6bad08ab0c Moved validation to the API side 2018-02-07 17:46:57 -08:00
Bobby (Babak) Salamat 1016d2d16a Disallow PriorityClass names with 'system-' prefix for user defined priority classes 2018-02-07 11:19:46 -08:00
Kubernetes Submit Queue c17b418f89
Merge pull request #59454 from tanshanshan/fix-small
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>.

simplify if logic

**What this PR does / why we need it**:
simplify if logic ,make it more clear
Thanks.
**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**:

**Release note**:

```release-note

```
2018-02-07 06:26:02 -08:00
tanshanshan 76471eef36 simplify the if logic 2018-02-07 11:04:33 +08:00
Mike Danese e3c5a73f02 certs: allow cert controller to delete csrs
This should have been changed as part of #51840.
2018-02-05 14:24:42 -08:00
Kubernetes Submit Queue ffda1e2200
Merge pull request #57017 from andyzhangx/azurefile-growsize
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>.

add PV size grow feature for azure file

**What this PR does / why we need it**:
According to kubernetes/features#284, add size grow feature for azure file

**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 #56462 

**Special notes for your reviewer**:
Since azure file is using SMB 3.0 protocal, there is no necessary to resize filesystem on agent side, the agent node will detect the changed size automatically.

**Release note**:

```
add size grow feature for azure file
```
/sig azure
@gnufied @rootfs @brendandburns
2018-02-05 11:25:48 -08:00
Cao Shufeng f95bc9289d fix assert.Equal argument order
Reference:
https://godoc.org/github.com/stretchr/testify/assert#Equal
2018-02-04 15:14:55 +08:00
Kubernetes Submit Queue d3b783d5ec
Merge pull request #58743 from NickrenREN/pv-protection
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>.

Postpone PV deletion with finalizer when it is being used

Postpone PV deletion if it is bound to a PVC

xref: https://github.com/kubernetes/community/pull/1608


**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 #33355

**Special notes for your reviewer**:

**Release note**:
```release-note
Postpone PV deletion when it is being bound to a PVC
```

WIP, assign to myself first

/assign @NickrenREN
2018-02-01 19:39:52 -08:00
NickrenREN 4b6a3439a3 Add policy for pv protection controller 2018-01-31 20:19:09 +08:00
NickrenREN cbfa0cc85a reuse PVC protection admission plugin for PV protection 2018-01-31 20:02:01 +08:00
NickrenREN 2a2f88b939 Rename PVCProtection feature gate so that PV protection can share the feature gate with PVC protection 2018-01-31 20:02:01 +08:00
NickrenREN 7b9d2c046f Use v1beta1 VolumeAttachment 2018-01-31 18:46:11 +08:00
andyzhangx fc988d429b initial work for azure file grow size implementation
enable azure file grow size

fix according to comments

fix comments

fix review comments

fix comments
2018-01-30 13:36:29 +00:00
Kubernetes Submit Queue 462d9f223e
Merge pull request #58485 from k82cn/k8s_58471
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>.

Updated priority of mirror pod by PriorityClass.

Signed-off-by: Da K. Ma <madaxa@cn.ibm.com>

**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 #58471 

**Release note**:
```release-note
Updated priority of mirror pod according to PriorityClassName.
```
2018-01-26 12:23:00 -08:00
Kubernetes Submit Queue 26c1a3a8ee
Merge pull request #58595 from CaoShuFeng/LimitPodHardAntiAffinityTopology
Automatic merge from submit-queue (batch tested with PRs 58595, 58689). 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 invalid admission name LimitPodHardAntiAffinityTopology

@hzxuzhonghu 
@sttts 

**Release note**:

```release-note
NONE
```
2018-01-23 09:18:30 -08:00
Kubernetes Submit Queue 2b0c7e2372
Merge pull request #57149 from deads2k/rebase-02-quota
Automatic merge from submit-queue (batch tested with PRs 58144, 57149). 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 quota reusable

Quota is logically a re-useable component so that replenishment and admission can be done in constituent servers.  This makes it possible to embed.  More cleanup is probably required, but this is the minimum.
2018-01-22 19:02:29 -08:00
Cao Shufeng 2a15776b41 fix invalid admission name LimitPodHardAntiAffinityTopology 2018-01-23 10:28:30 +08:00
Da K. Ma a7c62eec8f Updated priority of mirror pod by PriorityClass.
Signed-off-by: Da K. Ma <madaxa@cn.ibm.com>
2018-01-22 10:30:23 +08:00
zouyee eedf638072 sync code from copy destination 2018-01-20 14:38:16 +08:00
Jordan Liggitt b4fb25261e
return reason for allowed rbac authorizations
includes the binding, role, and subject that allowed a request so audit can make use of it
2018-01-19 14:32:39 -05:00
hzxuzhonghu 5c9e020d7d run update bazel 2018-01-19 13:18:27 +08:00
hzxuzhonghu 7c5f9e0bba refactor admission flag: add two admission flags and make plugins auto in recommended order 2018-01-19 13:16:36 +08:00
Kubernetes Submit Queue 621f3f3c0a
Merge pull request #58360 from liggitt/csi-node-authorizer
Automatic merge from submit-queue (batch tested with PRs 58488, 58360). 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>.

Add get volumeattachment to the node authorizer

Fixes #58355

Adds `get volumeattachment` authorization for nodes to the node authorizer when the CSI feature is enabled

```release-note
NONE
```
2018-01-18 20:55:34 -08:00
Kubernetes Submit Queue 48f69ac964
Merge pull request #55595 from guangxuli/move_token_constant_and_helper
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>.

Add generic Bootstrap Token constants and helpers to client-go

**What this PR does / why we need it**:
per https://github.com/kubernetes/client-go/issues/114

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

fix  https://github.com/kubernetes/client-go/issues/114

**Special notes for your reviewer**:

**Release note**:

```release-note
none
```
2018-01-17 10:22:25 -08:00
Gavin f653d02b05 create auto-gen files 2018-01-17 16:23:03 +08:00
Gavin bb5e156aba Add generic Bootstrap Token constants and helpers to client-go 2018-01-17 16:22:37 +08:00
Jordan Liggitt ecfd18e2a6
Add get volumeattachments support to Node authorizer 2018-01-17 00:00:18 -05:00
Cao Shufeng 4e7398b67b remove duplicated import 2018-01-17 09:34:59 +08:00
Dr. Stefan Schimanski 1a552bbe14 admission: do not leak admission config types outside of the plugins 2018-01-15 14:37:41 +01:00
Jonathan Basseri 85c5862552 Fix scheduler refs in BUILD files.
Update references to moved scheduler code.
2018-01-05 15:05:01 -08:00
Jonathan Basseri 30b89d830b Move scheduler code out of plugin directory.
This moves plugin/pkg/scheduler to pkg/scheduler and
plugin/cmd/kube-scheduler to cmd/kube-scheduler.

Bulk of the work was done with gomvpkg, except for kube-scheduler main
package.
2018-01-05 15:05:01 -08:00
Kubernetes Submit Queue e991a94d2d
Merge pull request #54983 from chentao1596/admission-priorityclass-error-check
Automatic merge from submit-queue (batch tested with PRs 57021, 56843, 54983). 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>.

 Optimizing the implementation of the error check for PriorityClass

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

When i create pod(on the bottom) with not exist PriorityClass, the output will be shown as follow:
```
# kubectl apply -f priorityclassname-pod.yaml 
Error from server: error when creating "priorityclassname-pod.yaml": failed to get default priority class not-exist-priorityclassname: priorityclass.scheduling.k8s.io "not-exist-priorityclassname" not found
```

In my eyes, "get default priority class" is not the correct description, so i changed it. The new output will be shown like this:
```
# kubectl apply -f priorityclassname-pod.yaml 
Error from server (NotFound): error when creating "priorityclassname-pod.yaml": priorityclass.scheduling.k8s.io "not-exist-priorityclassname" not found
```

In addition, the 'pc' will never be nil when err is nil, i think this check is not neccessary, so i removed it.

thank you!

Pod template:
```
apiVersion: v1
kind: Pod
metadata:
  name: priorityclassname-pod           
  labels:
    env: priorityclassname-pod    
spec:
  containers:
  - name: was
    image: gcr.io/google_containers/busybox:v1.0
    imagePullPolicy: IfNotPresent
  priorityClassName: not-exist-priorityclassname
```
2018-01-04 14:40:49 -08:00
Kubernetes Submit Queue 5528dde2f0
Merge pull request #56843 from CaoShuFeng/podsecuritypolicy
Automatic merge from submit-queue (batch tested with PRs 57021, 56843, 54983). 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>.

[PSP] always check validated policy first for update operation

When update a pod with `kubernetes.io/psp` annotation set, we should
check this policy first. Because this saved policy is `usually` the
one we are looking for.


**Release note**:
```release-note
NONE
```
2018-01-04 14:40:46 -08:00
Kubernetes Submit Queue cb6b88ffc6
Merge pull request #56971 from derekwaynecarr/limit-range-ignore-terminating-pods
Automatic merge from submit-queue (batch tested with PRs 56971, 57570, 57830, 57742). 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>.

LimitRange ignores objects previously marked for deletion

**What this PR does / why we need it**:
A `LimitRange` added to a namespace after it has pods can prevent terminating pods from being deleted if they do not conform to the min/max criteria.

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

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

```release-note
NONE
```
2018-01-04 08:59:37 -08:00
Kubernetes Submit Queue 8971a516ed
Merge pull request #56317 from guangxuli/refactor_priority_CalculateAntiAffinityPriority
Automatic merge from submit-queue (batch tested with PRs 57696, 57821, 56317). 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>.

Change priority function(CalculateAntiAffinityPriority) into Map/Reduce pattern

**What this PR does / why we need it**:
Ref #24246. exactly ref https://github.com/kubernetes/kubernetes/issues/51455, the PR aim to unify priority functions(deprecated) by using map/reduce pattern. 
Previous related PR is https://github.com/kubernetes/kubernetes/pull/51192
**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**:

**Release note**:

```release-note
None
```
2018-01-04 03:22:42 -08:00
Kubernetes Submit Queue b57b253594
Merge pull request #57696 from apilloud/bloat
Automatic merge from submit-queue (batch tested with PRs 57696, 57821, 56317). 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 DefaultMaxEBSVolumes constant into scheduler

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

A constant only used by the scheduler lives in the aws cloudprovider package. Moving the constant into the only package where it is used reduces import bloat. Testing with the dockerized build environment, the kube-scheduler binary went from 61748499 bytes to 47339144 bytes on amd64 with this change.

**Release note**:

```release-note
NONE
```
2018-01-04 03:22:36 -08:00
Gavin 94d75929b6 refactor function CalculateAntiAffinityPriority by using map/reduce pattern 2018-01-04 16:03:34 +08:00
Kubernetes Submit Queue 46eabb7d91
Merge pull request #56534 from allenpetersen/updateGengo
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>.

Update gengo version to include goimports formatter

Update gengo which now uses goimports to format code and organize imports.

Fixes #55542

**Special notes for your reviewer**:
Updates version of k8s.io/gengo
Takes new dependency on golang.org/x/tools/imports and golang.org/x/tools/go/ast/astutil

**Release Notes**:
```release-note
NONE
```
2018-01-03 17:47:05 -08:00
Kubernetes Submit Queue 81b43401a9
Merge pull request #57128 from liggitt/kubelet-admin
Automatic merge from submit-queue (batch tested with PRs 57702, 57128). 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>.

Define default role for full kubelet API access

This makes sense to define uniformly so integrators can grant this to the `--kubelet-client-certificate` credential given to the apiserver. Mirrors the role GCE sets up.

```release-note
RBAC: The system:kubelet-api-admin cluster role can be used to grant full access to the kubelet API
```
2018-01-03 08:30:33 -08:00
Andrew Pilloud a57d492713 Move DefaultMaxEBSVolumes constant into scheduler
A constant only used by the scheduler lives in the aws cloudprovider
package. Moving the constant into the only package where it is used
reduces import bloat.
2018-01-03 08:19:38 -08:00
Allen Petersen 3d69cea1e5 Update generated files 2018-01-02 22:13:19 -08:00
Cao Shufeng 4b738a7b40 [PSP] always check validated policy first for update operation
When update a pod with `kubernetes.io/psp` annotation set, we should
check this policy first. Because this saved policy is `usually` the
one we are looking for.
2018-01-03 11:08:37 +08:00
chentao1596 dca1447f5f Optimizing the implementation of the error check for PriorityClass 2018-01-03 10:25:44 +08:00
Kubernetes Submit Queue 45a069a241
Merge pull request #56839 from hzxuzhonghu/exec-admission
Automatic merge from submit-queue (batch tested with PRs 57746, 57621, 56839, 57464). 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 pod securityContext hostNetwork in exec admission controller

**What this PR does / why we need it**:
currently only hostIPC hostPID are checked in DenyEscalatingExec admission controller,
hostNetwork should also be checked to deny exec /attach
**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 #56838

**Special notes for your reviewer**:

**Release note**:

```release-note
check psp HostNetwork in DenyEscalatingExec admission controller.
```
2018-01-02 15:26:44 -08:00
Kubernetes Submit Queue 89a38860f9
Merge pull request #57746 from ZhaokunQiu/master
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 typeos

**What this PR does / why we need it**:
fix typeos to make code more clear

**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**:

```
NONE

```
2018-01-02 14:55:57 -08:00
Kubernetes Submit Queue 014676fc4f
Merge pull request #57523 from jennybuckley/podtolerationrestriction-config
Automatic merge from submit-queue (batch tested with PRs 57651, 56411, 56779, 57523, 57624). 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>.

add podtolerationrestriction config to scheme

**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 #57522

Related to #57513
2018-01-02 14:09:48 -08:00
Kubernetes Submit Queue 65acc6d6a7
Merge pull request #57027 from CaoShuFeng/resourcequota_validation_pod
Automatic merge from submit-queue (batch tested with PRs 49856, 56257, 57027, 57695, 57432). 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 duplicated validation from pod's resourcequota admission

ResourceQuota is a validating admission plugin. Before it runs, pods
has already been validated. It's not necessary to validate it again.

**Release note**:
```release-note
NONE
```
2018-01-02 13:15:47 -08:00
qiu 9aca4057eb edit line138 2018-01-02 20:29:11 +08:00
Christoph Blecker 80e344644e
Regenerate all generated code 2018-01-02 00:21:07 -08:00
hzxuzhonghu 075e8dce00 fix local up cluster startup flag bug 2017-12-27 17:46:50 +08:00
Kubernetes Submit Queue 980a5e80b1
Merge pull request #57132 from zjj2wry/kube-schedule-initflag
Automatic merge from submit-queue (batch tested with PRs 55483, 57132). 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>.

enhance kube-schedule init flag

**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)*:
```
remove TODO: once we switch everything over to Cobra commands, we can go back to calling
utilflag.InitFlags() (by removing its pflag.Parse() call). 
For now, we have to set the normalize func and add the go flag set by hand.
```

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-12-25 10:53:28 -08:00
Kubernetes Submit Queue ff23474c12
Merge pull request #57502 from tanshanshan/scheduler-NominatedNode
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>.

Rename the annotation key for nominated pods to "scheduler.kubernetes.io/nominated-node-name"

**What this PR does / why we need it**:
Rename the annotation key for nominated pods to "scheduler.kubernetes.io/nominated-node-name"

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

part of #57471

**Special notes for your reviewer**:

**Release note**:

```release-note

```
2017-12-24 20:07:41 -08:00
Jeff Grafton 46e894bfd3 Switch go binaries from (hacky) static to pure Go 2017-12-23 13:13:09 -08:00
Jeff Grafton efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
Kubernetes Submit Queue 1f182ae147
Merge pull request #57513 from deads2k/admission-19-config
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>.

add eventratelimit config to scheme

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

Because the config types are decoded, their types have to be registered in the scheme used for admission config decoding.  Looks like we missed one.

@kubernetes/sig-api-machinery-bugs 
/assign jennybuckley
2017-12-22 19:12:19 -08:00
tanshanshan 6ac0f4198a rename key 2017-12-22 09:18:46 +08:00
Jonathan Basseri 732e785e0a Performance improvement for affinity term matching.
When a PodAffinityTerm uses TopologyKey=kubernetes.io/hostname, we can
avoid searching the entire cluster for a match by only listing pods on
the given node.
2017-12-21 16:01:22 -08:00
Kubernetes Submit Queue d7e5bd194a
Merge pull request #57477 from misterikkit/noStrCat
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>.

Avoid string concatenation when comparing pods.

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

Pod comparison in (*NodeInfo).Filter was using GetPodFullName before
comparing pod names. This is a concatenation of pod name and pod
namespace, and it is significantly faster to compare name & namespace
instead.

This is a set of 3 PRs targeting affinity predicate performance. (#57476, #57477, #57478) The key takeaway is approximately 2x speedup in the large affinity benchmark.

The unexpected increase in BenchmarkScheduling/1000Nodes/1000Pods seems to be an outlier, and did not recur on subsequent runs. The benchmarks have a moderate amount of variance to them, and I did not run them enough times to measure mean and standard deviation.

| test | b.N | master | #57476 | #57477 | #57478 | combined |
| ---- | --- | ------ | ------ | ---------- | ---------- | -------- |
| BenchmarkScheduling/100Nodes/0Pods                | 100 |  39629010 ns/op | 36898566 ns/op (-6.89%)   |  38461530 ns/op (-2.95%)  |  36214136 ns/op (-8.62%)  |  43090781 ns/op (+8.74%)  |
| BenchmarkScheduling/100Nodes/1000Pods             | 100 |  85489577 ns/op | 69538016 ns/op (-18.66%)  |  70104254 ns/op (-18.00%) |  75015585 ns/op (-12.25%) |  80986960 ns/op (-5.27%)  |
| BenchmarkScheduling/1000Nodes/0Pods               | 100 | 219356660 ns/op | 200149051 ns/op (-8.76%)  | 192867469 ns/op (-12.08%) | 196896770 ns/op (-10.24%) | 212563662 ns/op (-3.10%)  |
| BenchmarkScheduling/1000Nodes/1000Pods            | 100 | 380368238 ns/op | 381786369 ns/op (+0.37%)  | 387224973 ns/op (+1.80%)  | 417974358 ns/op (+9.89%)  | 411140230 ns/op (+8.09%)  |
| BenchmarkSchedulingAntiAffinity/500Nodes/250Pods  | 250 | 124399176 ns/op | 97568988 ns/op (-21.57%)  | 112027363 ns/op (-9.95%)  | 129134326 ns/op (+3.81%)  |  98607941 ns/op (-20.73%) |
| BenchmarkSchedulingAntiAffinity/500Nodes/5000Pods | 250 | 491677096 ns/op | 441562422 ns/op (-10.19%) | 278127757 ns/op (-43.43%) | 447355609 ns/op (-9.01%)  | 226310721 ns/op (-53.97%) |

Combined performance contains all three patches.
Percentages are relative to master.

Methodology:

I ran the tests on each branch with this command.
```
make test-integration WHAT="./test/integration/scheduler_perf" KUBE_TEST_ARGS="-run=xxxx -bench=."
```

The benchmarks have a fair amount of variance to them, and I did not run them enough times to measure mean and standard deviation.

**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 #

The three PRs in this set should collectively fix #54189.

**Special notes for your reviewer**:

**Release note**:

```release-note
Improve scheduler performance of MatchInterPodAffinity predicate.
```
2017-12-21 15:18:55 -08:00
jennybuckley d0f262444f add podtolerationrestriction config to scheme 2017-12-21 11:10:05 -08:00
Jonathan Basseri 3909dc1341 Avoid array growth in FilteredList.
The method (*schedulerCache).FilteredList builds an array of *v1.Pod
that contains every pod in the cluster except for those filtered out by
a predicate. Today, it starts with a nil slice and appends to it.

Based on current usage, FilteredList is expected to return every pod in
the cluster or omit some pods from a single node. This change reserves
array capacity equal to the total number of pods in the cluster.
2017-12-21 10:50:04 -08:00
Jonathan Basseri 7b3638ea77 Avoid string concatenation when comparing pods.
Pod comparison in (*NodeInfo).Filter was using GetPodFullName before
comparing pod names. This is a concatenation of pod name and pod
namespace, and it is significantly faster to compare name & namespace
instead.
2017-12-21 09:31:53 -08:00
David Eads 5e966af1d0 add eventratelimit config to scheme 2017-12-21 08:09:55 -05:00
Kubernetes Submit Queue 754bb1350f
Merge pull request #55442 from anfernee/priority_resource
Automatic merge from submit-queue (batch tested with PRs 57257, 55442). 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>.

Merge 3 resource allocation priority functions

**What this PR does / why we need it**: those 3 priority functions are closed related, and share a lot of the same logic, put them together.

**Release note**:
```release-note
None
```
2017-12-20 23:56:49 -08:00
Yongkun Anfernee Gui c65225ee19 Merge 3 resource allocation priority functions 2017-12-20 17:21:22 -08:00
Kubernetes Submit Queue c13a2abaf3
Merge pull request #57368 from brendandburns/version
Automatic merge from submit-queue (batch tested with PRs 57349, 57368). 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>.

Add '/version/' to the system:discovery role, since that's what the spec says.

See: https://github.com/kubernetes-client/java/issues/153

```release-note
Add the path '/version/' to the `system:discovery` cluster role.
```
2017-12-20 14:53:38 -08:00
Brendan Burns 20bb9edff4
Update cluster-roles.yaml 2017-12-20 10:44:55 -08:00
Brendan Burns 519d0cde7b
Update policy.go 2017-12-20 10:44:07 -08:00
Kubernetes Submit Queue 51fbd6e637
Merge pull request #57168 from yastij/predicates-ordering
Automatic merge from submit-queue (batch tested with PRs 57252, 57168). 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>.

Implementing predicates ordering

**What this PR does / why we need it**: implements predicates ordering for the scheduler

**Which issue(s) this PR fixes** : Fixes #53812 

**Special notes for your reviewer**:


@bsalamat @gmarek @resouer as discussed on slack, to implement ordering we have to choices:

- use a layered approach with a list that indexes the order of the predicates map

- change the underlying data structure used to represent a collection of predicates (a map in our case) into a list of predicates objects. 
Going with this solution might be "cleaner" but it will require a lot of changes and will increase the cost for accessing predicates from O(1) to O(n) (n being the number of predicates used by the scheduler).

we might go with this solution for now. If the number of predicates start growing, we might switch to the second option.
 
**Release note**:

```release-note
adding predicates ordering for the kubernetes scheduler.
```
2017-12-20 07:48:35 -08:00
Yassine TIJANI e62952d02b using consts to refer to predicate names 2017-12-20 13:21:20 +00:00
Brendan Burns ec53238901 Add '/version/*' to the system:discovery role, since that's what the open
api spec says.
2017-12-19 21:47:20 -08:00
Kubernetes Submit Queue 60e7727cb8
Merge pull request #57348 from tallclair/psp-owners
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>.

Add PodSecurityPolicy OWNERS

Make myself an approver of PodSecurityPolicy, and also add a couple reviewers.

```release-note
NONE
```
2017-12-18 13:29:51 -08:00
Kubernetes Submit Queue b6b1762a80
Merge pull request #56349 from php-coder/simplify_admission_test
Automatic merge from submit-queue (batch tested with PRs 56947, 56349, 57140, 53686, 57314). 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>.

 admission_test.go(TestAdmitPreferNonmutating): simplify test

**What this PR does / why we need it**:
This PR simplifies `TestAdmitPreferNonmutating` test by inlining members that have a constant values.

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

PTAL @liggitt @tallclair 
CC @simo5
2017-12-18 12:24:38 -08:00
Tim Allclair f65b709794
Add PodSecurityPolicy OWNERS 2017-12-18 11:47:05 -08:00
Yassine TIJANI ecba504974 implementing predicates ordering 2017-12-18 17:44:24 +00:00
Kubernetes Submit Queue 665e8b2d65
Merge pull request #56375 from CaoShuFeng/glogV10
Automatic merge from submit-queue (batch tested with PRs 56375, 56872, 57053, 57165, 57218). 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 extra level check of glog

**Release note**:
```release-note
NONE
```
2017-12-17 05:33:38 -08:00
Kubernetes Submit Queue 7a23bbb024
Merge pull request #57177 from liggitt/rbac-log
Automatic merge from submit-queue (batch tested with PRs 56386, 57204, 55692, 57107, 57177). 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>.

Raise RBAC DENY log level

Fixes #46877 
Fixes https://github.com/kubernetes/kubernetes/issues/55821

Can still be logged verbosely with `--vmodule=rbac*=5` if desired

```release-note
NONE
```
2017-12-17 04:19:47 -08:00
Kubernetes Submit Queue 7f87337b8b
Merge pull request #56650 from danwinship/networkpolicy-rbac
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>.

Add RBAC policies for NetworkPolicy

**What this PR does / why we need it**:
When using RBAC, none of the namespace-level roles currently have permission to do anything with NetworkPolicy. (Only cluster-admin does, by virtue of having permission on "*".) This fixes it so "admin" and "edit" have read/write permission, and "view" has read-only permission.

I added permission for both the extensions and networking objects, which I believe is correct as long as both of them exist?

(This would be nice to fix in 1.9, although it's not a regression. It's always been broken.)

**Release note**:
```release-note
When using Role-Based Access Control, the "admin", "edit", and "view" roles now have the expected permissions on NetworkPolicy resources.
```
2017-12-16 12:09:11 -08:00
Kubernetes Submit Queue 203078538a
Merge pull request #56792 from denverdino/fix-typo-in-algorithmprovider-defaults
Automatic merge from submit-queue (batch tested with PRs 56250, 56809, 56812, 56792, 56724). 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

Signed-off-by: Li Yi <denverdino@gmail.com>

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

Fix the typo in /plugin/pkg/scheduler/algorithmprovider/defaults.go
2017-12-16 07:46:46 -08:00
Kubernetes Submit Queue 54591dd181
Merge pull request #56707 from brunomcustodio/kube-scheduler-config-file-warning
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 wording in kube-scheduler warning

**Release note**:
```release-note
NONE
```
2017-12-16 04:58:24 -08:00
Kubernetes Submit Queue a99fdfc680
Merge pull request #56480 from CaoShuFeng/schedule_queue
Automatic merge from submit-queue (batch tested with PRs 56480, 56675, 56624, 56648, 56658). 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 scheduling queue unit test

This change makes sure the Pop() test finish completely.

**Release note**:
```release-note
NONE
```
2017-12-16 03:24:40 -08:00
Kubernetes Submit Queue f5fa99cc82
Merge pull request #56549 from CaoShuFeng/thread_safe
Automatic merge from submit-queue (batch tested with PRs 56579, 55236, 56512, 56549, 56538). 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>.

Heap is not thread safe in scheduling queue

/cc @bsalamat 

**Release note**:
```release-note
NONE
```
2017-12-15 21:19:42 -08:00
Kubernetes Submit Queue d9b45d08c0
Merge pull request #56460 from liggitt/flex-pv-secret
Automatic merge from submit-queue (batch tested with PRs 56413, 56322, 56490, 56460, 56487). 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>.

Allow FlexVolume PV secret namespaces

Completes the secret namespace PV refactor, so all PV volume sources that specify secrets can reference them outside the PVC namespace.

Finished the secret-related aspect of https://github.com/kubernetes/kubernetes/issues/32131

```release-note
PersistentVolume flexVolume sources can now reference secrets in a namespace other than the PersistentVolumeClaim's namespace.
```
2017-12-15 16:43:55 -08:00
Kubernetes Submit Queue 40ad5d02f8
Merge pull request #56322 from guangxuli/priority_map_performance
Automatic merge from submit-queue (batch tested with PRs 56413, 56322, 56490, 56460, 56487). 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>.

Put process of getting pod controller reference into metadata

**What this PR does / why we need it**:
We should extract our common process/data into metadata just as other map priority functions do, so we could avoid getting same required data repeatedly in every node map process.

**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**:

**Release note**:

```release-note
None
```
2017-12-15 16:43:50 -08:00
Kubernetes Submit Queue 68c857e207
Merge pull request #55957 from jsafrane/protection-predicate
Automatic merge from submit-queue (batch tested with PRs 57211, 56150, 56368, 56271, 55957). 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>.

Skip pods that refer to PVCs that are being deleted

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

New check was added to `Schedule()` to make sure that a scheduled pod refers to existing PVCs that are not being deleted.

In 1.9 we plan to add a new feature that uses finalizers on PVC to protect PVCs that are used by a running pod from being deleted. This finalizer will be removed when all pods that use a PVC are finished or deleted. See https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/postpone-pvc-deletion-if-used-in-a-pod.md for details.

I needed to pass `pvcLister` to `GenericScheduler`.

UX:

```
$ kubectl describe pod
...
  Type     Reason            Age              From               Message
  ----     ------            ----             ----               -------
  Warning  FailedScheduling  5s (x4 over 8s)  default-scheduler  persistentvolumeclaim "myclaim" is being deleted
  Warning  FailedScheduling  1s (x2 over 1s)  default-scheduler  persistentvolumeclaim "myclaim" not found

```


**Release note**:

```release-note
Scheduler skips pods that use a PVC that either does not exist or is being deleted.
```

/sig scheduling
/kind feature
2017-12-15 14:00:49 -08:00
Kubernetes Submit Queue 588c1e970a
Merge pull request #56271 from tanshanshan/fix-little-scheduler
Automatic merge from submit-queue (batch tested with PRs 57211, 56150, 56368, 56271, 55957). 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>.

Put variable declared in the front.

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

put variable declared in the front.

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

```
2017-12-15 14:00:47 -08:00
Kubernetes Submit Queue e2e5f2339b
Merge pull request #55853 from guangxuli/fix_scheduler_test
Automatic merge from submit-queue (batch tested with PRs 56308, 54304, 56364, 56388, 55853). 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>.

httptest server should be close since Close issue has been fixed

**What this PR does / why we need it**:
per https://github.com/kubernetes/kubernetes/issues/19254, the issue seem to be fix for a long time and `server.Close` is no longer a issue in current related golang version, so it's time to uncomment the server.Close(). 

**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**:

**Release note**:

```release-note
None
```
2017-12-15 02:04:45 -08:00
Kubernetes Submit Queue 59bf6fed73
Merge pull request #56388 from CaoShuFeng/failureDomain
Automatic merge from submit-queue (batch tested with PRs 56308, 54304, 56364, 56388, 55853). 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>.

clean up failure domain from InterPodAffinityPriority

**Release note**:
```release-note
NONE
```
2017-12-15 02:04:42 -08:00
Kubernetes Submit Queue 45f983144f
Merge pull request #55504 from php-coder/cleanup_create_sc
Automatic merge from submit-queue (batch tested with PRs 55557, 55504, 56269, 55604, 56202). 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>.

Create{Container,Pod}SecurityContext: modify a pod and don't return the annotations

**What this PR does / why we need it**:
Prior https://github.com/kubernetes/kubernetes/pull/52849 we couldn't modify a pod and had to return annotations from the methods. But now, as we always working with a copy of a pod, we can modify it directly and we don't need to copy&return annotations separately.

This PR simplifies the code by modifying a pod directly. Also it renames these methods and replaces returning of the `SecurityContext` by in-place modification.

In fact it reverts the changes from https://github.com/kubernetes/kubernetes/pull/30257

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

PTAL @liggitt @timstclair 
CC @simo5
2017-12-14 13:54:40 -08:00
Kubernetes Submit Queue 5e478f072c
Merge pull request #56184 from CaoShuFeng/statefulset
Automatic merge from submit-queue (batch tested with PRs 54410, 56184, 56199, 56191, 56231). 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 useless const

Trivial fix.

**Release note**:

```release-note
NONE
```
2017-12-14 05:33:11 -08:00
zhengjiajin ffbfd81c06 remove dependency from cobra, only use option test init flag 2017-12-14 17:31:49 +08:00
Jordan Liggitt 13854c46a7
Raise RBAC DENY log level 2017-12-14 00:06:23 -05:00
Jordan Liggitt d073c10dbc
Refactor flex pv to allow secret namespace 2017-12-13 23:32:16 -05:00
David Eads 7dc7693e86 make quota reusable 2017-12-13 08:39:55 -05:00
zhengjiajin d8fa60f243 auto generated file 2017-12-13 14:56:36 +08:00
zhengjiajin 3ee3cf65cb enhance kube-schedule init flag 2017-12-13 14:46:58 +08:00
Jordan Liggitt 0682372bae
Define default role for full kubelet API access 2017-12-13 00:44:24 -05:00
Kubernetes Submit Queue 7335c41ebe
Merge pull request #56622 from wackxu/nodemiss
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>.

delete a node from its cache if it gets node not found error

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

delete a node from its cache if it gets node not found error

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-12-12 11:22:12 -08:00
Cao Shufeng 208df08ea6 remove useless validation from pod's resourcequota admission
ResourceQuota is a validating admission plugin. Before it runs, pods
has already been validated. It's not necessary to validate it again.
2017-12-11 17:49:33 +08:00
Derek Carr 1748b42b21 LimitRange ignores objects previously marked for deletion 2017-12-08 12:06:41 -05:00
Kubernetes Submit Queue 305d644363
Merge pull request #56577 from resouer/fix-eclass-pvc
Automatic merge from submit-queue (batch tested with PRs 56688, 56577). 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>.

Add pvc as part of equivalence hash

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

Should add PVC as part of equivalence hash so that `StatefulSe`t and `Operator` will always run the volume predicate, while the `ReplicaSet` can still  re-use cached ones.

**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 #56265

**Special notes for your reviewer**:

**Release note**:

```release-note
Add pvc as part of equivalence hash
```
2017-12-05 14:31:09 -08:00
Cao Shufeng 16999f172d remove duplicated validation from podsecuritypolicy 2017-12-05 19:13:44 +08:00
hzxuzhonghu e31ed07a9c also check pod securityContextt hostNetwork in exec admission controller 2017-12-05 15:15:46 +08:00
Kubernetes Submit Queue 3fef902161
Merge pull request #56709 from gnufied/cluster-role-for-cloud-provider
Automatic merge from submit-queue (batch tested with PRs 56785, 56709). 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>.

cloud-provider needs cluster-role to apply taint to the node

When volume is stuck in attaching state on AWS, cloud-provider
needs to taint the node. But the node can not be tainted
without proper access. Without this change https://github.com/kubernetes/kubernetes/pull/55558 will not work.

xref - https://github.com/kubernetes/kubernetes/issues/56819

cc @jsafrane @liggitt 

/sig storage

```release-note
none
```
2017-12-04 17:14:14 -08:00
Hemant Kumar 514f219c22 cloud-provider needs cluster-role to apply taint to the node
When volume is stuck in attaching state on AWS, cloud-provider
needs to taint the node. But the node can not be tainted
without proper access.
2017-12-04 10:57:21 -05:00
Li Yi 44877d87cb Fix typo
Change-Id: Ie8a4e9cf510fe2f7e7445af03476a0e7759a0360
Signed-off-by: Li Yi <denverdino@gmail.com>
2017-12-04 21:16:31 +08:00
Kubernetes Submit Queue 050956b08e
Merge pull request #56533 from vladimirvivien/csi-featuregate-fix
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>.

CSI - Fix feature gate bug and add bootstrap RBAC rules

**What this PR does / why we need it**:
This PR addresses show-stopper bug https://github.com/kubernetes/kubernetes/issues/56532.  It fixes the faulty feature gate logic and adds RBAC rules for kube-controller-manager and kubelet that allows `VolumeAttachment` API operations against the api-server.

**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 #56532, #56667 

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2017-12-03 07:54:04 -08:00
Kubernetes Submit Queue 2b98a976fb
Merge pull request #53647 from wenlxie/githubupstream.master.fixinterpodantiaffinity
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 inter-pod anti-affinity issue

This is used to fix:
https://github.com/kubernetes/kubernetes/issues/50813
2017-12-03 07:13:08 -08:00
Harry Zhang b3bb74e3a3 Update generated bazel 2017-12-02 22:24:17 +08:00
Harry Zhang e4055c0df2 Add pvc as part of equivalence hash
Use factory to generat get equivalence pod func
2017-12-02 22:24:17 +08:00
Harry Zhang af243f4824 Fix PV counter predicate in eclass 2017-12-02 22:24:17 +08:00
Vladimir Vivien 179d8e108e CSI - feature gate fix, gated RBAC rules, csi nodeID label
This commit tracks chages to fix blocking bugs such as feature gates, rbac rules, usage
of csi nodeID to derive attachment ID.
2017-12-02 05:54:54 -05:00
wackxu aac60b6cbb delete a node from its cache if it gets node not found error 2017-12-02 09:34:25 +08:00
Bruno Miguel Custodio 0a5a1f1cb4
fix wording in kube-scheduler warning 2017-12-01 17:00:05 +00:00
wenlxie 82e02cc986 fix inter-pod anti-affinity issue 2017-12-01 19:32:21 +08:00
Dan Winship ac336a6eb2 Add rbac policies for NetworkPolicy 2017-11-30 17:09:52 -05:00
Cao Shufeng 184eb83162 remove extra level check of glog 2017-11-30 15:58:18 +08:00
Cao Shufeng 3ef8ab4d70 Heap is not thread safe in scheduling queue 2017-11-30 14:04:28 +08:00
Michelle Au c26debecef Return no volume match if prebound PV node affinity doesn't match node 2017-11-29 17:29:58 -08:00
Cao Shufeng 33f6625a84 fix scheduling queue unit test
This change makes sure the Pop() test finish completely.
2017-11-28 17:40:35 +08:00
Avesh Agarwal b571001999 Implement resource limit priority function. This function checks if the input pod's
resource limits are satisfied by the input node's allocatable resources or not.
If yes, the node is assigned a score of 1, otherwise the node's score is not changed.
2017-11-27 12:53:47 -05:00
Cao Shufeng 888580e032 clean up failure domain from InterPodAffinityPriority 2017-11-27 13:13:12 +08:00
Slava Semushin b1ae1d67b2 admission_test.go(TestAdmitPreferNonmutating): simplify test by replacing shouldPassAdmit by a constant value. 2017-11-24 17:12:53 +01:00