Commit Graph

1334 Commits (6fd9acd3e1da648c93324c6f5e35ea839d0fa117)

Author SHA1 Message Date
Michail Kargakis 16013c442f registry: use correct pdb client call in eviction rest 2016-10-23 13:40:06 +02:00
Mike Danese 3b6a067afc autogenerated 2016-10-21 17:32:32 -07:00
Kubernetes Submit Queue bdaf502ff4 Merge pull request #34094 from nebril/hless-to-nonhless-ip
Automatic merge from submit-queue

Deny service ClusterIP update from `None`

**What this PR does / why we need it**: Headless service should not be transformed into a service with ClusterIP, therefore update of this field if it's set to `None` is disallowed.

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

**Release note**:
```release-note
Changing service ClusterIP from `None` is not allowed anymore.
```
2016-10-21 14:34:56 -07:00
Kubernetes Submit Queue 850c586b69 Merge pull request #35218 from wojtek-t/get_to_list_support_resource_version
Automatic merge from submit-queue

Support resourceVersion in GetToList - unify interface of List and Ge…

This pretty much unifies the interface of List() and GetToList() methods of storage interface.

I'm going to use it in a subsequent PR to improve performance of the whole cluster.
2016-10-21 08:02:14 -07:00
Maciej Kwiek d1c32b8194 Test cases for service ClusterIP updates
Test cases from ClusterIP using types to other ClusterIP using types
(ClusterIP, NodePort, LoadBalancer) added.
2016-10-21 13:11:57 +02:00
Wojciech Tyczynski 93c008f8a4 Support resourceVersion in GetToList - unify interface of List and GetToList 2016-10-21 10:09:23 +02:00
Kubernetes Submit Queue c6df88991d Merge pull request #35194 from wojtek-t/efficient_selector
Automatic merge from submit-queue

Optimize label selector

The number of values for a given label is generally pretty small (in huge majority of cases it is exactly one value).
Currently computing selectors is up to 50% of CPU usage in both apiserver and scheduler.

Changing the structure in which those values are stored from map to slice improves the performance of typical usecase for computing selectors.

Early results:
- scheduler throughput it ~15% higher
- apiserver cpu-usage is also lower (seems to be also ~10-15%)
2016-10-20 20:45:22 -07:00
Kubernetes Submit Queue e2c5dea305 Merge pull request #35181 from wojtek-t/avoid_recomputing_fields
Automatic merge from submit-queue

Optimize computing fields in pod
2016-10-20 08:23:25 -07:00
Kubernetes Submit Queue e6b5b076b8 Merge pull request #33957 from bprashanth/esipp-beta
Automatic merge from submit-queue

Loadbalanced client src ip preservation enters beta

Sounds like we're going to try out the proposal (https://github.com/kubernetes/kubernetes/issues/30819#issuecomment-249877334) for annotations -> fields on just one feature in 1.5 (scheduler). Or do we want to just convert to fields right now?
2016-10-20 06:53:07 -07:00
Wojciech Tyczynski 9c91da7a22 More efficient selector 2016-10-20 15:16:58 +02:00
Wojciech Tyczynski c54d09d14e Optimize computing fields in pod 2016-10-20 11:56:03 +02:00
Kubernetes Submit Queue 5863a3a3de Merge pull request #35098 from kargakis/redundant-deep-copy
Automatic merge from submit-queue

registry: remove redundant PDB deep-copy from eviction REST
2016-10-20 02:10:35 -07:00
bprashanth 5029bb06e9 Validation 2016-10-19 14:51:57 -07:00
bprashanth a46a849b9e Promote source ip annotations to beta 2016-10-19 13:39:37 -07:00
Michail Kargakis 3d23db53e6 registry: remove redundant PDB deep-copy from eviction REST 2016-10-19 10:33:06 +02:00
Kubernetes Submit Queue f39e86c0a5 Merge pull request #34474 from liggitt/connection-info-refactor
Automatic merge from submit-queue

Remove static kubelet client, refactor ConnectionInfoGetter

Follow up to https://github.com/kubernetes/kubernetes/pull/33718

* Collapses the multi-valued return to a `ConnectionInfo` struct
* Removes the "raw" connection info method and interface, since it was only used in a single non-test location (by the "real" connection info method)
* Disentangles the node REST object from being a ConnectionInfoProvider itself by extracting an implementation of ConnectionInfoProvider that takes a node (using a provided NodeGetter) and determines ConnectionInfo
* Plumbs the KubeletClientConfig to the point where we construct the helper object that combines the config and the node lookup. I anticipate adding a preference order for choosing an address type in https://github.com/kubernetes/kubernetes/pull/34259
2016-10-18 13:20:25 -07:00
Kubernetes Submit Queue 2f990ac429 Merge pull request #34979 from deads2k/tpr-04-storage-post-hook
Automatic merge from submit-queue

convert TPR controller to posthook instead of disable flag

Converts the third party resource controller into a posthook using a loopback client instead going direct to etcd.  This let's us eliminate more flags and special-casing during initialization.  Also, using a client brings us closer to building this without side-effects for downstream composers.
2016-10-18 06:39:41 -07:00
Kubernetes Submit Queue 3193bedb33 Merge pull request #34948 from wojtek-t/avoid_unnecessary_allocation
Automatic merge from submit-queue

