Commit Graph

662 Commits

Author SHA1 Message Date
mbohlool
76e24f216f Consolidate local OpenAPI specs and APIServices' spec into one data structure
Remove APIService OpenAPI spec when it is deleted

Add eTag support and returning httpStatus to OpenAPI spec downloader

Update aggregated OpenAPI spec periodically

Use delegate chain

Refactor OpenAPI aggregator to have separate controller and aggregation function

Enable OpenAPI spec for extensions api server

Do not filter paths. higher priority specs wins the conflicting paths

Move OpenAPI aggregation controller to pkg/controller/openapi
2017-09-03 02:16:08 -07:00
xilabao
f14c138438 add selfsubjectrulesreview api 2017-09-01 19:09:43 +08:00
Antoine Pelisse
d7eec6b51d Revert "Enable batch/v1beta1.CronJobs by default" 2017-08-31 09:54:16 -07:00
Kubernetes Submit Queue
ffcd6d1dce Merge pull request #51465 from soltysh/cronjob_beta
Automatic merge from submit-queue (batch tested with PRs 50775, 51397, 51168, 51465, 51536)

Enable batch/v1beta1.CronJobs by default

This PR moves to CronJobs beta entirely, enabling `batch/v1beta1` by default.

Related issue: #41039 

@erictune @janetkuo ptal

```release-note
Promote CronJobs to batch/v1beta1.
```
2017-08-30 15:14:32 -07:00
Maciej Szulik
2de214b044
Enable batch/v1beta1.CronJobs by default 2017-08-29 09:31:39 +02:00
Saksham Sharma
6a4afc897c Unify cloudprovided and normal KMS plugins 2017-08-28 22:46:42 +05:30
mbohlool
95586075af Fix backward compatibility for renamed OpenAPI definitions 2017-08-23 05:06:36 -07:00
tengqm
a909cc8af5 Fix admission plugin registration
The current registration of admission plug-ins happen too late so the
command line help is not yielding correct/useful information to users.
This is already causing confusion as mentioned in some issues.

This patch fixes it by moving plugins.go down to options package because
"plugins" in this context are themselves options for users. Registration
of plugins is not an expensive operation and it is already done in most
execution paths.

In future, we may want to revisit these plugins and migrate them to the
shared apiserver repo when appropriate.
2017-08-18 10:32:15 +08:00
Maciej Szulik
43b8715d82
Promote CronJobs to batch/v1beta1 2017-08-16 08:42:21 +02:00
Kubernetes Submit Queue
22af024093 Merge pull request #49412 from bjhaid/etcd_healthz_endpoint
Automatic merge from submit-queue (batch tested with PRs 49989, 49806, 49649, 49412, 49512)

This adds an etcd health check endpoint to kube-apiserver

addressing https://github.com/kubernetes/kubernetes/issues/48215.

**What this PR does / why we need it**:
This ensures kube-apiserver `/healthz` endpoint fails whenever connectivity cannot be established to etcd, also ensures the etcd preflight checks works with unix sockets

**Which issue this PR fixes**: fixes #48215

**Special notes for your reviewer**:
This PR does not use the etcd client directly as the client object is wrapped behind the storage interface and not exposed directly for use, so I decided to reuse what's being done in the preflight. So this will only check fail for connectivity and not etcd auth related problems. I did not write tests for the endpoint because I couldn't find examples that I could follow for writing tests for healthz related endpoints, I'll be willing to write those tests if someone can point me at a relevant one.

**Release note**:
```release-note
Add etcd connectivity endpoint to healthz
```

@deads2k please help review, thanks!
2017-08-02 17:06:02 -07:00
bjhaid
47d748c5dc This adds an etcd health check endpoint to kube-apiserver
addressing https://github.com/kubernetes/kubernetes/issues/48215.
2017-08-01 21:37:52 +00:00
mbohlool
400b77b48f Update main repo references to new kube-openapi repo 2017-08-01 03:37:16 -07:00
Janet Kuo
6eaf6884fb Bump ReplicaSet to apps/v1beta2 2017-07-26 09:51:41 -07:00
foxish
14d5793869 DS: changes to server and storage 2017-07-25 11:47:57 -07:00
deads2k
151d39682e add reflector metrics 2017-07-25 09:01:37 -04:00
deads2k
b00d19608a expose RegisterAllAdmissionPlugins so that admission chains can be built reused 2017-07-18 13:30:06 -04:00
Jacob Simpson
29c1b81d4c Scripted migration from clientset_generated to client-go. 2017-07-17 15:05:37 -07:00
Dr. Stefan Schimanski
5835cfbcce kube-apiserver: add integration test with real Run() func
- for simple Run()
- for aggregation API group priorities
- for CRD creation
2017-07-12 08:47:25 +02:00
Dr. Stefan Schimanski
39e6bbb78b kube-apiserver: make apiserver chain testable 2017-07-12 08:47:25 +02:00
deads2k
0801ded425 remove dead code 2017-07-07 09:12:29 -04:00
deads2k
3ee458d246 remove tpr API access 2017-07-03 11:25:59 -04:00
Kubernetes Submit Queue
aac42add77 Merge pull request #47443 from p0lyn0mial/use_incluster_cfg_when_creating_ext_informers
Automatic merge from submit-queue (batch tested with PRs 48012, 47443, 47702, 47178)

incluster config will be used when creating external shared informers.

**What this PR does / why we need it**:
Previously the loopback configuration was used to talk to the server.
As a consequence a custom API server was unable to talk to the root API server.
This PR changes the above by using incluster configuration to create shared informers.

**Release note**:

```release-note
NONE
```
2017-06-26 17:48:01 -07:00
p0lyn0mial
074544b3b0 incluster config will be used when creating external shared informers.
previously the loopback configuration was used to talk to the server.
As a consequence a custom API server was unable to talk to the root API server.
2017-06-22 21:48:50 +02:00
Kubernetes Submit Queue
96716d3eb4 Merge pull request #47857 from deads2k/agg-35-routing
Automatic merge from submit-queue (batch tested with PRs 47878, 47503, 47857)

restore working aggregator and avoid duplicate informers

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

This runs the informer all the way through and makes sure its started.

@lavalamp ptal
@kubernetes/sig-api-machinery-bugs
2017-06-21 21:12:18 -07:00
deads2k
f525c0815e restore working aggregator and avoid duplicate informers 2017-06-21 15:14:59 -04:00
Kubernetes Submit Queue
3ea93b2753 Merge pull request #47822 from liggitt/secret-storage-config
Automatic merge from submit-queue

Separate serviceaccount and secret storage config

Fixes #47815, and is required in order to enable the secret encryption feature with a recommended configuration

