Commit Graph

545 Commits (dd819b5013c99f930a6d528e508a900fa7679c4f)

Author SHA1 Message Date
Kubernetes Submit Queue 9067d35951 Merge pull request #48861 from mbohlool/openapi_aggr
Automatic merge from submit-queue (batch tested with PRs 49992, 48861, 49267, 49356, 49886)

Reintegrate aggregation support for OpenAPI

Reintegrating changes of #46734

Changes summary:

- Extracted all OpenAPI specs to new repo `kube-openapi`
- Make OpenAPI spec aggregator to copy and rename any non-requal model (even with documentation change only).
- Load specs when adding APIServices and retry on failure until successful spec retrieval or a 404.
- Assumes all Specs except aggregator's Spec are static 
- A re-register of any APIService will result in updating the spec for that service (Suggestion for TPR: they should be registered to aggregator API Server, Open for discussion if any more changes needed for another PR.)

fixes #48548
2017-08-02 05:15:57 -07:00
Kubernetes Submit Queue f33297d5c1 Merge pull request #49092 from huangjiuyuan/fix-apiserver-option-test
Automatic merge from submit-queue (batch tested with PRs 49871, 49422, 49092, 49858, 48999)

adding kube-apiserver starting option tests

**What this PR does / why we need it**:
There is only one test for `--enable-swagger-ui` option in `cmd/kube-apiserver/app/options/options_test.go`, I have expanded this test with more kube-apiserver starting options.

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

**Special notes for your reviewer**:

**Release note**:

`NONE`
2017-08-01 23:35:53 -07:00
mbohlool 1806609596 Update Bazel 2017-08-01 03:37:18 -07:00
mbohlool 8c0580d89b Aggregate OpenAPI spec 2017-08-01 03:37:17 -07:00
mbohlool 400b77b48f Update main repo references to new kube-openapi repo 2017-08-01 03:37:16 -07:00
huangjiuyuan 00a3767289 adding kube-apiserver starting option tests
Signed-off-by: huangjiuyuan <jiuyuan.huang@daocloud.io>
2017-07-31 17:21:40 +08:00
mbohlool 88868402b8 Revert "Aggregate OpenAPI specs"
This reverts commit 1a1d9a0394.
2017-07-28 14:02:36 -07:00
Janet Kuo 6eaf6884fb Bump ReplicaSet to apps/v1beta2 2017-07-26 09:51:41 -07:00
Kubernetes Submit Queue 06e3a00a14 Merge pull request #47252 from sttts/sttts-crd-initializers
Automatic merge from submit-queue (batch tested with PRs 43443, 46193, 49071, 47252)

custom-resources: add initializer test
2017-07-25 21:52:52 -07:00
foxish 14d5793869 DS: changes to server and storage 2017-07-25 11:47:57 -07:00
Dr. Stefan Schimanski 7185624688 kube-apiserver: add CRD initializer test 2017-07-25 16:52:40 +02:00
deads2k 151d39682e add reflector metrics 2017-07-25 09:01:37 -04:00
Janet Kuo 767082e8e9 Add new API version apps/v1beta2
Add a new API version apps/v1beta2 and enable it by default.
apps/v1beta2 has a copy of apps/v1beta1 types, except for
ControllerRevision.
2017-07-20 10:25:21 -07: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
Kubernetes Submit Queue d7528e8e93 Merge pull request #44129 from xiangpengzhao/flags-clean
Automatic merge from submit-queue (batch tested with PRs 44129, 48030, 48906)

Add default=false to usage of kube-apiserver allow-privileged flag

**What this PR does / why we need it**:
Users will be clear about default value of `allow-privileged` flag.
2017-07-15 17:13: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
Kubernetes Submit Queue c10cc3decd Merge pull request #48353 from deads2k/tpr-17-delete-01
Automatic merge from submit-queue (batch tested with PRs 48480, 48353)

remove tpr api access

xref https://github.com/kubernetes/kubernetes/issues/48152

TPR tentacles go pretty deep. This gets us started by removing API access and we'll move down from there.

@kubernetes/sig-api-machinery-misc 
@ironcladlou this should free up the GC implementation since TPRs will no longer be present and failing.

```release-note
Removing TPR api access per https://github.com/kubernetes/kubernetes/issues/48152
```
2017-07-05 05:49:30 -07:00
Kubernetes Submit Queue 0ec36bdc8f Merge pull request #47043 from CaoShuFeng/validate_audit
Automatic merge from submit-queue

