Commit Graph

826 Commits

Author SHA1 Message Date
Kubernetes Publisher b32f4d5e87 Merge pull request #52835 from FengyunPan/Versionless-Endpoint
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

Update gophercloud to Handle New Identity Endpoints

Currently openstack cloud provider just support keystone v2.0 and v3
The latest Identity Service is publishing an ID of v3.8, we should
update gophercloud to recognize v3.8 as a valid version id.

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

**Release note**:
```release-note
NONE
```

Kubernetes-commit: 4f2d7b93da2464a3147e0a7e71d896dd2bade9ad
2017-10-16 06:46:49 +00:00
Kubernetes Publisher 153c435cb3 Merge pull request #52873 from ixdy/bazel-cleanup
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

bazel: build/test almost everything

**What this PR does / why we need it**: Miscellaneous cleanups and bug fixes. The main motivating idea here was to make `bazel build //...` and `bazel test //...` mostly work. (There's a few reasons these still don't work, but we're a lot closer.)

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

/assign @BenTheElder @mikedanese @spxtr

Kubernetes-commit: 7c9e614cbb507b094d82301c5ea4d26f075eed82
2017-10-16 06:45:59 +00:00
Kubernetes Publisher 57baa7511f Merge pull request #52933 from liggitt/proxy-subpath-slash
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

Preserve leading and trailing slashes on proxy subpaths

subresource parsing was not populating path parameters correctly (leading and trailing slashes were being stripped)

this caused bad locations to be sent to the proxy, causing https://github.com/kubernetes/kubernetes/issues/52022. the first attempt to fix that (#52065) unconditionally prefixed '/', which broke the redirect case (#52813 #52729)

fixes #52813, fixes #52729

needs to be picked to 1.7 and 1.8

```release-note
Restores redirect behavior for proxy subresources
```

Kubernetes-commit: e0f75338b5720fbce0aa02b0cf79965950089dbc
2017-10-16 06:45:58 +00:00
Kubernetes Publisher d3a765e206 Merge pull request #52182 from cheftako/flags
Automatic merge from submit-queue (batch tested with PRs 51438, 52182, 51607, 47912, 51595). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

Ensure we log the flag apiserver starts with.

Trying to make sure we always log the flags an instance of apiserver
starts with.
This can be especially valuable for emailed logs or e2e/kubemark tests.

**What this PR does / why we need it**: Ensures we log the flags an apiserver was started with.

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

**Special notes for your reviewer**:

**Release note**:```release-note NONE
```

Kubernetes-commit: d2cf4d01c69881e65f8a9d38b9baad70d1eacdb3
2017-10-16 06:45:58 +00:00
Kubernetes Publisher e487f0d4e0 Merge pull request #52069 from shiywang/cleanup-api
Automatic merge from submit-queue (batch tested with PRs 51929, 52015, 51906, 52069, 51542). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

move specialDefaultResourcePrefixes out of vendor/k8s.io/apiserver

just a clean-up, fixes TODO: move out of this package, it is not generic
@sttts PTAL
/assign @sttts

Kubernetes-commit: 7240b1e2eec6399e3549e0d9840e0d1ea468df67
2017-10-16 06:45:57 +00:00
Kubernetes Publisher 6bd289fcaa Merge pull request #51888 from tengqm/fix-api-server-help
Automatic merge from submit-queue (batch tested with PRs 51031, 51705, 51888, 51727, 51684). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

Avoid hard-coding location for auto-generated cert files

**What this PR does / why we need it**:
This fixes the confusing/incorrect help message for "--tls-cert-file" in apiserver package.

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

**Special notes for your reviewer**:
Please advise if a release note is needed.

**Release note**:
```release-note
NONE
```

Kubernetes-commit: 3484ae9e496eb0b4e24fb646db39e51440c1c135
2017-10-16 06:45:56 +00:00
Jordan Liggitt 78261d54df Preserve leading and trailing slashes on proxy subpaths
Kubernetes-commit: 04eede9b2a2a24571cb084fcb952c6a2a2a2bdd1
2017-09-22 22:35:20 -04:00
Kubernetes Publisher c1e53d745d Merge pull request #52710 from sttts/sttts-less-aggressive-staging-godep-mangling
Automatic merge from submit-queue (batch tested with PRs 52843, 52710, 52821, 52844). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

update-staging-godeps: only mangle staging repos in staging Godeps.json

- this re-adds non-staging k8s.io/* repos to the staging Godeps.jsons
- x-outs instead of removing of staging dependencies in order to get a
  precise trigger for a complete godep restore+save run in the publisher
  bot.

The first breaks k8s.io/kube-aggregator's staging export.

The second potentially leads to inconsistent godeps in our exported staging repos.

Kubernetes-commit: 3ba46ee9fab32ccaeeee4af4a80375e6e1d71ace
2017-09-22 11:42:57 +00:00
Kubernetes Publisher 4770ca60b0 Update staging godeps
Kubernetes-commit: 678eeb54da07fb33e3860bc670e6b101a966a47d
2017-09-22 11:42:07 +00:00
Kubernetes Publisher 8e3f903391 Merge pull request #52790 from sttts/sttts-conversion-gen-vendor-independent
Automatic merge from submit-queue (batch tested with PRs 52477, 52790, 52798). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

conversion-gen: make staging dirs independent of living in vendor/

The `+k8s:conversion-gen` tags included the package directory inside of kube's vendor dir. This
makes them invalid when we publish staging repos.

Without this PR our sample-apiserver example code-generation is broken once published.

Kubernetes-commit: 74ff323f9e546e62288d331f62a37e0ec58f6b35
2017-09-22 11:42:06 +00:00
Kubernetes Publisher 69cfac46ed Merge pull request #52466 from charrywanganthony/audit-2
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

Update the test under audit/policy

Small change to cope with [previous review](https://github.com/kubernetes/kubernetes/pull/51782#pullrequestreview-61526174)
@crassirostris

Kubernetes-commit: 2d7192c54afe7d946bdaa9534958cfd06adbc0cf
2017-09-22 11:42:06 +00:00
Kubernetes Publisher 7b23343a61 conversion-gen: make staging dirs independent of living in vendor/
Kubernetes-commit: f5451127512e42294564efae97d4cb669df54f49
2017-09-22 11:42:06 +00:00
Kubernetes Publisher d7e7a0ab18 Update the test under audit policy
Kubernetes-commit: ea1694eab1a1b251b31ce006cc48594a7eb05add
2017-09-22 11:42:06 +00:00
Jeff Grafton eabf5a2c6e Use buildozer to delete licenses() rules
Kubernetes-commit: 02fb4200dcdf8636eac5953d04b2c4af912f443b
2017-09-21 14:54:29 -07:00
Jeff Grafton ecbbfb0461 Use buildozer to remove deprecated automanaged tags
Kubernetes-commit: 532bd482dfbe25c6fc970d2175f7e02fec2fc8c0
2017-09-21 14:53:56 -07:00
FengyunPan 0b6b17905d Update gophercloud to Handle New Identity Endpoints
Currently openstack cloud provider just support keystone v2.0 and v3
The latest Identity Service is publishing an ID of v3.8, we should
update gophercloud to recognize v3.8 as a valid version id.

Kubernetes-commit: f98326b7f9364f6a5c3e336af1279833713e73c9
2017-09-21 18:58:13 +08:00
Kubernetes Publisher e82569769e Merge pull request #43152 from ncdc/watch-cache-retry-live-object-on-conflict
Automatic merge from submit-queue (batch tested with PRs 52176, 43152). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

etcd3 store: retry with live object on conflict if there was a suggestion

Retry with a live object instead of the cached version if the watch
cache receives a conflict trying to do the update.

Fixes #41892

Kubernetes-commit: d48611a1da00a2fe32011404fe25fb6af51673a5
2017-09-16 09:45:31 -07:00
Kubernetes Publisher 0f62a50c16 etcd3 store: retry w/live object on conflict
In GuaranteedUpdate, if it was called with a suggestion (e.g. via the
watch cache), and the suggested object is stale, perform a live lookup
and then retry the update.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>

Kubernetes-commit: bf33df16b52508974ddedacd814010cfe0fb79f0
2017-09-22 11:42:06 +00:00
Kubernetes Publisher 90c569d37e Merge pull request #52544 from shyamjvs/increase-window-of-prometheus-metric
Automatic merge from submit-queue

Increase sliding window to 5hr for request_latencies metric

We're seeing high latency values for a couple of types of api calls in our density test (ref https://github.com/kubernetes/kubernetes/issues/51899). And we're recording values from only the last 1 hour in the metric (as @wojtek-t told me offline) - so our test result is pretty much counting only the calls during the delete phase.

cc @kubernetes/sig-scalability-misc @kubernetes/sig-api-machinery-misc @gmarek

Kubernetes-commit: 9ef9a1b8f032ecccee94aff773e9db13b9b7ced6
2017-09-15 09:19:06 -07:00
Kubernetes Publisher 8fc21589fe Increase sliding window to 5hr for request_latencies metric
Kubernetes-commit: e1ba3da16c9bebccb3902952d56b59f2e2dbb900
2017-09-22 11:42:05 +00:00
Kubernetes Publisher 15e7adf3e2 Merge pull request #52543 from shyamjvs/add-more-traces-to-delete-resource-handler
Automatic merge from submit-queue

Add extra steps to delete resource handler trace

Based on https://github.com/kubernetes/kubernetes/issues/51899#issuecomment-329786131

cc @kubernetes/sig-scalability-misc @kubernetes/sig-api-machinery-misc @gmarek

Kubernetes-commit: 9f954c146f37261aa62981b7505f9ba0dcb255e1
2017-09-15 08:27:43 -07:00
Kubernetes Publisher 5efaef8eee Merge pull request #52237 from smarterclayton/watch_metric
Automatic merge from submit-queue (batch tested with PRs 51824, 50476, 52451, 52009, 52237)

Improve apiserver metrics reporting

Normalize "WATCHLIST" to "WATCH", add "scope" to the other metrics (listing 50k pods is != listing pods in a namespace), and add a new scope "resource" to cover individual resource calls.

This roughly aligns metrics with our ACL model (technically resource scope is GET, but POST to a subresource and POST to a namespace are not the same thing).

```release-note
WATCHLIST calls are now reported as WATCH verbs in prometheus for the apiserver_request_* series.  A new "scope" label is added to all apiserver_request_* values that is either 'cluster', 'resource', or 'namespace' depending on which level the query is performed at.
```

Kubernetes-commit: 93ddb7be5f547f5ebb0a60bd1135234fdf4e3c07
2017-09-22 11:42:05 +00:00
Kubernetes Publisher 24ccf40372 Add extra steps to delete resource handler trace
Kubernetes-commit: 6089cadab3d136455b1b4376d819464fb0d2379a
2017-09-22 11:42:05 +00:00
Kubernetes Publisher 7d0b0b91fc Report "resource" scope where possible
Also rename the variables to match the concept

Kubernetes-commit: c13a3c03201c9082c4b373b7af8b99d7effd5a62
2017-09-22 11:42:04 +00:00
Kubernetes Publisher 7727b5a3a8 Report scope on all apiserver metrics
Counting list of namespaces is != list across all namespaces (same for
latency)

Kubernetes-commit: 545aba778d5d039a3b8a0f0939fdf8f8261ae1a8
2017-09-22 11:42:04 +00:00
Kubernetes Publisher 4c578f11a1 Normalize WATCHLIST to WATCH in metrics
This causes confusion and doesn't match what we authorize on

Kubernetes-commit: 5e46d5b5450f7e7db87e860440f1bb1f8f523ffa
2017-09-22 11:42:04 +00:00
Kubernetes Publisher 19667a1afc sync: update godeps 2017-09-09 21:45:29 +00:00
Kubernetes Publisher 338b91b284 Merge pull request #52112 from smarterclayton/watch
Automatic merge from submit-queue (batch tested with PRs 50949, 52155, 52175, 52112, 52188)

Allow watch cache to be disabled per type

Currently setting watch cache size for a given resource does not disable
the watch cache. This commit adds a new `default-watch-cache-size` flag
to map to the existing field, and refactors how watch cache sizes are
calculated to bring all of the code into one place. It also adds debug
logging to startup to allow us to verify watch cache enablement in
production.

Part of #51825 

Will allow watch cache to be disabled selectively.

Kubernetes-commit: e1bf145c9fb8766ee3be3f0e06175dd9da3cbe5d
2017-09-08 15:11:31 -07:00
Clayton Coleman 644d9a8cf1 Allow watch cache to be disabled per type
Currently setting watch cache size for a given resource does not disable
the watch cache. This commit adds a new `default-watch-cache-size` flag
to map to the existing field, and refactors how watch cache sizes are
calculated to bring all of the code into one place. It also adds debug
logging to startup to allow us to verify watch cache enablement in
production.

Kubernetes-commit: fc2d201e155296f311ae0a9278b00dcae2d68708
2017-09-09 21:44:33 +00:00
Walter Fender 9a6c2541ac Ensure we log the flag apiserver starts with.
Trying to make sure we always log the flags an instance of apiserver
starts with.
This can be especially valuable for emailed logs or e2e/kubemark tests.

Kubernetes-commit: 366459aee84a4de1f0342a464bd479a5d12e6f0f
2017-09-08 10:00:50 -07:00
Kubernetes Publisher 94baeb40da Merge pull request #52030 from soltysh/creationtimestamp_audit
Automatic merge from submit-queue (batch tested with PRs 51900, 51782, 52030)

Fill in creationtimestamp in audit events

**What this PR does / why we need it**:
This is fixing null creationtimestamp in audit events.

@sttts @crassirostris like we've talked earlier today

**Release note**:
```release-note
none
```

Kubernetes-commit: 36b3a0d75b177f7fb3b68750b46dd4c2aeb45664
2017-09-08 09:46:36 -07:00
Maciej Szulik 6959d4a79a Fill in creationtimestamp in audit events
Kubernetes-commit: 3dd3e7aa5243228b49211f4bb40022a719cc57ac
2017-09-09 21:44:33 +00:00
Kubernetes Publisher f20cf13f23 Merge pull request #51782 from charrywanganthony/audit-1
Automatic merge from submit-queue (batch tested with PRs 51900, 51782, 52030)

A policy with 0 rules should return an error

**Which issue this PR fixes** 
[isuue#51565](https://github.com/kubernetes/kubernetes/issues/51565)

**Release note**: 
``` 
An audit policy file with 0 rule returns an error.
```

Kubernetes-commit: 4a72b32d3693e4f53c004c48d7ff58f628289fa6
2017-09-08 09:46:33 -07:00
Kubernetes Publisher 9e4b4be3a5 Merge pull request #51900 from sttts/sttts-informer-stratification
Automatic merge from submit-queue (batch tested with PRs 51900, 51782, 52030)

apiservers: stratify versioned informer construction

The versioned share informer factory has been part of the GenericApiServer config,
but its construction depended on other fields of that config (e.g. the loopback
client config). Hence, the order of changes to the config mattered.

This PR stratifies this by moving the SharedInformerFactory from the generic Config
to the CompleteConfig struct. Hence, it is only filled during completion when it is
guaranteed that the loopback client config is set.

While doing this, the CompletedConfig construction is made more type-safe again,
i.e. the use of SkipCompletion() is considereably reduced. This is archieved by
splitting the derived apiserver Configs into the GenericConfig and the ExtraConfig
part. Then the completion is structural again because CompleteConfig is again
of the same structure: generic CompletedConfig and local completed ExtraConfig.

Fixes #50661.

Kubernetes-commit: 63d6bdb58c864de4f42ff139cb0a044a35f7a36f
2017-09-09 21:44:32 +00:00
Chao Wang 221a6a181e A policy with 0 rules should return an error
Kubernetes-commit: 0ad4282fd0b31e1d12b711696efb134bdc2f83cc
2017-09-09 21:44:32 +00:00
Dr. Stefan Schimanski 9f41d17af2 Update bazel
Kubernetes-commit: fbd310dbc7312fcae4267dd64326a1e7b4a0a8ae
2017-09-09 21:44:32 +00:00
Dr. Stefan Schimanski a063c5336d apiserver: avoid panics on nil sub-option structs
Kubernetes-commit: b153268da79d2acf14e042945959801c3dba8221
2017-09-09 21:44:32 +00:00
Dr. Stefan Schimanski 97e22b00fa apiserver: split core API creation from secure serving
Kubernetes-commit: 2b64d3a0fd2ccdad4b2f21acb484a36e04381856
2017-09-09 21:44:32 +00:00
Dr. Stefan Schimanski 75cf96f31e apiserver: stratify versioned informer construction
Kubernetes-commit: ca3f7453464f6866a3bf467c8b9d8e132484cfb4
2017-09-09 21:44:32 +00:00
Dr. Stefan Schimanski 8ec769da6b apiserver: allow disabling authz/n via options
Kubernetes-commit: dffe50f8bd820295f7f1fbc56a6269b6b8c6966b
2017-09-09 21:44:32 +00:00
Dr. Stefan Schimanski e4b1b0656b apiserver: make config completion structural recursion
Kubernetes-commit: 1bcea54104cb7f53e58924dd5413cf4ba7ceb587
2017-09-09 21:44:32 +00:00
Kubernetes Publisher 2afdeada7b Merge pull request #52071 from CaoShuFeng/warning
Automatic merge from submit-queue (batch tested with PRs 52091, 52071)

Log a warning when --audit-policy-file not passed to apiserver

When audit backend provided, but --audit-policy-file is not passed, leave a info in log.
**Release note**:
```
Log a warning when --audit-policy-file not passed to apiserver
```

Kubernetes-commit: 500642602210088447c9dcd7abe2e26815f271ed
2017-09-08 04:57:59 -07:00
Kubernetes Publisher 2c3f99c328 Merge pull request #51932 from dixudx/fix_forbidden_messages
Automatic merge from submit-queue

fix format of forbidden messages

**What this PR does / why we need it**:

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

**Special notes for your reviewer**:
/assign @deads2k @liggitt

**Release note**:

```release-note
None
```

Kubernetes-commit: 45fe0a9e0417eb148c3082c53ae16da7377a2c32
2017-09-09 21:44:31 +00:00
Cao Shufeng d2f7a0c820 Log a warning when --audit-policy-file not passed to apiserver
Kubernetes-commit: 3b91f1cc0d32278a9baf2a4b9b4e416cbfb2457f
2017-09-09 21:44:31 +00:00
Kubernetes Publisher 22fed2cada Merge pull request #52097 from smarterclayton/log
Automatic merge from submit-queue (batch tested with PRs 52097, 52054)

Provide field info in storage configuration

Makes debugging how storage was configured difficult

@kubernetes/sig-api-machinery-bugs

Kubernetes-commit: 310b24bfcdc9958304973bf61f3aa23f516e82d9
2017-09-09 21:44:31 +00:00
Di Xu e69ddb7b01 fix format of forbidden messages
Kubernetes-commit: 95738d5a0eeb179325858e52ff83ff86de6fce0b
2017-09-09 21:44:31 +00:00
Kubernetes Publisher 0f6bf0a0c6 Merge pull request #50842 from CaoShuFeng/remove_versioned_test_from_filters
Automatic merge from submit-queue (batch tested with PRs 49133, 51557, 51749, 50842, 52018)

enhance unit tests of advance audit feature

This change addresses comments from @crassirostris
https://github.com/kubernetes/kubernetes/pull/49115#discussion_r133416080

It does three things:
1. use auditinternal for unit test in filter stage
2. add a seperate unit test for Audit-ID http header
3. add unit test for audit log backend

**Release note**:
```
NONE
```

Kubernetes-commit: d369160c7900368c96391738561dbc932fa9737d
2017-09-09 21:44:30 +00:00
Clayton Coleman 702960b762 Provide field info in storage configuration
Kubernetes-commit: 1fde2698ec152901856062eb89cc5d2742925ce2
2017-09-09 21:44:30 +00:00
Kubernetes Publisher 4dba4a6082 Merge pull request #51943 from CaoShuFeng/feature_gate
Automatic merge from submit-queue

set AdvancedAuditing feature gate to true by default

All feature commits are merged. The types are updated already to beta. This only enable the feature gate by default.

**Release note**:
```
Promote the AdvancedAuditing feature to beta and enable the feature gate by default.
```

Kubernetes-commit: 7be29bd9b6913e2f39b44a72a5f46e6f33244410
2017-09-09 21:44:30 +00:00
CaoShufeng 5d22e67a97 enhance unit tests of advance audit feature
This change does three things:
    1. use auditinternal for unit test in filter stage
    2. add a seperate unit test for Audit-ID http header
    3. add unit test for audit log backend

Kubernetes-commit: c030026b544da2dd7ef7201019bdc0ac255c2d23
2017-09-09 21:44:30 +00:00