Merge pull request #46734 from mbohlool/aggr

Automatic merge from submit-queue (batch tested with PRs 46734, 46810, 46759, 46259, 46771)

OpenAPI aggregation for kube-aggregator

This PR implements OpenAPI aggregation layer for kube-aggregator. On each API registration, it tries to download swagger.spec of the user api server. On failure it will try again next time (either on another add or get /swagger.* on aggregator server) up to five times. To merge specs, it first remove all unrelated paths from the downloaded spec (anything other than group/version of the API service) and then remove all unused definitions. Adding paths are straightforward as they won't have any conflicts, but definitions will most probably have conflicts. To resolve that, we would reused any definition that is not changed (documentation changes are fine) and rename the definition otherwise.

To use this PR, kube aggregator should have nonResourceURLs (for get verb) to user apiserver.

```release-note
Support OpenAPI spec aggregation for kube-aggregator
```

fixes: #43717
This commit is contained in:
Kubernetes Submit Queue
2017-06-05 06:51:20 -07:00
committed by GitHub
20 changed files with 2339 additions and 142 deletions

View File

@@ -48,6 +48,7 @@ openapi_library(
"k8s.io/apiserver/pkg/apis/audit/v1alpha1",
"k8s.io/apiserver/pkg/apis/example/v1",
"k8s.io/client-go/pkg/api/v1",
"k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1",
"k8s.io/metrics/pkg/apis/custom_metrics/v1alpha1",
"k8s.io/metrics/pkg/apis/metrics/v1alpha1",
],