Commit Graph

282 Commits

Author SHA1 Message Date
Kubernetes Submit Queue
cbf497b749 Merge pull request #38119 from liggitt/long-running
Automatic merge from submit-queue (batch tested with PRs 37032, 38119, 38186, 38200, 38139)

Detect long-running requests from parsed request info

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

Uses parsed request info to more tightly match verbs and subresources

Removes regex-based long-running request path matching (which is easily fooled)

```release-note
The --long-running-request-regexp flag to kube-apiserver is deprecated and will be removed in a future release. Long-running requests are now detected based on specific verbs (watch, proxy) or subresources (proxy, portforward, log, exec, attach).
```
2016-12-06 18:29:35 -08:00
Kubernetes Submit Queue
d4d6a32e9b Merge pull request #38123 from deads2k/api-48-remove-fields
Automatic merge from submit-queue (batch tested with PRs 38194, 37594, 38123, 37831, 37084)

remove unnecessary fields from genericapiserver config

Cleans up some unnecessary fields in the genericapiserver config.
2016-12-06 17:41:33 -08:00
deads2k
b723333be3 move APIResourceConfigSource to master 2016-12-06 10:19:25 -05:00
deads2k
6ea1d5d53d join client CA bundles into the accept path for genericapiserver 2016-12-06 09:56:13 -05:00
deads2k
fbb35b72ed update delegating auth to include front-proxy 2016-12-06 09:40:07 -05:00
deads2k
4f625db133 move client-ca to authentication args 2016-12-06 09:34:49 -05:00
Jordan Liggitt
4359054616
Detect long-running requests from parsed request info 2016-12-05 16:46:28 -05:00
deads2k
2923d09091 remove rbac super user 2016-12-05 13:49:54 -05:00
Dr. Stefan Schimanski
a4cf364dbd Replace glog.Fatals with "return fmt.Errorf" in apiservers 2016-12-05 16:05:52 +01:00
Dr. Stefan Schimanski
5b1d45bc15 Stratify certificate loading and self-sign cert generation
This removes all dependencies on Config during cert generation, only operating
on ServerRunOptions. This way we get rid of the repeated call of Config.Complete
and cleanly stratify the GenericApiServer bootstrapping.
2016-12-05 14:58:15 +01:00
Dr. Stefan Schimanski
eeb582e53f Move DefaultServiceIPRange into pkg/master 2016-12-03 18:34:22 +01:00
deads2k
ab9a842f3c add loopback auth defaulting to generic apiserver 2016-11-29 11:02:35 -05:00
deads2k
6846855929 add delegating authorization flags and options 2016-11-29 10:59:43 -05:00
deads2k
ca2b5f136e split authorization from main options struct 2016-11-29 10:59:43 -05:00
deads2k
7c0e48f544 split out authentication options 2016-11-29 10:59:43 -05:00
deads2k
56b7a8b02b remove some options from mega-struct 2016-11-29 10:59:43 -05:00
deads2k
18074d7606 split insecure serving options 2016-11-29 10:59:42 -05:00
deads2k
a08f3ba521 split secure serving options 2016-11-29 10:59:42 -05:00
deads2k
a9af8206cb split generic etcdoption out of main struct 2016-11-29 10:59:42 -05:00
Clayton Coleman
35a6bfbcee
generated: refactor 2016-11-23 22:30:47 -06:00
Chao Xu
643f0bbd34 other cmd/ 2016-11-23 15:53:09 -08:00
Kubernetes Submit Queue
860cae0933 Merge pull request #35488 from dixudx/keystone-ca-cert
Automatic merge from submit-queue

specify custom ca file to verify the keystone server

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

Sometimes the keystone server's certificate is self-signed, mainly used for internal development, testing and etc.

For this kind of ca, we need a way to verify the keystone server.

Otherwise, below error will occur.

> x509: certificate signed by unknown authority

This patch provide a way to pass in a ca file to verify the keystone server when starting `kube-apiserver`.

**Which issue this PR fixes** : fixes #22695, #24984