Avoid unnecessary allocation

This is supposed to avoid unnecessary memory allocations.

PodToSelectableFields seems to be the biggest contributor to memory allocations:
```
Showing top 10 nodes out of 247 (cum >= 83166442)
      flat  flat%   sum%        cum   cum%
1796823715 31.09% 31.09% 1796823715 31.09%  k8s.io/kubernetes/pkg/registry/core/pod.PodToSelectableFields
 530856268  9.19% 40.28%  530856268  9.19%  k8s.io/kubernetes/pkg/storage.NamespaceKeyFunc
 241505351  4.18% 44.46%  241505351  4.18%  reflect.unsafe_New
...
```
2016-10-17 22:54:26 -07:00
deads2k 1423654295 convert TPR controller to posthook instead of disable flag 2016-10-17 16:24:02 -04:00
mbohlool 25afcc5522 Add +optional tag to all fields with omitempty json tag 2016-10-17 08:52:13 -07:00
Wojciech Tyczynski c6b098068d Allocate podFields map with a correct hint for size 2016-10-17 15:07:15 +02:00
Wojciech Tyczynski 422121f93a Avoid unnecessary map allocation 2016-10-17 15:01:00 +02:00
Jordan Liggitt a082a2e749
Remove static kubelet client, refactor ConnectionInfoGetter 2016-10-15 22:15:04 -04:00
Kubernetes Submit Queue 13196527cf Merge pull request #34759 from caesarxuchao/remove-unversioned
Automatic merge from submit-queue

Remove imports of "pkg/client/unversioned" in "pkg/controller"

We are trying to deprecate "pkg/client/unversioned", see https://github.com/kubernetes/kubernetes/issues/25442.

Also part of https://github.com/kubernetes/kubernetes/issues/29934.
2016-10-15 00:10:15 -07:00
deads2k e37d2f3465 honor SAR verb 2016-10-14 15:38:39 -04:00
Kubernetes Submit Queue c3742a8fbe Merge pull request #34047 from deads2k/rbac-11-informer-cache
Automatic merge from submit-queue

Run rbac authorizer from cache

RBAC authorization can be run very effectively out of a cache.  The cache is a normal reflector backed cache (shared informer).

I've split this into three parts:
 1. slim down the authorizer interfaces
 1. boilerplate for adding rbac shared informers and associated listers which conform to the new interfaces
 1. wiring

@liggitt @ericchiang @kubernetes/sig-auth
2016-10-14 08:12:28 -07:00
Chao Xu fbd187af45 move the retry util out of pkg/client/unversioned 2016-10-13 16:10:24 -07:00
deads2k ceaf026881 slim down authorization listing interfaces 2016-10-13 07:50:01 -04:00
deads2k 6406aacb59 remove legacy API prefix from generic 2016-10-12 15:32:27 -04:00
Kubernetes Submit Queue 6af180b0d7 Merge pull request #34019 from deads2k/rbac-12-default-bindings
Automatic merge from submit-queue

Add default cluster role bindings

Add default cluster roles bindings to rbac bootstrapping.  Also adds a case for allowing escalation when you have no authenticator.

@liggitt I expect you may need to make peace with this.
2016-10-10 23:53:34 -07:00
Kubernetes Submit Queue e4b1e263f4 Merge pull request #34461 from mikebryant/wip-34459
Automatic merge from submit-queue