Add Validate() function for audit options

**Release note**:

```
NONE
```
Fixes: #47114
2017-07-04 08:48:20 -07: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
Kubernetes Submit Queue 6bab8dc493 Merge pull request #46812 from lavalamp/whitlockjc-plumbing
Automatic merge from submit-queue (batch tested with PRs 47726, 47693, 46909, 46812)

Plumb service resolver into webhook AC

This is the last piece of plumbing needed for https://github.com/kubernetes/features/issues/209
2017-06-19 18:34:06 -07:00
Chao Xu 743732f9cf add admissionregistration to the list 2017-06-16 17:20:24 -07:00
Daniel Smith 6ff1a9829d generated files 2017-06-16 16:45:14 -07: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
deads2k 963c85e1c8 sort current API versions and fallback for others 2017-06-14 09:29:44 -04:00
deads2k d13ad28420 add group priority to apiservice 2017-06-14 09:29:44 -04:00
Dr. Stefan Schimanski 342a8fc657 kube-apiserver: cleanup node proxy setup code 2017-06-08 18:20:16 +02:00
Cao Shufeng cf8e3ccf19 Add Validate() function for audit options 2017-06-07 16:53:02 +08:00
Kubernetes Submit Queue 4a01f44b73 Merge pull request #46988 from p0lyn0mial/rename_some_admission_pkg
Automatic merge from submit-queue (batch tested with PRs 46718, 46828, 46988)

Simply changed the names of packages of some admission plugins.

**What this PR does / why we need it**:
This PR simply changes the names of packages of some admission plugins so that they are not in conflict with admission pkg.

**Release note**:

```release-note
NONE
```
2017-06-06 11:43:20 -07:00
Dr. Stefan Schimanski 33e50da9f4 Rename {kube- ->}apiextensions-{-> api}server 2017-06-06 12:06:31 +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
Anirudh Ramanathan cc294cfb7e Merge pull request #46985 from deads2k/controller-09-agg-health
make the health check wait for ready apiservices
2017-06-05 14:33:23 -07:00
p0lyn0mial d0e89577db Simply changed the names of packages of some admission plugins. 2017-06-05 22:23:42 +02:00
deads2k 0ad98c29f0 make the health check wait for ready apiservices 2017-06-05 15:05:33 -04:00
mbohlool 1a1d9a0394 Aggregate OpenAPI specs 2017-06-04 21:54:11 -07: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 7d599cc190 Merge pull request #46724 from deads2k/agg-32-startup
Automatic merge from submit-queue (batch tested with PRs 36721, 46483, 45500, 46724, 46036)

stop special casing the loopback connection for aggregator

Fixes a TODO for the aggregator loopback connection.
2017-06-03 08:08:42 -07:00
Kubernetes Submit Queue 07f85565a2 Merge pull request #36721 from smarterclayton/initializers
Automatic merge from submit-queue

Add initializer support to admission and uninitialized filtering to rest storage

Initializers are the opposite of finalizers - they allow API clients to react to object creation and populate fields prior to other clients seeing them.

High level description:

1. Add `metadata.initializers` field to all objects
2. By default, filter objects with > 0 initializers from LIST and WATCH to preserve legacy client behavior (known as partially-initialized objects)
3. Add an admission controller that populates .initializer values per type, and denies mutation of initializers except by certain privilege levels (you must have the `initialize` verb on a resource)
4. Allow partially-initialized objects to be viewed via LIST and WATCH for initializer types
5. When creating objects, the object is "held" by the server until the initializers list is empty
6. Allow some creators to bypass initialization (set initializers to `[]`), or to have the result returned immediately when the object is created.

The code here should be backwards compatible for all clients because they do not see partially initialized objects unless they GET the resource directly. The watch cache makes checking for partially initialized objects cheap. Some reflectors may need to change to ask for partially-initialized objects.

```release-note
Kubernetes resources, when the `Initializers` admission controller is enabled, can be initialized (defaulting or other additive functions) by other agents in the system prior to those resources being visible to other clients.  An initialized resource is not visible to clients unless they request (for get, list, or watch) to see uninitialized resources with the `?includeUninitialized=true` query parameter.  Once the initializers have completed the resource is then visible.  Clients must have the the ability to perform the `initialize` action on a resource in order to modify it prior to initialization being completed.
```
2017-06-03 07:16:52 -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