**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-11-08 13:13:00 -08:00
Maciej Szulik
41d88d30dd Rename ScheduledJob to CronJob 2016-11-07 10:14:12 +01:00
Di Xu
dd6c980949 specify custom ca file to verify the keystone server 2016-11-04 15:11:41 +08:00
deads2k
d82f98c9b3 remove non-generic options from genericapiserver.Config 2016-11-03 11:48:33 -04:00
deads2k
f56cbfa8d5 add healthz to genericapiserver 2016-11-01 14:39:33 -04:00
Dr. Stefan Schimanski
d0b3981f07 Make GenericApiServer.Run interruptable and fail on first listen 2016-11-01 09:50:56 +01:00
Dr. Stefan Schimanski
ab3ce27f01 Make master+federation ServerRunOptions embeddings explicit 2016-10-31 11:04:58 +01:00
Dr. Stefan Schimanski
b798527793 Rename master/options/{APIServer -> ServerRunOptions} 2016-10-31 10:55:19 +01:00
Dr. Stefan Schimanski
d6dc0e561f Apiserver cleanups
- remove unused genericapiserver Config.MasterServiceNamespace
- move init code into ApplyOptions
- initialize genericapiserver Config.MaxRequestsInFlight
- move ServiceReadWritePort to master
2016-10-31 10:55:19 +01:00
deads2k
3f9a4d51d5 wire up authenticating front proxy: 2016-10-28 08:36:46 -04:00
Dr. Stefan Schimanski
cca05af615 Move swagger+openapi setup to routes and decouple from run 2016-10-22 13:42:22 +02:00
mbohlool
3e67cf8b9b Add authentication to openapi Spec 2016-10-22 02:43:42 -07:00
deads2k
9578523180 move proxytransport config out of the genericapiserver 2016-10-20 11:23:53 -04: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
deads2k
5a9b16d40a make version an explicit choice so zero config and customized work 2016-10-17 16:10:07 -04:00
Jordan Liggitt
a082a2e749
Remove static kubelet client, refactor ConnectionInfoGetter 2016-10-15 22:15:04 -04:00
deads2k
7412be4465 default serializer 2016-10-14 11:27:32 -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
deads2k
fbd5032da2 split genericapiserver configuration apart so that you can run without flag options 2016-10-13 13:09:53 -04:00
deads2k
e1638f11a3 run authorization from a cache 2016-10-13 07:53:40 -04:00
Kubernetes Submit Queue
ca75b47657 Merge pull request #32555 from pweil-/admission-authorizer
Automatic merge from submit-queue

WantsAuthorizer admission plugin support

The next step of PSP admission is to be able to limit the PSPs used based on user information.  To do this the admission plugin would need to make authz checks for the `user.Info` in the request.  This code allows a plugin to request the injection of an authorizer to allow it to make the authz checks.

Note:  this could be done with a SAR, however since admission is running in the api server using the SAR would incur an extra hop vs using the authorizer directly.

@deads2k @derekwaynecarr
2016-10-13 03:40:11 -07:00
mbohlool
5ba06cf2bc Make Kubernetes OpenAPI operation IDs unique 2016-10-12 14:54:12 -07:00
pweil-
5c66dcb526 inject authorizer when admission controller requests it 2016-10-12 13:05:34 -04:00
Kubernetes Submit Queue
8a72f11596 Merge pull request #33842 from deads2k/api-19-clean-structs
Automatic merge from submit-queue

clean api server cruft

Some cruft has developed over refactors.  Remove that cruft.

@liggitt probably last in the chain so far
2016-10-11 18:56:15 -07:00
deads2k
406c0a36ae cleanup cruft from API server structs 2016-10-11 10:56:05 -04:00
Kubernetes Submit Queue
1837914d8e Merge pull request #34029 from liggitt/service-account-rotation
Automatic merge from submit-queue

Enable service account signing key rotation

fixes #21007

```release-note
The kube-apiserver --service-account-key-file option can be specified multiple times, or can point to a file containing multiple keys, to enable rotation of signing keys.
```

This PR enables the apiserver authenticator to verify service account tokens signed by different private keys. This can be done two different ways:
* including multiple keys in the specified keyfile (e.g. `--service-account-key-file=keys.pem`)
* specifying multiple key files (e.g. `--service-account-key-file current-key.pem --service-account-key-file=old-key.pem`)

This is part of enabling signing key rotation:

1. update apiserver(s) to verify tokens signed with a new public key while still allowing tokens signed with the current public key (which is what this PR enables)
2. give controllermanager the new private key to sign new tokens with
3. remove old service account tokens (determined by verifying signature or by checking creationTimestamp) once they are no longer in use (determined using garbage collection or magic) or some other algorithm (24 hours after rotation, etc). For the deletion to immediately revoke the token, `--service-account-lookup` must be enabled on the apiserver.
4. once all old tokens are gone, update apiservers again, removing the old public key.
2016-10-10 21:54:03 -07:00
Kubernetes Submit Queue
bd3664cbef Merge pull request #34000 from wojtek-t/set_cache_size
Automatic merge from submit-queue

Set deserialization cache size based on target memory usage

**Special notes for your reviewer**:

This is the PR we talked about yesterday.

**Release note**:

```release-note
To reduce memory usage to reasonable levels in smaller clusters, kube-apiserver now sets the deserialization cache size based on the target memory usage.
```
2016-10-05 14:23:39 -07:00
Wojciech Tyczynski
2bfcb1a850 Set deserialization cache size based on target memory usage 2016-10-05 10:00:02 +02:00
Jordan Liggitt
3c92eb75b3
Enable service account signing key rotation 2016-10-04 14:16:38 -04:00