Fix panic in #34459

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**:
Use the correct variable in the thirdpartyresourcedata codec so it doesn't panic on a nil pointer reference

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

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```
2016-10-10 16:20:37 -07:00
deads2k f73d1ea90a make sure that the bootstrap rbac rules are getting created in test-cmd 2016-10-10 15:00:36 -04:00
deads2k 467b7d928f add clusterrolebindings to bootstrapping 2016-10-10 15:00:35 -04:00
Kubernetes Submit Queue ff20b172ef Merge pull request #33718 from justinsb/arbitrary_names_2b
Automatic merge from submit-queue

Use nodeutil.GetHostIP consistently when talking to nodes

Most of our communications from apiserver -> nodes used
    nodutil.GetNodeHostIP, but a few places didn't - and this meant that the
    node name needed to be resolvable _and_ we needed to populate valid IP
    addresses.

```release-note
The apiserver now uses addresses reported by the kubelet in the Node object's status for apiserver->kubelet communications, rather than the name of the Node object. The address type used defaults to `InternalIP`, `ExternalIP`, and `LegacyHostIP` address types, in that order.
```
2016-10-10 11:00:26 -07:00
Mike Bryant a6dafe401f Use correct variable in thirdpartyresourcedata codec.
Fixes #34459
2016-10-10 18:42:33 +01:00
Kubernetes Submit Queue f2016df2cc Merge pull request #34054 from deads2k/testapi-01-remove-default.groupversion
Automatic merge from submit-queue

remove testapi.Default.GroupVersion

I'm going to try to take this as a series of mechanicals.  This removes `testapi.Default.GroupVersion()` and replaces it with `registered.GroupOrDie(api.GroupName).GroupVersion`.

@caesarxuchao I'm trying to see how much of `pkg/api/testapi` I can remove.
2016-10-07 20:30:34 -07:00
Kubernetes Submit Queue f765f5e5d0 Merge pull request #33927 from deads2k/api-21-fix-improper-eviction
Automatic merge from submit-queue

fix pod eviction storage

Refactor pod eviction storage to remove the tight order coupling of the storage.  This also gets us ready to deal with cases where API groups are not co-located on the same server, though the particular client being used would assume a proxy.
2016-10-07 08:18:28 -07:00
deads2k 518d5500c7 remove testapi.Default.GroupVersion 2016-10-07 10:10:54 -04:00
Kubernetes Submit Queue db1985716f Merge pull request #29011 from justinsb/arbitrary_names_1
Automatic merge from submit-queue

Refactor: separate KubeletClient & ConnectionInfoGetter concepts

KubeletClient implements ConnectionInfoGetter, but it is not a complete
implementation: it does not set the kubelet port from the node record,
for example.

By renaming the method so that it does not implement the interface, we
are able to cleanly see where the "raw" GetConnectionInfo is used (it is
correct) and also have go type-checking enforce this for us.

This is related to #25532; I wanted to satisfy myself that what we were doing there was correct, and I wanted also to ensure that the compiler could enforce this going forwards.
2016-10-07 02:02:13 -07:00
deads2k 28358e4775 fix pod eviction storage 2016-10-05 07:55:49 -04:00
juanvallejo cfbdcec7d6 make portallocator.ErrNotInRange a type 2016-10-04 13:19:24 -04:00
juanvallejo 6b83f89d47 Add option to set a service nodeport
This patch adds the option to set a nodeport when creating a NodePort
service. In case of a port allocation error due to a specified port
being out of the valid range, the error now includes the valid
range. If a `--node-port` value is not specified, it defaults to zero, in
which case the allocator will default to its current behavior of
assigning an available port.

This patch also adds a new helper function in `cmd/util/helpers.go` to
retrieve `Int32` cobra flags.

**Example**
```
$ kubectl create service nodeport mynodeport --tcp=8080:7777 --node-port=1
The Service "mynodeport" is invalid: spec.ports[0].nodePort: Invalid
value: 1: provided port is not in the valid range. Valid ports range
from 30000-32767

$ kubectl create service nodeport mynodeport --tcp=8080:7777 --node-port=30000
service "mynodeport" created

$ oc describe service mynodeport
Name:                   mynodeport
Namespace:              default
Labels:                 app=mynodeport
Selector:               app=mynodeport
Type:                   NodePort
IP:                     172.30.81.254
Port:                   8080-7777       8080/TCP
NodePort:               8080-7777       30000/TCP
Endpoints:              <none>
Session Affinity:       None
No events.
```
2016-10-04 13:19:24 -04:00
deads2k 57039cfdfa make well-known users and groups into constants 2016-09-30 10:34:33 -04:00
deads2k 4c8959df59 pass loopback config to posthooks 2016-09-30 10:34:33 -04:00
Justin Santa Barbara 8fe884ac3f Use nodeutil.GetHostIP consistently when talking to nodes
Most of our communications from apiserver -> nodes used
nodutil.GetNodeHostIP, but a few places didn't - and this
meant that the node name needed to be resolvable _and_ we needed
to populate valid IP addresses.

Fix the last few places that used the NodeName.

Issue #18525
Issue #9451
Issue #9728
Issue #17643
Issue #11543
Issue #22063
Issue #2462
Issue #22109
Issue #22770
Issue #32286
2016-09-29 10:07:43 -04:00
deads2k 1c667e4fc5 move core storage out of master.go 2016-09-29 09:39:23 -04:00
Justin Santa Barbara 7381e9ac37 Refactor: separate KubeletClient & ConnectionInfoGetter concepts
KubeletClient implements ConnectionInfoGetter, but it is not a complete
implementation: it does not set the kubelet port from the node record,
for example.

By renaming the method so that it does not implement the interface, we
are able to cleanly see where the "raw" GetConnectionInfo is used (it is
correct) and also have go type-checking enforce this for us.
2016-09-29 01:05:13 -04:00
Doug Davis 9d5bac6330 Change minion to node
Contination of #1111

I tried to keep this PR down to just a simple search-n-replace to keep
things simple.  I may have gone too far in some spots but its easy to
roll those back if needed.

I avoided renaming `contrib/mesos/pkg/minion` because there's already
a `contrib/mesos/pkg/node` dir and fixing that will require a bit of work
due to a circular import chain that pops up. So I'm saving that for a
follow-on PR.

I rolled back some of this from a previous commit because it just got
to big/messy. Will follow up with additional PRs

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-09-28 10:53:30 -07:00
Hongchao Deng 6f3ac807fd pass SelectionPredicate instead of Filter to storage layer 2016-09-26 09:47:19 -07:00
deads2k b330b0a220 start creating controller SA roles. start with just one 2016-09-26 09:31:36 -04:00