Commit Graph

841 Commits (5464d42a36cccc35b88c8ac2a743cce340075e10)

Author SHA1 Message Date
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
Kubernetes Submit Queue ebc8dc85aa Merge pull request #36207 from smarterclayton/optimize_self_link
Automatic merge from submit-queue

SetSelfLink is inefficient

Generating self links, especially for lists, is inefficient.  Replace
use of net.URL.String() call with direct encoding that reduces number of
allocations. Switch from calling meta.ExtractList|SetList to a function
that iterates over each object in the list.

In steady state for nodes performing frequently small get/list
operations, and for larger LISTs significantly reduces CPU and
allocations.

@wojtek-t this is the next big chunk of CPU use during the large N nodes simulation test (11% of master CPU). Takes a few allocations out of the critical path
2016-11-06 06:42:49 -08:00
Kubernetes Submit Queue 17fda0a135 Merge pull request #35806 from bdbauer/new_deletion
Automatic merge from submit-queue

Made changes to DELETE API to let v1.DeleteOptions be passed in as a queryParameter

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

```release-note
DELETE requests can now pass in their DeleteOptions as a query parameter or a body parameter, rather than just as a body parameter.
```
2016-11-05 08:49:34 -07:00
Kubernetes Submit Queue f6b313b1da Merge pull request #36070 from liggitt/requestinfowatch
Automatic merge from submit-queue

Recognize watch operations via ?watch param

@deads2k @smarterclayton
2016-11-04 11:06:59 -07:00
Benjamin Bauer 2e7195fbcb Updated openapi spec, swagger spec, and swagger doc 2016-11-04 10:58:42 -07:00
Di Xu dd6c980949 specify custom ca file to verify the keystone server 2016-11-04 15:11:41 +08:00
Clayton Coleman 4f363f5447
SetSelfLink is inefficient
Generating self links, especially for lists, is inefficient.  Replace
use of net.URL.String() with direct encoding that reduces number of
allocations. Switch from calling meta.ExtractList|SetList to a function
that iterates over each object in the list.

In steady state for nodes performing frequently small get/list
operations, and for larger LISTs significantly reduces CPU and
allocations.
2016-11-03 23:37:36 -04:00
Benjamin Bauer 76c3804859 Made changes to DELETE API to let v1.DeleteOptions be passed in as a QueryParameter 2016-11-03 15:53:04 -07:00
Jordan Liggitt 3294b1df18
Recognize watch operations via ?watch param 2016-11-02 12:00:42 -04:00
Kubernetes Submit Queue 5774ca188d Merge pull request #35840 from caesarxuchao/hide-new-versions
Automatic merge from submit-queue

Hide groups with new versions from old kubectl

Fix https://github.com/kubernetes/kubernetes/issues/35791

**What caused the bug?**

In 1.5, we are going to graduate Policy and Apps to beta. Old version kubectl doesn't has the new versions built-in, its TRP dynamic discover thinks Policy/v1beta1 is a TPR, and tried to register it in kubectl's scheme. The registration failed because Policy group already exist, because kubectl had registered Policy.v1alpha1.

**How does this PR fix the bug?**

This PR let the API server hides Policy and Apps from old version kubectl, so TPR discovery won't see them.

Old version kubectl doesn't know about Policy/v1beta1 or Apps/v1beta1, and v1alpha1 will be removed, so old version kubectl won't work for Policy or Apps anyway, so this PR does not cause any function loss.

@kubernetes/sig-api-machinery @liggitt @smarterclayton @deads2k @janetkuo @mwielgus
2016-11-02 04:49:56 -07:00
Angus Salkeld 3a08cf0619 Correct the article in generated documents
For example:

  "a Ingress" > "an Ingress"
2016-10-31 09:46:29 +10:00
Chao Xu a545ac7a90 add group filter 2016-10-29 15:05:48 -07:00
Kubernetes Submit Queue 4ec036c8af Merge pull request #35452 from deads2k/auth-02-front-proxy
Automatic merge from submit-queue

allow authentication through a front-proxy