This passes distinct storage options for serviceaccounts and secrets, since secrets can now have an encrypting transformer associated with them
2017-06-21 08:01:37 -07:00
Jordan Liggitt
3de8e52c8a
Separate serviceaccount and secret storage config 2017-06-20 23:49:10 -04:00
Daniel Smith
cadaaa349a Plumb service resolver to webhook AC 2017-06-16 16:45:14 -07:00
Matt Liggett
f6bcac3fec Add version and flag info to apiserver and CM logs.
Should help debugging.
Specifically for #45706
2017-06-15 11:38:11 -07:00
Dr. Stefan Schimanski
342a8fc657 kube-apiserver: cleanup node proxy setup code 2017-06-08 18:20:16 +02:00
Kubernetes Submit Queue
a552ee61a0 Merge pull request #46672 from smarterclayton/initializer_with_config
Automatic merge from submit-queue (batch tested with PRs 46967, 46992, 43338, 46717, 46672)

Select initializers from the dynamic configuration

Continues #36721

kubernetes/features#209
2017-06-05 20:27:50 -07:00
Kubernetes Submit Queue
f893cddfba Merge pull request #46460 from sakshamsharma/location_transformer
Automatic merge from submit-queue (batch tested with PRs 46550, 46663, 46816, 46820, 46460)

Add configuration for encryption providers

## Additions

Allows providing a configuration file (using flag `--experimental-encryption-provider-config`) to use the existing AEAD transformer (with multiple keys) by composing mutable transformer, prefix transformer (for parsing providerId), another prefix transformer (for parsing keyId), and AES-GCM transformers (one for each key). Multiple providers can be configured using the configuration file.

Example configuration:
```
kind: EncryptionConfig
apiVersion: v1
resources:
  - resources:
    - namespaces
    providers:
    - aes:
        keys:
        - name: key1
          secret: c2vjcmv0iglzihnly3vyzq==
        - name: key2
          secret: dghpcybpcybwyxnzd29yza==
    - identity: {}
```

Need for configuration discussed in:
#41939
[Encryption](3418b4e4c6/contributors/design-proposals/encryption.md)

**Pathway of a read/write request**:
1. MutableTransformer
2. PrefixTransformer reads the provider-id, and passes the request further if that matches.
3. PrefixTransformer reads the key-id, and passes the request further if that matches.
4. GCMTransformer tries decrypting and authenticating the cipher text in case of reads. Similarly for writes.

## Caveats
1. To keep the command line parameter parsing independent of the individual transformer's configuration, we need to convert the configuration to an `interface{}` and manually parse it in the transformer. Suggestions on better ways to do this are welcome.

2. Flags `--encryption-provider` and `--encrypt-resource` (both mentioned in [this document](3418b4e4c6/contributors/design-proposals/encryption.md) ) are not supported in this because they do not allow more than one provider, and the current format for the configuration file possibly supersedes their functionality.

3. Currently, it can be tested by adding `--experimental-encryption-provider-config=config.yml` to `hack/local-up-cluster.sh` on line 511, and placing the above configuration in `config.yml` in the root project directory.

Previous discussion on these changes:
https://github.com/sakshamsharma/kubernetes/pull/1

@jcbsmpsn @destijl @smarterclayton

