Commit Graph

799 Commits

Author SHA1 Message Date
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
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
Cao Shufeng 0c7ac2906f set AdvancedAuditing feature gate to true by default
Kubernetes-commit: 1388426898f46de5e8730c3f71ce3ccaf50337b8
2017-09-09 21:44:30 +00:00
Kubernetes Publisher 4cb96b9d03 Merge pull request #51795 from dims/bug-fix-51755
Automatic merge from submit-queue (batch tested with PRs 51984, 51351, 51873, 51795, 51634)

Bug Fix - Adding an allowed address pair wipes port security groups

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

Fix for cloud routes enabled instances will have their security groups
removed when the allowed address pair is added to the instance's port.

Upstream bug report is in:
https://github.com/gophercloud/gophercloud/issues/509

Upstream bug fix is in:
https://github.com/gophercloud/gophercloud/pull/510

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

Fixes #51755

**Special notes for your reviewer**:

Just an fix in vendored code. minimal changes needed in OpenStack cloud provider

**Release note**:

```release-note
NONE
```

Kubernetes-commit: 9a8cb435b77085fa7d518c4428a02eae316b1003
2017-09-06 14:06:23 +00:00
Kubernetes Publisher 55fb378db3 Merge pull request #51751 from dashpole/update_cadvisor_godep
Automatic merge from submit-queue (batch tested with PRs 51186, 50350, 51751, 51645, 51837)

Update Cadvisor Dependency