This allows a front proxy to set a request header and have that be a valid `user.Info` in the authentication chain.  To secure this power, a client certificate may be used to confirm the identity of the front proxy

@kubernetes/sig-auth fyi
@erictune per-request
@liggitt you wrote the openshift one, ptal.
2016-10-29 07:52:09 -07:00
Clayton Coleman ca2f1b87ad
Replace negotiation with a new method that can extract info
Alter how runtime.SerializeInfo is represented to simplify negotiation
and reduce the need to allocate during negotiation. Simplify the dynamic
client's logic around negotiating type. Add more tests for media type
handling where necessary.
2016-10-28 11:30:11 -04:00
Clayton Coleman f9f680a937
Simplify RESTHander getter and remove specialized serializers 2016-10-28 11:30:11 -04:00
deads2k 3f9a4d51d5 wire up authenticating front proxy: 2016-10-28 08:36:46 -04:00
Wojciech Tyczynski 5d2062db9f Reduce amount of not-helping logs in apiserver 2016-10-26 13:20:07 +02:00
mbohlool 75451b49f4 - Add GroupVersion as tags to OpenAPI spec
- Remove all end-point specs as they are not useful in light of GroupVersion tags in main spec
2016-10-25 14:27:48 -07:00
mbohlool cd5643b85c Update bazel 2016-10-22 02:50:33 -07:00
mbohlool 3e67cf8b9b Add authentication to openapi Spec 2016-10-22 02:43:42 -07:00
Mike Danese 3b6a067afc autogenerated 2016-10-21 17:32:32 -07:00
mbohlool 25afcc5522 Add +optional tag to all fields with omitempty json tag 2016-10-17 08:52:13 -07:00
deads2k a8b471491b you can be authorized and have a failure 2016-10-14 16:18:23 -04:00
mbohlool 5ba06cf2bc Make Kubernetes OpenAPI operation IDs unique 2016-10-12 14:54:12 -07: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 617fa91264 Merge pull request #34098 from deads2k/sttts-handlerchain
Automatic merge from submit-queue

Customizable genericapiserver handler chain

Rebase of https://github.com/kubernetes/kubernetes/pull/33662.  This is @sttts, but I rebased it for him since he's out this week.
2016-10-05 09:45:57 -07:00
Dr. Stefan Schimanski 68cee1d9ac Make genericapiserver handler chain customizable 2016-10-05 10:32:36 -04:00
Dr. Stefan Schimanski 7cfd0150e4 Turn RequestInfoResolver into a RequestInfoFactory 2016-10-05 10:32:36 -04:00
Maciej Szulik 9cc2a0454d Add asgroups to audit log 2016-10-05 15:40:11 +02:00
Jordan Liggitt 3c92eb75b3
Enable service account signing key rotation 2016-10-04 14:16:38 -04:00
Kubernetes Submit Queue 6a1622a723 Merge pull request #33785 from deads2k/api-16-pass-config-to-hook
Automatic merge from submit-queue

pass loopback config to poststart hooks

Updates post start hooks to take a clientconfig with the new loopback credentials for bootstrapping.

@ericchiang This is a little bit of plumbing, but mainly auth I think.
2016-10-01 10:27:04 -07:00
Kubernetes Submit Queue 30ca344361 Merge pull request #33565 from liggitt/ecdsa
Automatic merge from submit-queue

Add ECDSA support for service account tokens

Fixes #28180

```release-note
ECDSA keys can now be used for signing and verifying service account tokens.
```
2016-10-01 08:42:53 -07:00
deads2k 57039cfdfa make well-known users and groups into constants 2016-09-30 10:34:33 -04:00
deads2k 5080a575ad add anytoken authenticator 2016-09-29 14:14:06 -04:00
Kubernetes Submit Queue d187997c94 Merge pull request #32386 from liggitt/anonymous-authenticated-groups
Automatic merge from submit-queue

Allow anonymous API server access, decorate authenticated users with system:authenticated group

When writing authorization policy, it is often necessary to allow certain actions to any authenticated user. For example, creating a service or configmap, and granting read access to all users