## TODO
1. Investigate if we need to store keys on disk (per [encryption.md](3418b4e4c6/contributors/design-proposals/encryption.md (option-1-simple-list-of-keys-on-disk)))
2. Look at [alpha flag conventions](https://github.com/kubernetes/kubernetes/blob/master/pkg/features/kube_features.go)
3. Need to reserve `k8s:enc` prefix formally for encrypted data. Else find a better way to detect transformed data.
2017-06-05 16:43:48 -07:00
Clayton Coleman
772ab8e1b4
Load initializers from dynamic config
Handle failure cases on startup gracefully to avoid causing cascading
errors and poor initialization in other components. Initial errors from
config load cause the initializer to pause and hold requests. Return
typed errors to better communicate failures to clients.

Add code to handle two specific cases - admin wants to bypass
initialization defaulting, and mirror pods (which want to bypass
initialization because the kubelet owns their lifecycle).
2017-06-05 19:12:41 -04:00
Kubernetes Submit Queue
f28fe811ad Merge pull request #46680 from cheftako/aggregate
Automatic merge from submit-queue (batch tested with PRs 46681, 46786, 46264, 46680, 46805)

Enable Dialer on the Aggregator

Centralize the creation of the dialer during startup.
Have the dialer then passed in to both APIServer and Aggregator.
Aggregator the uses the dialer as its Transport base.

**What this PR does / why we need it**:Enables the Aggregator to use the Dialer/SSHTunneler to connect to the user-apiserver.

**Which issue this PR fixes** : fixes ##46679

**Special notes for your reviewer**:

**Release note**: None
2017-06-03 21:16:46 -07:00
Kubernetes Submit Queue
e837c3bbc2 Merge pull request #46388 from lavalamp/whitlockjc-generic-webhook-admission
Automatic merge from submit-queue (batch tested with PRs 46239, 46627, 46346, 46388, 46524)

Dynamic webhook admission control plugin

Unit tests pass.

Needs plumbing:
* [ ] service resolver (depends on @wfender PR)
* [x] client cert (depends on ????)
* [ ] hook source (depends on @caesarxuchao PR)

Also at least one thing will need to be renamed after Chao's PR merges.

```release-note
Allow remote admission controllers to be dynamically added and removed by administrators.  External admission controllers make an HTTP POST containing details of the requested action which the service can approve or reject.
```
2017-06-02 23:37:42 -07:00
Saksham Sharma
9760d00d08 Add configuration options for encryption providers
Add location transformer, config for transformers

Location transformer helps choose the most specific transformer for
read/write operations depending on the path of resource being accessed.

Configuration allows use of --experimental-encryption-provider-config
to set up encryption providers. Only AEAD is supported at the moment.

Add new files to BUILD, AEAD => k8s-aes-gcm

Use group resources to select encryption provider

Update tests for configuration parsing

Remove location transformer

Allow specifying providers per resource group in configuration

Add IdentityTransformer configuration option

Fix minor issues with initial AEAD implementation

Unified parsing of all configurations

Parse configuration using a union struct

Run configuration parsing in APIserver, refactor parsing

More gdoc, fix minor bugs

Add test coverage for combined transformers

Use table driven tests for encryptionconfig
2017-06-01 20:25:11 -07:00
Walter Fender
5b3f4684ed Enable Dialer on the Aggregator
Centralize the creation of the dialer during startup.
Have the dialer then passed in to both APIServer and Aggregator.
Aggregator the sets the dialer on its Transport base.
This should allow the SSTunnel to be used but also allow the Aggregation
Auth to work with it.
Depending on Environment InsecureSkipTLSVerify *may* need to be set to
true.
Fixed as few tests to call CreateDialer as part of start-up.
2017-06-01 00:05:02 -07:00
Anthony Yeh
ba59e14d44
Add TPR to CRD migration helper. 2017-05-31 19:07:38 -07:00
Daniel Smith
d6e1140b5d Implement dynamic admission webhooks
Also fix a bug in rest client
2017-05-31 16:38:46 -07:00
Kubernetes Submit Queue
b6c00aeb10 Merge pull request #46377 from noah8713/master
Automatic merge from submit-queue (batch tested with PRs 45327, 46217, 46377, 46428, 46588)

Fix comment typo in kube-apiserver and cachesize

**What this PR does / why we need it**:
Fix comment typo in files cmd/kube-apiserver/app/server.go and pkg/registry/cachesize/cachesize.go
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
Not a major issue, just a minor improvement.
**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-05-30 01:56:03 -07:00
Dan Winship
0683e55fc1 Add networking.k8s.io v1 API, with NetworkPolicy 2017-05-28 10:11:01 -04:00
deads2k
18177e2bde move CRD behind TPR 2017-05-26 12:15:13 -04:00
Ginwala
28a0e2621b Fix comment typo in kube-apiserver and cachesize 2017-05-24 13:41:33 -07:00
Kubernetes Submit Queue
95a6f108bd Merge pull request #46289 from p0lyn0mial/admission_plugins_remove_init_blocks
Automatic merge from submit-queue

remove init blocks from all admission plugins

**What this PR does / why we need it**:
removes init blocks from all admission plugins

**Release note**:

```release-note
NONE
```
2017-05-23 17:00:59 -07:00
Kubernetes Submit Queue
3ff99a8381 Merge pull request #46149 from cjcullen/logtoggle
Automatic merge from submit-queue

Allow the /logs handler on the apiserver to be toggled.

Adds a flag to kube-apiserver, and plumbs through en environment variable in configure-helper.sh
2017-05-23 15:19:08 -07:00
p0lyn0mial
c5019bf696 remove init blocks from all admission plugins 2017-05-23 22:00:32 +02:00
CJ Cullen
9dca164ddd Allow the /logs handler on the apiserver to be toggled.
Change-Id: Ibf173b7f85cf7fffe8482eaee74fb77da2b2588b
2017-05-22 14:37:24 -07:00
deads2k
446e959bf7 make CRD apiservice controller 2017-05-22 08:54:14 -04:00
deads2k
a637c49c8d embed apiextensions server into kube-apiserver 2017-05-22 08:53:07 -04:00
Derek Carr
a71bea312a ResourceQuota admission control injects registry 2017-05-18 23:17:13 -04:00
p0lyn0mial
8cea69aa98 This PR implements AdmissionOptions.ApplyTo
ApplyTo adds the admission chain to the server configuration the method lazily initializes a generic plugin
that is appended to the list of pluginInitializers.

apiserver.Config will hold an instance of SharedInformerFactory to ensure we only have once instance.
The field will be initialized in apisever.SecureServingOptions
2017-05-14 10:30:19 +02:00
deads2k
be39283923 plumb stopch to post start hook index since many of them are starting go funcs 2017-05-11 09:16:13 -04:00
deads2k
4389f71576 refactor names for the apiserver handling chain 2017-05-08 07:55:31 -04:00
p0lyn0mial
de9706bc15 Split out AdmissionOptions
In the long term AdmissionOptions will accepts various dependencies
and spit out AdmissionControl
2017-04-18 19:48:14 +02:00
Chao Xu
9d7a8df5ee add gc admission plugin that prevents user who doesn't have delete permission of the owner from setting blockOwnerDeletion 2017-04-13 11:55:22 -07:00
Dr. Stefan Schimanski
63f547e1b1 pkg/admission: make plugin registry non-global 2017-04-12 11:37:25 +02:00
Jordan Liggitt
890894ac4f
Disable RBAC post-start hook if not using the RBAC authorizer 2017-03-30 23:30:04 -04:00
Kubernetes Submit Queue
4159cb57b6 Merge pull request #42835 from deads2k/server-01-remove-insecure
Automatic merge from submit-queue (batch tested with PRs 42835, 42974)

remove legacy insecure port options from genericapiserver

The insecure port has been a source of problems and it will prevent proper aggregation into a cluster, so the genericapiserver has no need for it.  In addition, there's no reason for it to be in the main kube-apiserver flow either.  This pull removes it from genericapiserver and removes it from the shared kube-apiserver code.  It's still wired up in the command, but its no longer possible for someone to mess up and start using in mainline code.

@kubernetes/sig-api-machinery-misc @ncdc
2017-03-27 17:00:21 -07:00
deads2k
cd29754680 move legacy insecure options out of the main flow 2017-03-27 14:07:54 -04:00
deads2k
c2f8ef1b1a move insecure options to kubeapiserver 2017-03-27 13:55:45 -04:00
deads2k
3414231672 proxy to IP instead of name, but still use host verification 2017-03-27 12:33:03 -04:00
Kubernetes Submit Queue
b705835bae Merge pull request #42911 from deads2k/server-04-combined
Automatic merge from submit-queue (batch tested with PRs 43694, 41262, 42911)

combine kube-apiserver and kube-aggregator

This combines several pulls currently in progress and wires them together.  The aggregator sits in front of the normal kube-apiserver and allows local fallthrough instead of proxying.

@kubernetes/sig-api-machinery-misc 
@DirectXMan12 since you seem invested, your life will get easier
@luxas FYI since you've started trying to wire something together.  



Dependent Pulls LGTM:
- [x] https://github.com/kubernetes/kubernetes/pull/42801
- [x] https://github.com/kubernetes/kubernetes/pull/42886
- [x] https://github.com/kubernetes/kubernetes/pull/42900
- [x] https://github.com/kubernetes/kubernetes/pull/42732
- [x] https://github.com/kubernetes/kubernetes/pull/42672
- [x] https://github.com/kubernetes/kubernetes/pull/43141
- [x] https://github.com/kubernetes/kubernetes/pull/43076
- [x] https://github.com/kubernetes/kubernetes/pull/43149
- [x] https://github.com/kubernetes/kubernetes/pull/43226
- [x] https://github.com/kubernetes/kubernetes/pull/43144
2017-03-27 09:30:24 -07:00
Kubernetes Submit Queue
efa5322766 Merge pull request #42896 from deads2k/server-03-codec
Automatic merge from submit-queue (batch tested with PRs 42900, 43044, 42896, 43308, 43621)

require codecfactory

The genericapiserver requires a codec to start.  Help new comers to the API by forcing them to set it when they create a new config.
2017-03-27 08:32:27 -07:00
deads2k
8e26fa25da wire in aggregation 2017-03-27 09:44:10 -04:00
deads2k
087a030221 require codecfactory 2017-03-27 08:19:08 -04:00
deads2k
f31eb0a77f force callers to specify the cert dns names 2017-03-27 07:49:01 -04:00
Kubernetes Submit Queue
b8fc6a093a Merge pull request #43149 from deads2k/server-07-clean-kube-start
Automatic merge from submit-queue

break kube-apiserver start into stages

This is a code shuffle which breaks the kube-apiserver start into
 1. set defaults on the options
 1. create the generic config from the options
 1. create the master config from the generic config and the options

This makes apiserver composition easy/possible later on.
2017-03-25 23:55:50 -07:00
deads2k
4acd751101 break kube-apiserver start into stages 2017-03-22 15:54:16 -04:00
deads2k
5b08029e79 start informers as a post-start-hook 2017-03-16 11:12:17 -04:00
Kubernetes Submit Queue
df70b30e59 Merge pull request #40537 from gnufied/fix-multizone-pv-breakage
Automatic merge from submit-queue

Fix Multizone pv creation on GCE

When Multizone is enabled static PV creation on GCE
fails because Cloud provider configuration is not
available in admission plugins.

cc @derekwaynecarr @childsb
2017-03-05 11:16:46 -08:00
Kubernetes Submit Queue
ef6c5d02b0 Merge pull request #39821 from stu-gott/apiserver-checketcd
Automatic merge from submit-queue (batch tested with PRs 41931, 39821, 41841, 42197, 42195)

Apiserver: wait for Etcd to become available on startup

fixes #37704
2017-03-01 20:07:57 -08:00
Maciej Szulik
c272630b1b Deployments under apps/v1beta1 with new defaults 2017-03-01 15:14:41 +01:00
Stu Gott
85156e3c5c Apiserver: wait for etcd to become available on startup 2017-02-28 12:52:35 -05:00
Hemant Kumar
b0581d688d Fix Multizone pv creation on GCE
When Multizone is enabled static PV creation on GCE
fails because Cloud provider configuration is not
available in admission plugins.
2017-02-28 12:24:14 -05:00
deads2k
5cfe26dece add aggregation integration test 2017-02-28 08:42:06 -05:00
Kubernetes Submit Queue
1a2ec1adcb Merge pull request #41969 from wojtek-t/use_protobufs_for_self_communication_in_apiserver
Automatic merge from submit-queue (batch tested with PRs 41994, 41969, 41997, 40952, 40576)

Use protobufs for self-communication

@deads2k @liggitt
2017-02-26 12:57:56 -08:00
Kubernetes Submit Queue
1519422aba Merge pull request #41814 from deads2k/agg-06-cas
Automatic merge from submit-queue

add client-ca to configmap in kube-public

Client CA information is not secret and it's required for any API server trying to terminate a TLS connection.  This pull adds the information to configmaps in `kube-public` that look like this:


```yaml
apiVersion: v1
data:
  client-ca.crt: |
    -----BEGIN CERTIFICATE-----
    -----END CERTIFICATE-----
  requestheader-allowed-names: '["system:auth-proxy"]'
  requestheader-client-ca-file: |
    -----BEGIN CERTIFICATE-----
    -----END CERTIFICATE-----
  requestheader-extra-headers-prefix: '["X-Remote-Extra-"]'
  requestheader-group-headers: '["X-Remote-Group"]'
  requestheader-username-headers: '["X-Remote-User"]'
kind: ConfigMap
metadata:
  creationTimestamp: 2017-02-22T17:54:37Z
  name: extension-apiserver-authentication
  namespace: kube-system
  resourceVersion: "6"
  selfLink: /api/v1/namespaces/kube-system/configmaps/extension-apiserver-authentication
  uid: fa1dd328-f927-11e6-8b0e-28d2447dc82b

```

@kubernetes/sig-auth-api-reviews @liggitt @kubernetes/sig-api-machinery-pr-reviews @lavalamp @sttts 


There will need to be a corresponding pull for permissions
2017-02-26 09:32:44 -08:00
deads2k
4a06b69579 add client-ca to configmap in kube-public 2017-02-24 14:51:12 -05:00
Andy Goldstein
022bff7fbe Switch admission to use shared informers 2017-02-23 11:16:09 -05:00
Wojciech Tyczynski
96250a718b Use protobufs for self-communication 2017-02-23 14:40:22 +01:00
Eric Chiang
a0df658b20 kube-apiserver: add a bootstrap token authenticator for TLS bootstrapping 2017-02-21 08:43:55 -08:00
Dr. Stefan Schimanski
5e77d01897 k8s.io/apiserver: straighten EtcdOptions, backend Config and kube RESTOptionsFactory 2017-02-15 10:24:59 +01:00
Dr. Stefan Schimanski
27e01b5c46 k8s.io/apiserver: fixup imports and renamed packages 2017-02-15 10:24:58 +01:00
deads2k
2b6b02c6ba auto-create the loopback token 2017-02-13 11:18:34 -05:00
deads2k
a463540d47 remove duplication of RESTOptionsGetter for kube 2017-02-08 09:08:58 -05:00
deads2k
470cb9d2c9 streamline etcd options for aggregated api server 2017-02-08 09:07:47 -05:00
Kubernetes Submit Queue
fa14198bb2 Merge pull request #41083 from deads2k/apiserver-02-audit
Automatic merge from submit-queue (batch tested with PRs 38796, 40823, 40756, 41083, 41105)

Add more options to the RecommendedOptions struct.

Builds on https://github.com/kubernetes/kubernetes/pull/41028

Adds `AuditOptions` to the `RecommendedOptions`

@sttts @kubernetes/sig-api-machinery-pr-reviews
2017-02-08 00:49:49 -08:00
deads2k
b410b387ee move storage serialization type to etcd options 2017-02-07 13:56:19 -05:00
deads2k
cc75d51897 add feature enablement options to recommendedoptions 2017-02-07 13:56:19 -05:00
deads2k
226af4adc4 move --runtime-config to kubeapiserver 2017-02-07 13:43:13 -05:00
deads2k
51b5d5a51b move auditoptions to separate struct 2017-02-07 13:03:08 -05:00
Kubernetes Submit Queue
42973b0523 Merge pull request #40947 from deads2k/apiserver-04-invert
Automatic merge from submit-queue (batch tested with PRs 41023, 41031, 40947)

apiserver command line options lead to config

Logically command line options lead to config, not the other way around.  We're clean enough now we can actually do the inversion.

WIP because I have some test cycles to fix, but this is all the meat.

@kubernetes/sig-api-machinery-misc
2017-02-07 09:04:41 -08:00
deads2k
250408ee9c apiserver command line options lead to config 2017-02-07 07:57:11 -05:00
deads2k
58992ce8d2 move admission read logic 2017-02-07 07:44:14 -05:00
Dr. Stefan Schimanski
536460e1d9 Mechanical fixup imports: pkg/genericapiserver 2017-02-03 08:15:45 +01:00
Kubernetes Submit Queue
62c9cb4684 Merge pull request #40853 from sttts/sttts-more-cutoffs-7
Automatic merge from submit-queue (batch tested with PRs 35782, 35831, 39279, 40853, 40867)

genericapiserver: cut off more dependencies – episode 7

Follow-up of https://github.com/kubernetes/kubernetes/pull/40822

approved based on #40363
2017-02-02 09:53:52 -08:00
Kubernetes Submit Queue
f66679a4e9 Merge pull request #35782 from piosz/remove-hpa-ext
Automatic merge from submit-queue

Removed HPA objects from extensions api group

fix #29778

``` release-note
HorizontalPodAutoscaler is no longer supported in extensions/v1beta1 version. Use autoscaling/v1 instead.
```

 cc @kubernetes/autoscaling
2017-02-02 09:42:33 -08:00
Dr. Stefan Schimanski
bfe0d50ce8 pkg/genericapiserver/server: cut off from pkg/api 2017-02-02 15:19:01 +01:00
Piotr Szczesniak
a35ad8f6ba Removed HPA objects from extensions api group 2017-02-02 14:09:54 +01:00
mbohlool
9623d05f79 Move post processing/backward compatibility of openapi out of generic package 2017-02-02 00:37:36 -08:00
Kubernetes Submit Queue
c523476d6f Merge pull request #40124 from mbohlool/separation
Automatic merge from submit-queue

Use full package path for definition name in OpenAPI spec

We were using short package name (last part of package name) plus type name for OpenAPI spec definition name. That can result in duplicate names and make the spec invalid. To be sure we will always have unique names, we are going to use full package name as definition name. Also "x-kubernetes-tag" custom field is added to definitions to list Group/Version/Kind for the definitions that has it. This will help clients to discover definitions easier.
Lastly, we've added a reference from old definition names to the new ones to keep backward compatibilities. The list of old definitions will not be updated.

**Release note**:
- Rename OpenAPI definition names to type's full package names to prevent duplicates
- Create OpenAPI extension "x-kubernetes-group-version-kind" for definitions to store Group/Version/Kind
- Deprecate old definition names and create a reference to the new definitions. Old definitions will be removed in the next release.
2017-02-01 12:06:39 -08:00
deads2k
384c873914 remove unneeded storage options 2017-01-31 13:44:39 -05:00
mbohlool
239169a5a4 Use full package path as definition name in OpenAPI 2017-01-30 20:05:18 -08:00
deads2k
9775269fb9 move genericapiserver/server/filters to apiserver 2017-01-27 08:49:30 -05:00
Dr. Stefan Schimanski
3d9449a353 genericapiserver: fix imports 2017-01-19 13:06:47 +01:00
deads2k
01b3b2b461 move admission to genericapiserver 2017-01-18 08:15:19 -05:00
deads2k
52ec66ee85 remove api dependency from admission 2017-01-18 08:09:48 -05:00
deads2k
de725e56e2 prevent anonymous auth and allow all 2017-01-17 10:16:33 -05:00
Dr. Stefan Schimanski
1a7242a84c Move BuildDefaultStorageFactory to kubeapiserver 2017-01-16 14:25:58 +01:00
deads2k
9a8bf348a6 move tunneler out of generic 2017-01-12 08:21:58 -05:00
deads2k
6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Kubernetes Submit Queue
addc6cae4a Merge pull request #38212 from mikedanese/kubeletauth
Automatic merge from submit-queue (batch tested with PRs 38212, 38792, 39641, 36390, 39005)

Generate a kubelet CA and kube-apiserver cert-pair for kubelet auth.

cc @cjcullen
2017-01-10 19:48:09 -08:00
Kubernetes Submit Queue
de59ede6b2 Merge pull request #37784 from bruceauyeung/k8s-branch-fix-glog-message-typo
Automatic merge from submit-queue

fix glog message typo about init deserialization cache and watch cache

**What this PR does / why we need it**:
fix typo  `Initalizing` to `Initializing` 

Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2017-01-06 17:43:32 -08:00
Kubernetes Submit Queue
f76fba0da0 Merge pull request #39435 from sttts/sttts-cloudprovider-to-master
Automatic merge from submit-queue

Move apiserver cloudprovider dep into kubeapiserver
2017-01-05 02:29:11 -08:00
Dr. Stefan Schimanski
f96fa748d8 Move apiserver cloudprovider dep into kubeapiserver 2017-01-05 09:40:03 +01:00
Mike Danese
3ab0e37cc6 implement upgrades 2017-01-04 11:45:57 -08:00
CJ Cullen
d0997a3d1f Generate a kubelet CA and kube-apiserver cert-pair for kubelet auth.
Plumb through to kubelet/kube-apiserver on gci & cvm.
2017-01-03 14:30:45 -08:00
deads2k
2861509b6d refactored admission to avoid internal client references 2017-01-03 15:50:12 -05:00
deads2k
ab1b77673f decouple genericapiserver from non-generic authenticator 2016-12-22 07:48:08 -05:00
deads2k
a3564c0aa8 start kubeapiserver package for sharing between kubeapiserver and federation 2016-12-22 07:43:42 -05:00
Kubernetes Submit Queue
5b2823adb9 Merge pull request #38191 from sttts/sttts-move-master-options
Automatic merge from submit-queue

Move non-generic apiserver code out of the generic packages
2016-12-17 01:25:45 -08:00
Maciej Szulik
9f064c57ce Remove extensions/v1beta1 Job 2016-12-17 00:07:24 +01:00
Dr. Stefan Schimanski
3be6b3c045 pkg/apiserver: remove unused code 2016-12-16 17:47:47 +01:00
Dr. Stefan Schimanski
5e8ca29a76 Clean up apiserver and federation defaulting and validation 2016-12-16 17:23:43 +01:00
Dr. Stefan Schimanski
7267299c3c genericapiserver: move MasterCount and service options into master 2016-12-16 17:23:43 +01:00
Kubernetes Submit Queue
6fa4042211 Merge pull request #38690 from sttts/sttts-swagger-postbuildhandler
Automatic merge from submit-queue

genericapiserver: unify swagger and openapi in config

- make swagger config customizable
- remove superfluous `Config.Enable*` flags for OpenAPI and Swagger.

This is necessary for downstream projects to tweak the swagger spec.
2016-12-14 11:11:02 -08:00
Dr. Stefan Schimanski
cab89a67df genericapiserver: unify swagger and openapi in config 2016-12-14 18:41:04 +01:00
Dr. Stefan Schimanski
e57ef4327f Document broken behaviour with KUBE_API_VERSIONS 2016-12-14 09:35:47 +01:00
Dr. Stefan Schimanski
543417dbf0 Replace apiserver glog.Fatals with fmt.Errorfs 2016-12-14 09:35:47 +01:00
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
bruceauyeung
84fd2f2f76 fix glog message typo
Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2016-12-01 15:24:44 +08: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
deads2k
8eddc7158b stop plumbing options to start 2016-10-03 13:35:00 -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
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
61409c821b Turn embedding into composition: master.Config.{Config -> GenericConfig} 2016-09-29 08:09:39 +02:00
Dr. Stefan Schimanski
8391a19b57 Decouple defaulting from genericapiserver and master 2016-09-28 23:16:09 +02:00
Dr. Stefan Schimanski
b4c6a68036 Unify genericapiserver Config.New() and master Config.New() 2016-09-28 19:19:54 +02:00
Jordan Liggitt
0c36c5e556
Add anonymous auth to the auth chain 2016-09-26 17:19:00 -04:00
Jordan Liggitt
2ac293a0bd
Put loopback authn/authz first in chain 2016-09-25 20:33:25 -04:00
deads2k
f6882e8465 remove storage related fields from genericapiserver 2016-09-22 09:21:34 -04:00
Kubernetes Submit Queue
c46bc88f04 Merge pull request #31491 from dims/fixes-issue-13598
Automatic merge from submit-queue

Allow secure access to apiserver from Admission Controllers

* Allow options.InsecurePort to be set to 0 to switch off insecure access
* In NewSelfClient, Set the TLSClientConfig to the cert and key files
  if InsecurePort is switched off
* Mint a bearer token that allows the client(s) created in NewSelfClient
  to talk to the api server
* Add a new authenticator that checks for this specific bearer token

Fixes #13598
2016-09-21 21:31:56 -07:00
mbohlool
38b2567d8b Move generated openAPI specs out of genericapiserver and make it configurable 2016-09-20 14:06:10 -07:00
Davanum Srinivas
25d4a70827 Allow secure access to apiserver from Admission Controllers
* Allow options.InsecurePort to be set to 0 to switch off insecure access
* In NewSelfClient, Set the TLSClientConfig to the cert and key files
  if InsecurePort is switched off
* Mint a bearer token that allows the client(s) created in NewSelfClient
  to talk to the api server
* Add a new authenticator that checks for this specific bearer token

Fixes #13598
2016-09-20 10:42:21 -04:00
deads2k
a2a6423574 separate RESTStorage by API group 2016-09-20 08:00:50 -04:00
Kubernetes Submit Queue
12d916750e Merge pull request #32387 from sttts/sttts-handler-cleanup
Automatic merge from submit-queue

Cleanup non-rest apiserver handlers

- rename MuxHelper -> PathRecorderMux
- move non-rest handlers into routes packages within genericapiserver and `pkg/routes` (those from master)
- move ui and logs handlers out of genericapiserver (they are
  not generic)
- make version handler configurable (`config.EnableVersion`)
2016-09-16 08:58:06 -07:00
Mike Danese
a765d59932 move informer and controller to pkg/client/cache
Signed-off-by: Mike Danese <mikedanese@google.com>
2016-09-15 12:50:08 -07:00
Dr. Stefan Schimanski
7f78661d0b Cleanup non-rest apiserver handlers
- rename MuxHelper -> PathRecorderMux
- move non-rest handlers into routes packages within genericapiserver and
  `pkg/routes` (those from master)
- move ui and logs handlers out of genericapiserver (they are
  not generic)
- make version handler configurable (`config.EnableVersion`)
2016-09-15 13:22:45 +02:00
Kubernetes Submit Queue
7979801e54 Merge pull request #28860 from ericchiang/separate-apiserver-authz-options
Automatic merge from submit-queue

pkg/genericapiserver/options: don't import pkg/apiserver

Refactor the authorization options for the API server so
pkg/apiserver isn't directly imported by the options package.

Closes #28544

cc @smarterclayton

@madhusudancs, @nikhiljindal I've updated `federation/cmd/federation-apiserver/app/server.go` to include the RBAC options with this change. I don't know if this was intentionally left out in the first place but would like your feedback.
2016-08-21 09:49:14 -07:00
mbohlool
c5f1d63d6f Generates OpenAPI (aka Swagger 2.0) Spec on /swagger.json path 2016-08-18 15:32:04 -07:00
Eric Chiang
b4eaf625a0 pkg/genericapiserver/options: don't import pkg/apiserver
Refactor the authorization options for the API server so
pkg/apiserver isn't directly imported by the options package.
2016-08-18 13:01:50 -07:00
Hongchao Deng
d0938094d9 move new etcd storage into cacher 2016-08-12 18:40:20 -07:00
mksalawa
a806351cc3 Extract etcd options from genericapiserver. 2016-08-09 13:35:53 +02:00
Wojciech Tyczynski
8a8cd06ea4 Configurable cache sizes of cachers 2016-08-09 09:41:48 +02:00
Maciej Szulik
e6c327048e Forced using batch/v2alpha1 for storing ScheduledJob 2016-08-03 17:25:37 +02:00
k8s-merge-robot
2817674715 Merge pull request #29557 from deads2k/make-prefx-configurable
Automatic merge from submit-queue

make the resource prefix in etcd configurable for cohabitation

This looks big, its not as bad as it seems.

When you have different resources cohabiting, the resource name used for the etcd directory needs to be configurable.  HPA in two different groups worked fine before.  Now we're looking at something like RC<->RS.  They normally store into two different etcd directories.  This code allows them to be configured to store into the same location.

To maintain consistency across all resources, I allowed the `StorageFactory` to indicate which `ResourcePrefix` should be used inside `RESTOptions` which already contains storage information.

@lavalamp affects cohabitation.
@smarterclayton @mfojtik prereq for our rc<->rs and d<->dc story.
2016-07-28 03:01:28 -07:00
deads2k
aa3db4d995 make the resource prefix in etcd configurable for cohabitation 2016-07-27 07:51:40 -04:00
k8s-merge-robot
0724a9c4dc Merge pull request #28828 from zte-cloud/failmodify
Automatic merge from submit-queue

modify Failure to failed

use 'failed' is more suitable than 'Failure'
2016-07-25 12:56:15 -07:00
Dominika Hodovska
037d116add Factory for SharedIndexInformers 2016-07-21 14:04:48 +02:00
Dominika Hodovska
ba40a528e1 PluginInitializer as a new part of NewFromPlugins method 2016-07-20 12:53:52 +02:00
Dominika Hodovska
fc0a3c6dcb Allow shareable resources for admission control plugins 2016-07-20 12:53:52 +02:00
lojies
77c6176157 modify Failure to failed 2016-07-12 19:11:24 +08:00
David McMahon
ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Eric Chiang
ef40aa9572 pkg/master: enable certificates API and add rbac authorizer 2016-05-25 14:24:47 -07:00
CJ Cullen
57f96a932f Add expiration LRU cache for webhook token authenticator. 2016-05-18 11:58:11 -07:00
CJ Cullen
eb3b0e78b4 Add a webhook token authenticator plugin. 2016-05-10 14:54:35 -07:00
nikhiljindal
2ffa3b4586 Moving StorageFactory building logic to genericapiserver 2016-05-10 00:57:11 -07:00
Clayton Coleman
e0ebcf4216
Split the storage and negotiation parts of Codecs
The codec factory should support two distinct interfaces - negotiating
for a serializer with a client, vs reading or writing data to a storage
form (etcd, disk, etc). Make the EncodeForVersion and DecodeToVersion
methods only take Encoder and Decoder, and slight refactoring elsewhere.

In the storage factory, use a content type to control what serializer to
pick, and use the universal deserializer. This ensures that storage can
read JSON (which might be from older objects) while only writing
protobuf. Add exceptions for those resources that may not be able to
write to protobuf (specifically third party resources, but potentially
others in the future).
2016-05-05 12:08:23 -04:00
nikhiljindal
16c0e0a21c Deleting duplicate code from federated-apiserver 2016-05-03 14:04:09 -07:00
Hongchao Deng
c0071a1595 add flags to enable etcd3 2016-04-28 09:48:16 +08:00
nikhiljindal
f9f1e21e08 Moving master.SSHTunneler to genericapiserver 2016-04-22 11:47:05 -07:00
deads2k
6670b73b18 make storage enablement, serialization, and location orthogonal 2016-04-21 08:18:55 -04:00
Prashanth Balasubramanian
0ac10c6cc2 PetSet type, apps apigroup 2016-04-20 18:49:31 -07:00
nikhiljindal
50a9aceabb Moving more logic to genericapiserver 2016-04-19 00:03:28 -07:00
deads2k
e8fb35d4d8 refactor resource overrides as positive logic interface 2016-03-28 09:24:49 -04:00
nikhiljindal
1cccfc7074 Disabling swagger ui by default. Adding a flag to enable it 2016-03-23 13:19:22 -07:00
Brian Grant
532ba5a3c6 Merge pull request #21535 from AdoHe/restore_secure_etcd
restore ability to run against secured etcd
2016-03-11 12:14:06 -08:00
AdoHe
7228b9b987 restore ability to run against secured etcd 2016-03-11 11:21:16 -05:00
Wojciech Tyczynski
2f6d034cea Workaround long latency of POST pods 2016-03-03 10:45:43 +01:00
Kris
e664ef922f Move restclient to its own package 2016-02-29 12:05:13 -08:00
k8s-merge-robot
43792754d8 Merge pull request #21469 from wojtek-t/parallel_namespace_deletion
Auto commit by PR queue bot
2016-02-27 07:26:49 -08:00
Wojciech Tyczynski
506899008f Parallelization of namespace deletion 2016-02-25 16:33:25 +01:00
Eric Chiang
3116346161 *: add webhook implementation of authorizer.Authorizer plugin 2016-02-22 11:39:07 -08:00
Eric Tune
ab8cfb968f Enabled batch API group in apiserver 2016-02-19 09:20:56 -08:00
Piotr Szczesniak
264c64ec0d Enabled autoscaling API group in apiserver 2016-02-15 21:39:00 +01:00
Daniel Smith
74400c33ae changes for cross-group moves 2016-02-15 21:39:00 +01:00
k8s-merge-robot
43fb544a4a Merge pull request #21001 from ericchiang/oidc_groups
Auto commit by PR queue bot
2016-02-14 05:24:43 -08:00
Eric Chiang
92d37d5cc5 plugin/pkg/auth/authenticator/token/oidc: get groups from custom claim 2016-02-12 09:58:18 -08:00
Chao Xu
184440f8ef rename release_1_2 to internalclientset 2016-02-05 14:02:28 -08:00
magicwang-cn
d2cf858560 make watch cache sizes configuratable of kube-apiserver 2016-02-05 15:47:27 +08:00
Nikhil Jindal
59820827d4 Merge pull request #20513 from nikhiljindal/apiserverExampleTest
Adding test for apiserver example
2016-02-04 11:28:58 -08:00
nikhiljindal
c7beb9078c Updating methods to return error rather than using glog.Fatalf 2016-02-03 16:00:45 -08:00
Chao Xu
f9f5736b01 grep sed 2016-02-03 13:06:07 -08:00
k8s-merge-robot
843c11e06a Merge pull request #20452 from caesarxuchao/replace-client-kubelet
Auto commit by PR queue bot
2016-02-02 23:46:58 -08:00
Chao Xu
cddd7b56a4 replace client with clientset in kubelet and other places 2016-02-02 20:28:45 -08:00
CJ Cullen
04eb90a5d4 Make tunneler hold tunnels open and healthcheck vs. reopening every 5 minutes.
Also add a test for the Update() logic.
Reordered tunnels vs. storage initialization (prevent a nil ptr panic)
2016-02-02 12:00:29 -08:00
mqliang
b0e06c14e5 add a knob to enable quorum read 2016-01-30 20:32:12 +08:00
Clayton Coleman
4d127dc969 Initialize API servers with negotiated serializers
Pass down into the server initialization the necessary interface for
handling client/server content type negotiation. Add integration tests
for the negotiation.
2016-01-22 01:10:22 -05:00
Clayton Coleman
125ef6fbc8 Support content-type negotiation in the API server
A NegotiatedSerializer is passed into the API installer (and
ParameterCodec, which abstracts conversion of query params) that can be
used to negotiate client/server request/response serialization. All
error paths are now negotiation aware, and are at least minimally
version aware.

Watch is specially coded to only allow application/json - a follow up
change will convert it to use negotiation.

Ensure the swagger scheme will include supported serializations - this
now includes application/yaml as a negotiated option.
2016-01-22 00:12:50 -05:00
nikhiljindal
2ad642d370 Merge registered and latest and move to apimachinery 2016-01-21 14:42:21 -08:00
Harry Zhang
936a11e775 Use networking to hold network related pkgs
Change names of unclear methods

Use net as pkg name for short
2016-01-15 13:46:16 +08:00
nikhiljindal
f8d6c56ba6 Extracting server run code to genericapiserver 2016-01-08 18:34:34 -08:00
Clayton Coleman
c0c707d92d Split apiserver flags and initialization
Make it easier to keep defaults and flags clearly identified.
2016-01-06 21:14:30 -05:00
Clayton Coleman
9dad7e624c Split the serviceaccount package into two parts
Public utility methods and JWT parsing, and controller specific logic.
Also remove the coupling between ServiceAccountTokenGetter and the
authenticator class.
2015-12-26 21:28:12 -05:00
Clayton Coleman
3d5ed379b0 authn.go doesn't belong in pkg/apiserver
apiserver does not need to know about specific authentication
mechanisms, and does not need to take dependencies on all the
authentication packages.
2015-12-26 21:22:22 -05:00
Mike Danese
a09d85bd83 expose master count configuration in a cli option on apiserver 2015-12-18 13:10:41 -08:00
nikhiljindal
2d952aaa87 Extracting APIServer machinery code into a library 2015-12-16 13:54:23 -08:00
k8s-merge-robot
6716290903 Merge pull request #18388 from nikhiljindal/clusterName
Auto commit by PR queue bot
2015-12-16 03:50:11 -08:00
deads2k
d0aaf13920 use constants for group names 2015-12-14 10:04:10 -05:00
nikhiljindal
724b098855 Deleting unused master.ClusterName param 2015-12-11 13:39:19 -08:00
deads2k
ec87d74ecb update InterfacesFor to use GroupVersion 2015-12-11 13:45:41 -05:00
Timothy St. Clair
413d8d18fe Futher storage isolation and removal of the tools interface. 2015-12-09 11:04:14 -06:00
k8s-merge-robot
94752c12a8 Merge pull request #18128 from ZJU-SEL/fix-typo
Auto commit by PR queue bot
2015-12-07 15:59:08 -08:00
He Simei
387d861d4e deprecate confusing flag usage 2015-12-04 09:09:23 +08:00
nikhiljindal
5c556baa2f Removing duplicate NewEtcdStorage code 2015-12-03 01:37:44 -08:00
gmarek
459131fd92 Use KubeletPort reported in NodeStatus instead of cluster-wide master config, take 2. 2015-12-02 13:38:17 +01:00
k8s-merge-robot
a836b1e261 Merge pull request #17326 from caesarxuchao/grooupVersion-lastest
Auto commit by PR queue bot
2015-12-01 05:05:40 -08:00
Chao Xu
6e192760e3 refactoring latest.go GroupVersion;
clean up latest.go GroupVersions;
remove latest.GroupMeta.Group;
remove latest.GroupMeta.Version.
2015-11-30 11:30:21 -08:00
harry
477da92002 Move hostIP detection from master to server
Add PublicAddress in test files

Move valid public addr into util
2015-11-30 16:17:37 +08:00
deads2k
a87d927588 update client.Config to use GroupVersion 2015-11-21 08:29:26 -05:00
feisky
13dce74adb Gendocs for docs/admin/kube-* 2015-10-25 19:24:23 +08:00
nikhiljindal
72914fd81b Updating documentation to reflect the latest status of extension resources 2015-10-21 13:03:33 -07:00
nikhiljindal
7bcc4a6755 Allowing runtimeConfig to support enabling/disabling specific extension resources 2015-10-15 14:24:22 -07:00
k8s-merge-robot
8c753c84eb Merge pull request #15191 from caesarxuchao/validate-UID
Auto commit by PR queue bot
2015-10-15 04:20:24 -07:00
Chao Xu
be0754750f add common fields validation before updaing a resource; make the repair of malformed update request flippable by a flag. 2015-10-13 16:28:32 -07:00
Jordan Liggitt
1043126135 Refactor SSH tunneling, fix proxy transport TLS/Dial extraction 2015-10-12 11:17:01 -04:00
k8s-merge-robot
95b265390e Merge pull request #14900 from mqliang/log
Auto commit by PR queue bot
2015-10-10 09:29:53 -07:00
Chao Xu
80f213c376 "experimental" -> "extensions" 2015-10-09 15:14:03 -07:00
Chao Xu
0b7e3c7dd1 experimental/v1alpha1->extensions/v1beta1 2015-10-09 15:01:33 -07:00
mqliang
5a349aeb58 capitalize the first letter of log files in module cmd 2015-10-06 13:56:37 +08:00
jayvyas
be2a2ec3cd NodePort apiserver option for exposing KubernetesMasterService NodePort on startup. 2015-10-05 20:34:25 -04:00
Wojciech Tyczynski
0f1cbe37a4 Events in separate etcd 2015-10-05 10:54:24 +02:00
eulerzgy
b1be6bc8ea add log err value 2015-09-29 17:09:25 +08:00
Chao Xu
c449baea46 Remove ExpStorageVersion and Add StorageVersions to APIServer struct 2015-09-24 17:44:59 -07:00
Chao Xu
ae1293418b move experimental/v1 to experimental/v1alpha1;
use "group/version" in many places where used to expect "version" only.
2015-09-24 15:32:11 -07:00
k8s-merge-robot
6c30a0e170 Merge pull request #13955 from caesarxuchao/API-discovery
Auto commit by PR queue bot
2015-09-21 14:01:36 -07:00
Chao Xu
1278771b34 let apiserver support api discovery 2015-09-21 12:20:24 -07:00
Federico Simoncelli
f21d9ac9e4 Support pods with containers using host ipc
Add a HostIPC field to the Pod Spec to create containers sharing
the same ipc of the host.

This feature must be explicitly enabled in apiserver using the
option host-ipc-sources.

Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
2015-09-18 21:13:39 +02:00
k8s-merge-robot
445fde3dc5 Merge pull request #13447 from pweil-/pid-mode
Auto commit by PR queue bot
2015-09-16 23:34:35 -07:00
Chao Xu
9bef5ff99d register experimental apis as apis/experimental/..
mark --api-version as deprecated
2015-09-15 11:25:01 -07:00
Paul Weil
ed80c2b940 pid mode 2015-09-15 13:51:44 -04:00
Chao Xu
c733124920 address lavalamp's comments 2015-09-11 17:34:32 -07:00
Chao Xu
3dc5223f4f check if experimental is enabled during startup of client and server 2015-09-11 17:34:32 -07:00
Chao Xu
dd6c121d7f massive changes 2015-09-11 17:31:47 -07:00
Daniel Smith
ccd9e3e247 Run all automated tools 2015-09-11 16:11:08 -07:00
Daniel Smith
4c2adabf42 move; sed replace 2015-09-11 16:03:22 -07:00
k8s-merge-robot
f867ba3ba1 Merge pull request #13682 from ryfow/block-startup-for-cert
Auto commit by PR queue bot
2015-09-10 00:24:23 -07:00
k8s-merge-robot
434f05c0e3 Merge pull request #13705 from liggitt/attach
Auto commit by PR queue bot
2015-09-09 18:19:35 -07:00
k8s-merge-robot
45742e885c Merge pull request #13452 from aveshagarwal/master-api-rate-burst-remove
Auto commit by PR queue bot
2015-09-09 00:42:59 -07:00
Jordan Liggitt
b2268574c5 Add pods/attach to long running requests, protect in admission for privileged pods 2015-09-09 00:49:00 -04:00