Fixes: https://github.com/kubernetes/kubernetes/issues/51832
This is the worst dependency update ever...
The root of the problem is the [name change of Sirupsen -> sirupsen](https://github.com/sirupsen/logrus/issues/570#issuecomment-313933276).  This means that in order to update cadvisor, which venders the lowercase, we need to update all dependencies to use the lower-cased version.  With that being said, this PR updates the following packages:

`github.com/docker/docker`
- `github.com/docker/distribution`
  - `github.com/opencontainers/go-digest`
  - `github.com/opencontainers/image-spec`
  - `github.com/opencontainers/runtime-spec`
  - `github.com/opencontainers/selinux`
  - `github.com/opencontainers/runc`
    - `github.com/mrunalp/fileutils`
  - `golang.org/x/crypto`
    - `golang.org/x/sys`
- `github.com/docker/go-connections`
- `github.com/docker/go-units`
- `github.com/docker/libnetwork`
- `github.com/docker/libtrust`
- `github.com/sirupsen/logrus`
- `github.com/vishvananda/netlink`

`github.com/google/cadvisor`
- `github.com/euank/go-kmsg-parser`

`github.com/json-iterator/go`

Fixed https://github.com/kubernetes/kubernetes/issues/51832

```release-note
Fix journalctl leak on kubelet restart
Fix container memory rss
Add hugepages monitoring support
Fix incorrect CPU usage metrics with 4.7 kernel
Add tmpfs monitoring support
```

Kubernetes-commit: 99aa992ce845fe947a406ac4d3f99d2208f0416b
2017-09-06 14:05:36 +00:00
Davanum Srinivas a781e88260 Bug Fix - Adding an allowed address pair wipes port security groups
Fix for cloud routes enabled instances will have their security groups
removed when the allowed address pair is added to the instance's port.

Upstream bug report is in:
https://github.com/gophercloud/gophercloud/issues/509

Upstream bug fix is in:
https://github.com/gophercloud/gophercloud/pull/510

Kubernetes-commit: 74a3d89ad4ff1508a16bacb0c333a1f795c31470
2017-09-06 14:05:36 +00:00
Kubernetes Publisher a2bec7aaaa sync: reset Godeps/Godeps.json 2017-09-06 14:05:36 +00:00
David Ashpole a53eab6741 update cadvisor, docker, and runc godeps
Kubernetes-commit: e5a6a79fd75372fcc7fa32ccf8d80ed9e0335b17
2017-09-06 14:04:45 +00:00
Kubernetes Publisher 349431f1bf sync: reset Godeps/Godeps.json 2017-09-06 14:04:45 +00:00
Kubernetes Publisher cf7c1806f5 Merge pull request #51936 from CaoShuFeng/audit_doc_string
Automatic merge from submit-queue (batch tested with PRs 51833, 51936)

fix docstring of advanced audit policy

I found this when I write doc for advanced audit beta version.

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

Kubernetes-commit: 3a5622db737d4910d20cb2ce73fea986b8b43a64
2017-09-05 14:03:27 +00:00
Cao Shufeng 26f73b45d4 fix docstring of advanced audit policy
Kubernetes-commit: 22f4c1ad4db102d66ec829a64ab601919f2019f5
2017-09-05 14:03:27 +00:00
Kubernetes Publisher 9c2e935137 Merge pull request #51909 from sttts/sttts-51908
Automatic merge from submit-queue

audit: fix fuzzer

Fixes #51908.

Kubernetes-commit: 57c3c2c0bc3b24905ecab52b7b8a50d4b0e6bae2
2017-09-04 12:13:40 -07:00
Dr. Stefan Schimanski 433a5a01a7 audit: fix fuzzer
Kubernetes-commit: 58dd0879a754baff151913184ab5e1cd924fb19d
2017-09-05 14:03:26 +00:00
Kubernetes Publisher ada39a8a4e Merge pull request #49280 from CaoShuFeng/RequestReceived
Automatic merge from submit-queue

Provide a way to omit Event stages in audit policy

This provide a way to omit some stages for each audit policy rule.

For example:

    ```
      apiVersion: audit.k8s.io/v1beta1
      kind: Policy
      - level: Metadata
        resources:
           - group: "rbac.authorization.k8s.io"
             resources: ["roles"]
        omitStages:
          - "RequestReceived"
    ```

RequestReceived stage will not be emitted to audit backends with previous config.

**Release note**:

```
None
```
#

Kubernetes-commit: 9d29ce135658be851a96aad9dd337c5afd531d2e
2017-09-04 14:03:48 +00:00
Cao Shufeng 3827624a56 generated: update API resources
./hack/update-codegen.sh
./hack/update-generated-protobuf.sh

Kubernetes-commit: b50acbdf0152f59e5fd6b065560aed4f85717a7a
2017-09-04 14:03:48 +00:00
Cao Shufeng 4905dd9b0c Provide a way to omit Event stages in audit policy
Updates https://github.com/kubernetes/kubernetes/issues/48561
This provide a way to omit some stages for each audit policy rule.

For example:
  apiVersion: audit.k8s.io/v1beta1
  kind: Policy
  - level: Metadata
    resources:
       - group: "rbac.authorization.k8s.io"
         resources: ["roles"]
    omitStages:
      - "RequestReceived"

RequestReceived stage will not be emitted to audit backends with
previous config.

Kubernetes-commit: 47ba91450fbe7d9002bfc9d4a48a73256252821f
2017-09-04 14:03:48 +00:00
Kubernetes Publisher e168d0b4b4 Merge pull request #51803 from deads2k/server-01-authz-evaluation
Automatic merge from submit-queue (batch tested with PRs 50579, 50875, 51797, 51807, 51803)

make url parsing in apiserver configurable

We have known cases where the attributes for a request are assigned differently.  The kubelet is one example.  This makes the value an interface, not a struct, and provides a hook for (non-default) users to override it.

Kubernetes-commit: f24eb1da7c3c79c43e16f3d8c3e55f35d4a627d6
2017-09-03 08:46:31 -07:00
David Eads 9f885389e9 make url parsing in apiserver configurable
Kubernetes-commit: ccc7c9bdfa80caee93953a96dec0d689d93f08e5
2017-09-04 14:03:48 +00:00
Kubernetes Publisher 689691a267 Merge pull request #51797 from CaoShuFeng/protobuf
Automatic merge from submit-queue (batch tested with PRs 50579, 50875, 51797, 51807, 51803)

update generated protobuf for audit v1beta1 api

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

Kubernetes-commit: 3a987b0168bf94b9ce579e6aa459d3633527d8d2
2017-09-03 08:46:26 -07:00
Kubernetes Publisher f94ddfec3e Merge pull request #50875 from ericchiang/oidc-claims-prefix
Automatic merge from submit-queue (batch tested with PRs 50579, 50875, 51797, 51807, 51803)

oidc auth: make the OIDC claims prefix configurable

Add the following flags to control the prefixing of usernames and
groups authenticated using OpenID Connect tokens.

	--oidc-username-prefix
	--oidc-groups-prefix

```release-note
The OpenID Connect authenticator can now use a custom prefix, or omit the default prefix, for username and groups claims through the --oidc-username-prefix and --oidc-groups-prefix flags. For example, the authenticator can map a user with the username "jane" to "google:jane" by supplying the "google:" username prefix.
```

Closes https://github.com/kubernetes/kubernetes/issues/50408
Ref https://github.com/kubernetes/kubernetes/issues/31380

cc @grillz @kubernetes/sig-auth-pr-reviews @thomastaylor312 @gtaylor

Kubernetes-commit: d970eb8f9450e985073734790d2dfd93693db1da
2017-09-04 14:03:47 +00:00
Cao Shufeng 92f836da87 update generated protobuf for audit v1beta1 api
Kubernetes-commit: ea519bc06020d2b2a68fa46a3f57c9d66827659d
2017-09-04 14:03:47 +00:00
Eric Chiang 8a6b3f7f2e oidc auth: make the OIDC claims prefix configurable
Add the following flags to control the prefixing of usernames and
groups authenticated using OpenID Connect tokens.

	--oidc-username-prefix
	--oidc-groups-prefix

Kubernetes-commit: 1f8ee7fe13490a8e8e0e7801492770caca9f9b5c
2017-09-04 14:03:47 +00:00
Kubernetes Publisher d2421c64dc Merge pull request #50864 from mbohlool/update_openapi_aggr
Automatic merge from submit-queue

Improvements to OpenAPI aggregation

Fixes #50863
Fixes #50011
Related: #50896

Kubernetes-commit: 75e111ad8713835161ac56e7fd95cdeb51b2f9ad
2017-09-03 06:54:50 -07:00
mbohlool eaf131e1fc Provide whole delegate chain to kube aggregator
Kubernetes-commit: 7cbdb90890ac89ec15be2b21b5cbdc51e94e42d6
2017-09-04 14:03:46 +00:00
Kubernetes Publisher 74dd4f8e63 sync: update godeps 2017-09-03 14:06:12 +00:00
Kubernetes Publisher 684c50b8ee Merge pull request #51719 from soltysh/audit_switch_beta
Automatic merge from submit-queue

Switch audit output to v1beta1

This PR adds two switches to pick preferred version for webhook and log backends, and it switches to use `audit.k8s.io/v1beta1` as default for both.

@sttts @crassirostris ptal

**Release note**:
```release-note
Switch to audit.k8s.io/v1beta1 in audit.
```

Kubernetes-commit: ea1d10543ffa5338b8257e5bdb377423da6ca976
2017-09-03 04:14:09 -07:00
Maciej Szulik 3c2866020c Switch audit output to v1beta1
Kubernetes-commit: f3487f08c6c2444adde9ba110263c9132769332b
2017-09-03 14:04:14 +00:00