It is also frequently necessary to allow actions to any unauthenticated user. For example, fetching discovery APIs might be part of an authentication process, and therefore need to be able to be read without access to authentication credentials.

This PR:
* Adds an option to allow anonymous requests to the secured API port. If enabled, requests to the secure port that are not rejected by other configured authentication methods are treated as anonymous requests, and given a username of `system:anonymous` and a group of `system:unauthenticated`. Note: this should only be used with an `--authorization-mode` other than `AlwaysAllow`
* Decorates user.Info returned from configured authenticators with the group `system:authenticated`.

This is related to defining a default set of roles and bindings for RBAC (https://github.com/kubernetes/features/issues/2). The bootstrap policy should allow all users (anonymous or authenticated) to request the discovery APIs.

```release-note
kube-apiserver learned the '--anonymous-auth' flag, which defaults to true. When enabled, requests to the secure port that are not rejected by other configured authentication methods are treated as anonymous requests, and given a username of 'system:anonymous' and a group of 'system:unauthenticated'. 

Authenticated users are decorated with a 'system:authenticated' group.

NOTE: anonymous access is enabled by default. If you rely on authentication alone to authorize access, change to use an authorization mode other than AlwaysAllow, or or set '--anonymous-auth=false'.
```

c.f. https://github.com/kubernetes/kubernetes/issues/29177#issuecomment-244191596
2016-09-29 10:47:49 -07:00
Dr. Stefan Schimanski 6c75e922f3 Decouple NewRequestInfoResolver from GenericApiServer instance 2016-09-28 18:51:34 +02:00
Dr. Stefan Schimanski 10cbaf7ce0 Store RequestInfo in Context
... in order to replace the manual RequestInfoResolver dependency injection
through out the code.
2016-09-28 18:51:34 +02:00
Jordan Liggitt 6333d8fd86
Add ECDSA support 2016-09-27 12:44:54 -04:00
Dr. Stefan Schimanski 6dc2f6337b Separate apiserver handler filters 2016-09-27 09:57:59 +02:00
Dr. Stefan Schimanski a2f943e7c1 Move panic handler into genericapiserver 2016-09-27 09:52:50 +02:00
Kubernetes Submit Queue a845c92207 Merge pull request #33368 from sttts/sttts-prune-serviceerrorhandler
Automatic merge from submit-queue

Prune unused parameters and call only once

Two parameters of `InstallServiceErrorHandler` were not used. Pruning them allows us to move the service error handler installation for each api group to be moved into the constructor.
2016-09-26 22:29:52 -07:00
Jordan Liggitt 5599ca3be5
Decorate authenticated users with system:authenticated group 2016-09-26 17:19:00 -04:00
Jordan Liggitt 0c36c5e556
Add anonymous auth to the auth chain 2016-09-26 17:19:00 -04:00
Hongchao Deng 6f3ac807fd pass SelectionPredicate instead of Filter to storage layer 2016-09-26 09:47:19 -07:00
Kubernetes Submit Queue 9455b1de54 Merge pull request #33157 from YuPengZTE/devEG
Automatic merge from submit-queue

'eg.' should be 'e.g.'
2016-09-24 00:53:38 -07:00
Kubernetes Submit Queue 501f264717 Merge pull request #33337 from mbohlool/o2
Automatic merge from submit-queue

Fix API Installer to generate unique Operation IDs

OperationIDs generated by api_installer.go may not be unique and that causes long auto-generated function names in swagger generated clients. This is a step toward making those IDs unique.

Reference Issue kubernetes/features#53 and #13414
2016-09-23 14:06:40 -07:00
mbohlool d228cc34f3 Fix API Installer to generate unique Operation IDs 2016-09-23 11:42:50 -07:00
Dr. Stefan Schimanski acf0a5264a Prune unused parameters and call only once 2016-09-23 14:53:09 +02:00
Dr. Stefan Schimanski 87356c0623 Cleanup handler chain 2016-09-23 12:03:58 +02:00
Philibert Dugas b557acf987
Update for the PR feedback 2016-09-22 13:30:04 -04:00