Commit Graph

336 Commits (49e72d60495e93f93b22dc93104eb5709cd7c403)

Author SHA1 Message Date
Kubernetes Submit Queue b2a8ef474d
Merge pull request #63457 from fisherxu/mv
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>.

Remove repeated code

**What this PR does / why we need it**:
Remove repeated code
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-05 14:20:23 -07:00
fisherxu 58cebf9bbc remove repeated code 2018-05-05 18:09:33 +08:00
David Eads a68c57155e remove KUBE_API_VERSIONS 2018-04-26 08:27:49 -04:00
Jordan Liggitt 8ea88a5092
Remove request context mapper 2018-04-18 17:03:31 -04:00
Kubernetes Submit Queue 3e6f27f021
Merge pull request #62621 from hzxuzhonghu/kube-api-show-deprecated-flags
Automatic merge from submit-queue (batch tested with PRs 58784, 62057, 62621, 62652, 62656). 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>.

Show deprecated kube-apiserver flags

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

This PR unhides deprecated kube-apiserver flags, so that the deprecation notice is clearly visible in --help.

Fixes #62617

**Release note**:

```release-note
NONE
```
2018-04-16 12:58:17 -07:00
Kubernetes Submit Queue 229ab73ada
Merge pull request #58784 from wackxu/reminit
Automatic merge from submit-queue (batch tested with PRs 58784, 62057, 62621, 62652, 62656). 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>.

remove deprecated initresource admission plugin

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

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

xref https://github.com/kubernetes/kubernetes/pull/55375#issuecomment-360329586

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

**Release note**:

```release-note
remove deprecated initresource admission plugin
```
2018-04-16 12:58:11 -07:00
hzxuzhonghu 8f98af9459 Show deprecated kube-apiserver flags 2018-04-16 21:20:06 +08:00
rithu john 444bbd2654 pkg/kubeapiserver/options: update Bazel files 2018-04-10 12:03:54 -07:00
rithu john dd433b595f oidc authentication: Required claims support 2018-04-10 12:02:54 -07:00
Dr. Stefan Schimanski 9f906618f0 apiserver: enforce shared RequestContextMapper in delegation chain 2018-04-05 14:41:56 +02:00
Kubernetes Submit Queue 5ae7bba496
Merge pull request #60100 from mtaufen/node-authz-nodeconfigsource
Automatic merge from submit-queue (batch tested with PRs 61829, 61908, 61307, 61872, 60100). 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>.

node authorizer sets up access rules for dynamic config

This PR makes the node authorizer automatically set up access rules for
dynamic Kubelet config.

I also added some validation to the node strategy, which I discovered we
were missing while writing this.

This PR is based on another WIP from @liggitt.

```release-note
The node authorizer now automatically sets up rules for Node.Spec.ConfigSource when the DynamicKubeletConfig feature gate is enabled.
```
2018-03-29 17:37:18 -07:00
Kubernetes Submit Queue 5ed6d9f4ef
Merge pull request #61452 from hzxuzhonghu/minor-revision
Automatic merge from submit-queue (batch tested with PRs 61452, 61727, 61462, 61692, 61738). 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>.

remove invalid resource replicationControllers in DefaultResourcePrefixes

As all resources are lowercased, so remove invalid GroupResource `{Group: "", Resource: "replicationControllers"}`.

**Release note**:

```release-note
NONE
```
2018-03-27 09:47:08 -07:00
Michael Taufen ab8dc12333 node authorizer sets up access rules for dynamic config
This PR makes the node authorizer automatically set up access rules for
dynamic Kubelet config.

I also added some validation to the node strategy, which I discovered we
were missing while writing this.
2018-03-27 08:49:45 -07:00
Kubernetes Submit Queue 2fdcfeae51
Merge pull request #61166 from hzxuzhonghu/authz-flag-validate
Automatic merge from submit-queue (batch tested with PRs 60519, 61099, 61218, 61166, 61714). 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>.

kube-apiserver add BuiltInAuthorizationOptions validation

Validate BuiltInAuthorizationOptions after flags parsed. 

**Release note**:

```release-note
NONE
```
2018-03-26 23:20:14 -07:00
hzxuzhonghu 755df0461d validate authorization flags in BuiltInAuthorizationOptions.Validate 2018-03-26 20:37:02 +08:00
Kubernetes Submit Queue a0ea7f3857
Merge pull request #61453 from hzxuzhonghu/kube-api-cleanup
Automatic merge from submit-queue (batch tested with PRs 61453, 61393, 61379, 61373, 61494). 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>.

remove kube-apiserver `--storage-version` flag

#`--storage-version` has been deprecated more than a year ago, should remove it.

**Release note**:

```release-note
Remove kube-apiserver `--storage-version` flag, use `--storage-versions` instead.
```
2018-03-22 06:20:15 -07:00
Kubernetes Submit Queue f18fdc2ea0
Merge pull request #60911 from zjj2wry/authn_config_init
Automatic merge from submit-queue (batch tested with PRs 61396, 61321, 61443, 60911, 61461). 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>.

Simplify authenticator configuration initialization

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-03-22 03:37:20 -07:00
Kubernetes Submit Queue e6bd4ffbe9
Merge pull request #61213 from junxu/remove-deprecate-authorization-rbac-super-user
Automatic merge from submit-queue (batch tested with PRs 61087, 61075, 61213, 61149, 60826). 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>.

Remove deprecated paramter "authorization-rbac-super-user"

**What this PR does / why we need it**: As RBAC is v1 now, we need remove the deprecated  "authorization-rbac-super-user" paramter for RBAC alpha

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

**Special notes for your reviewer**:

**Release note**:

```release-note

```
2018-03-21 06:41:30 -07:00
hzxuzhonghu 5ac83d3c21 remove invalid resource replicationControllers 2018-03-21 15:59:47 +08:00
hzxuzhonghu 9789f24744 remove kube-apiserver unused storage-version flag 2018-03-21 11:26:48 +08:00
Kubernetes Submit Queue ca56628912
Merge pull request #60710 from NickrenREN/admission-pv-dir-change
Automatic merge from submit-queue (batch tested with PRs 60710, 60855, 60873, 60895, 60862). 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 `persistentvolume` into `storage` package under `plugin/pkg/admission` 

Sorry for omitting this in the previous PR #60367

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

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

**Special notes for your reviewer**:

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

/assign @jsafrane @thockin
2018-03-20 10:34:33 -07:00
junxu 8461d5f8d9 Remove deprecated paramter "authorization-rbac-super-user" 2018-03-15 02:22:55 -04:00
zhengjiajin 5e67f473cc Simplify authenticator configuration initialization 2018-03-13 11:06:06 +08:00
hzxuzhonghu 0feecc376c apiserver clean code 2018-03-06 10:31:50 +08:00
NickrenREN fc78e5ce9e fix references and golint failures 2018-03-03 13:12:03 +08:00
Kubernetes Submit Queue 88cfcb45ec
Merge pull request #55856 from miaoyq/replace-for-with-sets
Automatic merge from submit-queue (batch tested with PRs 53689, 56880, 55856, 59289, 60249). 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>.

Use `sets` instead of `for` statement in "IsValidAuthorizationMode"

**What this PR does / why we need it**:
Use `sets` instead of `for` statement in "IsValidAuthorizationMode", that will make the code more clearly and concisely.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
none
```
2018-02-28 00:00:32 -08:00
Mike Danese 024f57affe implement token authenticator for new id tokens 2018-02-27 17:20:46 -08:00
Kubernetes Submit Queue e30b6634c3
Merge pull request #60367 from NickrenREN/admission-sc-dir-change
Automatic merge from submit-queue (batch tested with PRs 60011, 59256, 59293, 60328, 60367). 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 `storageclass` into  `storage` package under `plugin/pkg/admission`

We have two directories `storage` and `storageclass` under package `plugin/pkg/admission` and one subdir `storageobjectinuseprotection` of `storage` now.
- 1. Move `storageclass` into  `storage` being  `storage`'s sub-package since storageclass is one of the storage objects
- 2. fix golint failures

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

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2018-02-26 23:47:59 -08:00
wackxu a92d892f6b remove deprecated initresource admission plugin 2018-02-26 11:39:45 +08:00
Kubernetes Submit Queue 9714b64761
Merge pull request #51249 from tengqm/service-ip-cidr
Automatic merge from submit-queue (batch tested with PRs 59882, 59434, 57722, 60320, 51249). 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>.

Expose default service IP CIDR in apiserver

**What this PR does / why we need it**:
The `--service-cluster-ip-range` parameter of API server is very important for deploying Kubernetes on some clouds. The default CIDR "10.0.0.0/24" should be exposed at least from the API server's help message so that users have a better idea whether they need to change it.
This patch exposes this default value in API server's help message.

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

**Release note**:
```
NONE
```
2018-02-24 18:43:39 -08:00
NickrenREN cb34a2ca68 fix references 2018-02-24 19:16:51 +08:00
Di Xu ebd0c4011b initialize all known client auth plugins 2018-02-23 16:02:30 +08:00
Kubernetes Submit Queue 270148d7d9
Merge pull request #58684 from hzxuzhonghu/default-enabled-admission
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>.

set default enabled admission plugins by official document

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

https://kubernetes.io/docs/admin/admission-controllers/#is-there-a-recommended-set-of-admission-controllers-to-use

recommend  running the following set of admission controllers 
```
If you previously had not set the `--admission-control` flag, your cluster behavior may change (to be more standard).  See [https://kubernetes.io/docs/admin/admission-controllers/] for explanation of admission control.
```

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Set default enabled admission plugins `NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota`
```
2018-02-22 05:24:44 -08:00
hzxuzhonghu 27f3fd2d79 set default enabled admission plugins by official document 2018-02-22 11:02:02 +08:00
Mike Danese 8ad1c6655b add support for /token subresource in serviceaccount registry 2018-02-21 13:16:51 -08:00
Kubernetes Submit Queue cdbc4fbe20
Merge pull request #58544 from ericchiang/oidc-v2
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>.

oidc authentication: switch to v2 of coreos/go-oidc

Switch to v2 of [coreos/go-oidc](https://github.com/coreos/go-oidc), which uses square/go-jose to verify tokens and supports more signing algorithms.

Most of this PR removes dependencies used by the older version of github.com/coreos/go-oidc, and updates vendor files.

This PR has been tested against tokens issued by Okta, Google, and CoreOS's dex.

Closes https://github.com/kubernetes/kubernetes/issues/57806

```release-note
kube-apiserver: the OpenID Connect authenticator can now verify ID Tokens signed with JOSE algorithms other than RS256 through the --oidc-signing-algs flag.
kube-apiserver: the OpenID Connect authenticator no longer accepts tokens from the Google v3 token APIs, users must switch to the "https://www.googleapis.com/oauth2/v4/token" endpoint.
```

cc @rithujohn191 @liggitt 
cc @kubernetes/sig-auth-pr-reviews
2018-02-21 09:07:23 -08:00
NickrenREN dad0fa07b7 rename StorageProtection to StorageObjectInUseProtection 2018-02-21 10:48:56 +08:00
Kubernetes Submit Queue 237007b615
Merge pull request #59934 from mikedanese/jwt-auth
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>.

svcacct: make token authenticator fully generic

so it can be used for both new and legacy svcacct tokens. Also move the
legacy validator into legacy.go.

part of https://github.com/kubernetes/kubernetes/issues/58790

```release-note
NONE
```
2018-02-20 18:40:59 -08:00
Kubernetes Submit Queue f8298702ff
Merge pull request #54933 from php-coder/psp_introduce_new_api_group
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>.

Introduce PodSecurityPolicy in the policy/v1beta1 API group

Types/constants are completely the same as in `extensions/v1beta1` except that they are located outside of the `extensions` API group.

**What this PR does / why we need it**:
This is the first step for migrating PSP-related stuff away of `extensions` group. See #43214 for more information.

Also it related to https://github.com/kubernetes/features/issues/5

**Example**:
```console
$ cat restricted2.yaml 
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
  name: restricted2
...
$ kubectl create -f restricted.yaml 
podsecuritypolicy "restricted2" created
$ kubectl get psp restricted2 -o yaml
apiVersion: extensions/v1beta1
kind: PodSecurityPolicy
...
```

**Release note**:
```release-note
The `PodSecurityPolicy` API has been moved to the `policy/v1beta1` API group. The `PodSecurityPolicy` API in the `extensions/v1beta1` API group is deprecated and will be removed in a future release.
```
2018-02-20 15:44:50 -08:00
Kubernetes Submit Queue b3099bcf53
Merge pull request #58097 from steveperry-53/ipv6
Automatic merge from submit-queue (batch tested with PRs 59391, 58097, 60057, 60090). 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>.

Add IPv6 to command options.

**What this PR does / why we need it**:
This PR adds IPv6 information to the descriptions for several command options.

[Related PR in kubernetes/website](https://github.com/kubernetes/website/pull/6498)

**Release note**:

```release-note
NONE
```
2018-02-20 13:51:32 -08:00
Mike Danese 2862fb333a svcacct: make token authenticator fully generic
so it can be used for both new and legacy svcacct tokens. Also move the
legacy validator into legacy.go.
2018-02-20 12:30:42 -08:00
Slava Semushin 379683d9f4 Introduce PodSecurityPolicy in the policy/v1beta1 API group.
PSP are completely the same as in extensions/v1beta1 except that they
are located outside of the extensions API group.
2018-02-19 20:14:28 +01:00
Jeff Grafton ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
Eric Chiang 48c6d1abf5
oidc authentication: switch to v2 of coreos/go-oidc 2018-02-16 10:57:48 -08:00
steveperry-53 cc7cea74ae Merge branch 'master' into ipv6 2018-02-14 10:45:27 -08:00
Kubernetes Submit Queue 2a8049890a
Merge pull request #59492 from dims/remove-old-keystone-authenticator
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>.

Remove experimental keystone authenticator

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

experimental-keystone-url and experimental-keystone-ca-file were always
experimental. So we don't need a deprecation period.
KeystoneAuthenticator was on the server side and needed userid/password
to be passed in and used that to authenticate with Keystone. We now
have authentication and authorization web hooks that can be used. There
is a external repo with a webook for keystone which works fine along
with the kubectl auth provider that was added in:
a0cebcb559

So we don't need this older style / hard coded / experimental code
anymore.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
kube-apiserver: the experimental in-tree Keystone password authenticator has been removed in favor of extensions that enable use of Keystone tokens.
```
2018-02-13 14:14:45 -08:00
Dr. Stefan Schimanski 4e0114b0dd apiserver: make SecureServingOptions and authz/n options re-usable 2018-02-13 11:16:38 +01:00
Davanum Srinivas 18590378c4 Remove experimental keystone authenticator
experimental-keystone-url and experimental-keystone-ca-file were always
experimental. So we don't need a deprecation period.
KeystoneAuthenticator was on the server side and needed userid/password
to be passed in and used that to authenticate with Keystone. We now
have authentication and authorization web hooks that can be used. There
is a external repo with a webook for keystone which works fine along
with the kubectl auth provider that was added in:
a0cebcb559

So we don't need this older style / hard coded / experimental code
anymore.
2018-02-07 19:28:55 -05:00
Kubernetes Submit Queue d3b783d5ec
Merge pull request #58743 from NickrenREN/pv-protection
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>.

Postpone PV deletion with finalizer when it is being used

Postpone PV deletion if it is bound to a PVC

xref: https://github.com/kubernetes/community/pull/1608


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

**Special notes for your reviewer**:

**Release note**:
```release-note
Postpone PV deletion when it is being bound to a PVC
```

WIP, assign to myself first

/assign @NickrenREN
2018-02-01 19:39:52 -08:00
steveperry-53 1a530d1884 Add IPv6 to ref page descriptions. 2018-02-01 19:29:54 +00:00
NickrenREN cbfa0cc85a reuse PVC protection admission plugin for PV protection 2018-01-31 20:02:01 +08:00
NickrenREN 7b9d2c046f Use v1beta1 VolumeAttachment 2018-01-31 18:46:11 +08:00
hzxuzhonghu 24c687fdad deprecate insecure http flags and remove already deprecated public-address-override 2018-01-30 16:05:33 +08:00
tengqm 887c48a597 Expose default service IP CIDR in apiserver 2018-01-29 16:21:04 +08:00
Mike Danese 057b7af798 serviceaccount: check token is issued by correct iss before verifying
Right now if a JWT for an unknown issuer, for any subject hits the
serviceaccount token authenticator, we return a errors as if the token
was meant for us but we couldn't find a key to verify it. We should
instead return nil, false, nil.

This change helps us support multiple service account token
authenticators with different issuers.
2018-01-24 20:21:59 -08:00
Kubernetes Submit Queue 26c1a3a8ee
Merge pull request #58595 from CaoShuFeng/LimitPodHardAntiAffinityTopology
Automatic merge from submit-queue (batch tested with PRs 58595, 58689). 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>.

fix invalid admission name LimitPodHardAntiAffinityTopology

@hzxuzhonghu 
@sttts 

**Release note**:

```release-note
NONE
```
2018-01-23 09:18:30 -08:00
Cao Shufeng 2a15776b41 fix invalid admission name LimitPodHardAntiAffinityTopology 2018-01-23 10:28:30 +08:00
hzxuzhonghu eff1f20ff1 run update bazel and staging-godep 2018-01-22 19:10:28 +08:00
hzxuzhonghu 2f403b7ad1 pass APIEnablement through apiserver chain 2018-01-22 19:10:26 +08:00
David Eads 98eb592291 make kube-apiserver admission flag disable other plugins 2018-01-19 08:14:04 -05:00
hzxuzhonghu 5c9e020d7d run update bazel 2018-01-19 13:18:27 +08:00
hzxuzhonghu 82c3d2492c update admission test cases 2018-01-19 13:16:36 +08:00
hzxuzhonghu 7c5f9e0bba refactor admission flag: add two admission flags and make plugins auto in recommended order 2018-01-19 13:16:36 +08:00
Jordan Liggitt ecfd18e2a6
Add get volumeattachments support to Node authorizer 2018-01-17 00:00:18 -05:00
Jordan Liggitt ba09fadecf
Plumb versioned informers to authz config 2018-01-16 23:30:53 -05:00
Kubernetes Submit Queue f9e4b6d025
Merge pull request #56608 from hzxuzhonghu/fix-typo
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>.

fix typo

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

fix typos in pkg/kubeapiserver/default_storage_factory_builder.go

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

**Special notes for your reviewer**:
tiny fix typo 
**Release note**:

```release-note
NONE
```
2018-01-04 15:28:05 -08:00
Jeff Grafton efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
Kubernetes Submit Queue fd826d6e2d
Merge pull request #57257 from brendandburns/typo
Automatic merge from submit-queue (batch tested with PRs 57257, 55442). 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>.

Fix a typo and improve some documentation.

Fix a typo and add some better help docs.
2017-12-20 23:56:47 -08:00
Kubernetes Submit Queue e0284fab0b
Merge pull request #56691 from sttts/sttts-fix-runtime-config-docs
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>.

kube-apiserver: fix runtime-config flag docs

This `apis/<GV>` syntax must predate API groups? It's not what we support today at least.
2017-12-18 00:29:29 -08:00
Kubernetes Submit Queue a162ec5307
Merge pull request #57148 from deads2k/rebase-01-storagelocation
Automatic merge from submit-queue (batch tested with PRs 57148, 57123, 57091, 57141, 57131). 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>.

expose special storage locations for downstream consumption

Storage locations are public information and needed for congruent storage.  This exposes them in their new home.
2017-12-16 21:00:41 -08:00
Brendan Burns 57e7471729 Fix a typo and improve some documentation. 2017-12-15 20:05:21 +00:00
David Eads 3d65f4cbd3 expose special storage locations for downstream consumption 2017-12-13 08:23:25 -05:00
Davanum Srinivas 31332fa84a Drop using cloud provider to set host address feature
As part of the larger plan to drop --cloud-provider and --cloud-config
from kube-apiserver, we need to stop calling Cloud Provider API to
find the external ip address when one is not specified on the command
line.

When ExternalHost is not specified, we check if AdvertiseAddress is
specified and use that, if that is missing then we use os.Hostname().

When testing this feature, found a problem that when ExternalHost
is specified, the port was not added in the generated URL. So fixed
that as well.
2017-12-05 13:58:20 -06:00
Dr. Stefan Schimanski fddbff25f6 kube-apiserver: fix runtime-config flag docs 2017-12-01 12:25:50 +01:00
hzxuzhonghu be40a40ee0 fix typo 2017-11-30 14:10:54 +08:00
Kubernetes Submit Queue 1489d19443
Merge pull request #56175 from ericchiang/oidc-fix-prefixing
Automatic merge from submit-queue (batch tested with PRs 51494, 56097, 56072, 56175). 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>.

oidc auth: fix prefix flag plumbing

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

Tested this with an full API server against Google. It works now.

:(

cc @kubernetes/sig-auth-bugs 

```release-note
kube-apiserver: fixed --oidc-username-prefix and --oidc-group-prefix flags which previously weren't correctly enabled
```

/assign @liggitt @deads2k 

Probably worth a cherry pick.
2017-11-21 19:49:33 -08:00
Eric Chiang df76402906 oidc auth: fix prefix flag plumbing 2017-11-21 14:22:25 -08:00
Kubernetes Submit Queue 5337ff8009
Merge pull request #55859 from hzxuzhonghu/listener-genericapiserver
Automatic merge from submit-queue (batch tested with PRs 56021, 55843, 55088, 56117, 55859). 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>.

apiserver:  pass a listener into genericapiserver bootstrapping 

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

>At the moment we pass a port via the options into the config. A zero port does not work because the loopback clients created during apiserver initialization need to know the port before. Passing a listener into the server instead would allow us to use a zero port beforehand and bootstrapping order should be fine.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-11-21 12:16:59 -08:00
hzxuzhonghu 6ba30f678c pass listener to genericapiserver 2017-11-21 11:00:15 +08:00
Dr. Stefan Schimanski e19257f2ec admission/webhook: move webhook initializer into plugin 2017-11-20 09:28:42 +01:00
Yanqiang Miao 96e2610a55 Use `sets` instead of `for` statement in "IsValidAuthorizationMode" 2017-11-16 15:41:49 +08:00
Chao Xu 1adfacc7eb Reorganize the admission webhook code.
Moved client and kubeconfig related code to webhook/config;
Moved the rule matcher to webhook/rules;
Left TODOs saying we are going to move some other common utilities;
Other code is moved to webhook/validation.
2017-11-14 15:59:53 -08:00
Kubernetes Submit Queue d12d711ba6
Merge pull request #54849 from hzxuzhonghu/audit-graceful-shutdown
Automatic merge from submit-queue (batch tested with PRs 46581, 55426, 54849). 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>.

apiserver shutdown gracefully

**What this PR does / why we need it**:
apiserver shutdown gracefully and wait all non-long running requests finish before process exit.

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

**Special notes for your reviewer**:
remove waitGroup, use atomic to count. 
**Release note**:

```release-note
NONE
```
2017-11-10 03:30:21 -08:00
hzxuzhonghu db4f0de280 gracefully shutdown apiserver after all non-long running requests finish 2017-11-10 14:06:52 +08:00
Dr. Stefan Schimanski bec617f3cc Update generated files 2017-11-09 12:14:08 +01:00
Dr. Stefan Schimanski 012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
Dr. Stefan Schimanski aedcf681b3 admission: rename Validate{ -> Initialization}, Validat{ingAdmit -> e} 2017-11-02 09:29:55 +01:00
Kubernetes Submit Queue d1d0b38c5f
Merge pull request #54516 from dims/deprecate-using-cloud-provider-for-setting-host-address
Automatic merge from submit-queue (batch tested with PRs 53796, 54666, 54516, 54625, 54704). 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>.

Deprecate using cloud provider to set host address feature

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

Long term plan is to remove all uses of cloud provider from kube api
server. As part of that, we need to remove the dependency on
figuring out the host address of the node running the kube api server
using the cloud provider. In this review, we log a warning that this
feature that is usually used for example with swagger generation
will go away in the future.

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

Part of fix for 54077

**Special notes for your reviewer**:

**Release note**:

```release-note
If you are using the cloud provider API to determine the external host address of the apiserver, set --external-hostname explicitly instead. The cloud provider detection has been deprecated and will be removed in the future
```
2017-10-30 13:48:35 -07:00
Dr. Stefan Schimanski f6a89df3fb Revert "audit backend run shutdown gracefully after http handler finish"
This reverts commit f42686081b.
2017-10-30 15:26:51 +01:00
Kubernetes Submit Queue 7a6a58f444
Merge pull request #53695 from hzxuzhonghu/audit-graceful-shutdown
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>.

Shutdown http handlers before shutting down audit backend

**What this PR does / why we need it**:
Currently, audit backend is shut down before http handlers stop processing requests, so some audit events can be dropped in case of batching webhook.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Shutdown http handlers in kube-apiserver before shutting down audit backend.
```
2017-10-28 03:33:54 -07:00
hzxuzhonghu f42686081b audit backend run shutdown gracefully after http handler finish 2017-10-28 15:03:38 +08:00
Kubernetes Submit Queue 27ef37a32d
Merge pull request #54320 from derekwaynecarr/quota-update
Automatic merge from submit-queue (batch tested with PRs 54331, 54655, 54320, 54639, 54288). 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>.

Ability to do object count quota for all namespaced resources

**What this PR does / why we need it**:
- Defines syntax for generic object count quota `count/<resource>.<group>`
- Migrates existing objects to support new syntax with old syntax
- Adds support to quota all standard namespace resources 
- Updates the controller to do discovery and replenishment on those resources
- Updates unit tests
- Tweaks admission configuration around quota
- Add e2e test for replicasets (demonstrate dynamic generic counting)

```
$  kubectl create quota test --hard=count/deployments.extensions=2,count/replicasets.extensions=4,count/pods=3,count/secrets=4
resourcequota "test" created
$ kubectl run nginx --image=nginx --replicas=2
$ kubectl describe quota
Name:                         test
Namespace:                    default
Resource                      Used  Hard
--------                      ----  ----
count/deployments.extensions  1     2
count/pods                    2     3
count/replicasets.extensions  1     4
count/secrets                 1     4
```

**Special notes for your reviewer**:
- simple object count quotas no longer require writing code
- deferring support for custom resources pending investigation about how to share caches with garbage collector.  in addition, i would like to see how this integrates with downstream quota usage in openshift.

**Release note**:
```release-note
Object count quotas supported on all standard resources using `count/<resource>.<group>` syntax
```
2017-10-27 15:42:24 -07:00
Chao Xu ca8131877a remove the nesting directory webhook/webhook 2017-10-27 10:09:46 -07:00
Derek Carr 5b4ca14307 Update admission control framework for quota 2017-10-27 11:08:14 -04:00
David Eads 8c1fe1f61a move webhook admission to generic apiserver 2017-10-26 07:45:49 -04:00
Davanum Srinivas 6ae7201d74 Deprecate using cloud provider to set host address feature
Long term plan is to remove all uses of cloud provider from kube api
server. As part of that, we need to remove the dependency on
figuring out the host address of the node running the kube api server
using the cloud provider. In this review, we log a warning that this
feature that is usually used for example with swagger generation
will go away in the future.
2017-10-24 17:39:33 -04:00
David Eads 0859798e8e update admission webhook to accept client config 2017-10-19 09:52:58 -04:00
Dr. Stefan Schimanski cad0364e73 Update bazel 2017-10-18 17:24:04 +02:00
Dr. Stefan Schimanski 7773a30f67 pkg/api/legacyscheme: fixup imports 2017-10-18 17:23:55 +02:00
Jeff Grafton aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
Davanum Srinivas 26b11474ca Remove cmd/kubeadm from pkg/controller 2017-10-13 07:06:21 -04:00
Kubernetes Submit Queue efe6180806 Merge pull request #53752 from lookuptable/comment
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 comments in pkg/kubeapiserver/authenticator/config.go

**What this PR does / why we need it**:
Make the comments consistent with the function signatures

**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-10-12 06:36:25 -07:00
Yang Guan 6860628b46 Update comments in pkg/kubeapiserver/authenticator/config.go
Make the comments consistent with the function signatures
2017-10-11 21:44:00 +00:00
Chao Xu bbac32c299 generated 2017-10-09 10:58:12 -07:00
Chao Xu 89a0511fcb move initializer to the generic apiserver
move k8s.io/kubernetes/plugin/pkg/admission/initialization to
k8s.io/apiserver/pkg/admission/plugin/initialization/initialization.go;
move k8s.io/kubernetes/pkg/kubeapiserver/admission/configuration to
k8s.io/apiserver/pkg/admission/configuration.
2017-10-09 10:57:00 -07:00
p0lyn0mial 6b1f1d1414 removes Authorizer and ExternalClientSet from kubeapiserver's admission initializer. 2017-10-03 18:08:30 +02:00
p0lyn0mial 475493ced6 moved admission interfaces WantsClientCert, WantsAuthorizer and WantsExternalKubeClientSet to apiserver 2017-10-01 15:03:08 +02:00
Kubernetes Submit Queue 7c9e614cbb 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
2017-09-24 00:04:36 -07:00
Kubernetes Submit Queue 7f3f986402 Merge pull request #52673 from p0lyn0mial/webhook_default_service_resolver
Automatic merge from submit-queue (batch tested with PRs 52831, 52764, 52763, 52673, 52558). 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>..

default service resolver for webhook admission

**What this PR does / why we need it**:
provides a default service resolver for webhook plugin. The rationale behind is that webhook plugins names can be resolved by a dns server working inside a cluster.


**Release note**:

```
NONE
```
2017-09-23 22:57:54 -07:00
Kubernetes Submit Queue 2dc33077f6 Merge pull request #52551 from mattmoyer/drop-experimental-bootstrap-token-auth
Automatic merge from submit-queue (batch tested with PRs 52355, 52537, 52551, 52403, 50673). 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>..

Drop --experimental-bootstrap-token-auth flag.

**What this PR does / why we need it**:
Drops support for the `--experimental-bootstrap-token-auth` flag for the API server. This flag was replaced by `--enable-bootstrap-token-auth` in 1.8 (https://github.com/kubernetes/kubernetes/pull/51198) but the old flag was accepted with a deprecation warning. In 1.9 we want to totally drop it.

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

**Special notes for your reviewer**:
There are other places in kubeadm where we need to drop support for this flag (at init and at postupgrade). We can tackle those in a separate PR.

**Release note**:
I think this change is already document well enough in the changelog for 1.8.
```release-note
NONE
```

@kubernetes/sig-cluster-lifecycle-pr-reviews @kubernetes/sig-auth-pr-reviews 

/kind cleanup
2017-09-23 15:26:57 -07:00
Kubernetes Submit Queue 7240b1e2ee 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
2017-09-23 06:16:15 -07:00
Jeff Grafton 02fb4200dc Use buildozer to delete licenses() rules 2017-09-21 15:53:22 -07:00
Jeff Grafton 532bd482df Use buildozer to remove deprecated automanaged tags 2017-09-21 15:53:22 -07:00
p0lyn0mial 1e2c7fdd88 default service resolver for webhook admission
the rationale behind is that webhook plugins names can be resolved by a dns server working inside a cluster.
2017-09-20 17:37:11 +02:00
Matt Moyer 9bb322f647 Drop --experimental-bootstrap-token-auth flag.
This flag was replaced by `--enable-bootstrap-token-auth` in 1.8 (https://github.com/kubernetes/kubernetes/pull/51198).
2017-09-15 09:54:53 -05:00
Chao Xu 186a0684d5 plumb the proxyTransport to the webhook admission plugin;
set the ServerName in the config for webhook admission plugin.
2017-09-14 15:35:12 -07:00
Shiyang Wang 0084d70b56 move specialDefaultResourcePrefixes out of vendor/k8s.io/apiserver 2017-09-07 10:19:30 +08:00
Chao Xu 4d1d33af46 bazel 2017-09-06 10:21:01 -07:00
Chao Xu b0c83c72c1 Charge quota for uninitialized objects at different time
Charge object count when object is created, no matter if the object is
initialized or not.
Charge the remaining quota when the object is initialized.

Also, checking initializer.Pending and initializer.Result when
determining if an object is initialized. We didn't need to check them
because before 51082, having 0 pending initializer and nil
initializers.Result is invalid.
2017-09-06 10:20:32 -07:00
Kubernetes Submit Queue d970eb8f94 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
2017-09-03 08:46:23 -07:00
xilabao f14c138438 add selfsubjectrulesreview api 2017-09-01 19:09:43 +08:00
Joe Betz cb764756c6 Add --request-timeout to allow the global request timeout of 60 seconds to be configured. 2017-08-28 13:42:43 -07:00
Kubernetes Submit Queue 432790df88 Merge pull request #51198 from mattmoyer/rename-experimental-bootstrap-token-auth
Automatic merge from submit-queue (batch tested with PRs 50713, 47660, 51198, 51159, 51195)

kubeapiserver: rename `--experimental-bootstrap-token-auth` to `--enable-bootstrap-token-auth`.

#**What this PR does / why we need it**:
This change renames the API server `--experimental-bootstrap-token-auth` flag to `--enable-bootstrap-token-auth`. The old flag is accepted but generates a warning.

In 1.9, we will drop support for `--experimental-bootstrap-token-auth` entirely.

#### Example of the warning log:
```
$ kube-apiserver --experimental-bootstrap-token-auth --etcd-servers https://127.0.0.1:1234 --service-cluster-ip-range 10.0.1.0/24
Flag --experimental-bootstrap-token-auth has been deprecated, use --enable-bootstrap-token-auth instead.
[...]
```

**Which issue this PR fixes** fixes https://github.com/kubernetes/kubernetes/issues/50613

**Release note**:
```release-note
Renamed the API server flag `--experimental-bootstrap-token-auth` to `--enable-bootstrap-token-auth`. The old value is accepted with a warning in 1.8 and will be removed in 1.9.
```

/sig cli
/sig cluster-lifecycle

cc @luxas
2017-08-24 11:17:09 -07:00
Kubernetes Submit Queue aef39e6f47 Merge pull request #50489 from yujunzhang/Fix-the-typo-of-WithAnonymous
Automatic merge from submit-queue (batch tested with PRs 50489, 51070, 51011, 51022, 51141)

Fix the method name of BuiltInAuthenticationOptions.WithAnyonymous

change the BuiltInAuthenticationOptions.WithAnyonymous to
WithAnonymous would be better.



**What this PR does / why we need it**:
The BuiltInAuthenticationOptions.WithAnyonymous method name should be a meaningful name of  WithAnonymous

**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**:

```release-note
None
```
2017-08-23 19:54:22 -07:00
Matt Moyer 9dad15e220 kubeapiserver: rename `--experimental-bootstrap-token-auth` to `--enable-bootstrap-token-auth`.
This change renames the `--experimental-bootstrap-token-auth` flag to `--enable-bootstrap-token-auth`. The old flag is accepted but generates a warning.

In 1.9, we will drop support for `--experimental-bootstrap-token-auth` entirely.
2017-08-23 11:04:54 -05:00
Eric Chiang 1f8ee7fe13 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
2017-08-18 09:49:32 -07:00
Chao Xu bf6155b08c make admission plugins handle mutating spec of uninitialized pods 2017-08-17 12:51:09 -07:00
Monis Khan 8e7893e541
Refactor RBAC authorizer entry points
This change refactors various RBAC authorizer functions to be more
flexible in their inputs.  This makes it easier to reuse the various
components that make up the authorizer.

Signed-off-by: Monis Khan <mkhan@redhat.com>
2017-08-16 11:43:39 -04:00
Kubernetes Submit Queue 42adb9ef25 Merge pull request #50258 from liggitt/token-cache
Automatic merge from submit-queue (batch tested with PRs 49488, 50407, 46105, 50456, 50258)

Enable caching successful token authentication

Resolves #50472

To support revocation of service account tokens, an etcd lookup of the token and service account is done by the token authenticator. Controllers that make dozens or hundreds of API calls per second (like the endpoints controller) cause this lookup to be done very frequently on the same objects.

This PR:
* Implements a cached token authenticator that conforms to the authenticator.Token interface
* Implements a union token authenticator (same approach as the union request authenticator, conforming to the authenticator.Token interface)
* Cleans up the auth chain construction to group all token authenticators (means we only do bearer and websocket header parsing once)
* Adds a 10-second TTL cache to successful token authentication

```release-note
API server authentication now caches successful bearer token authentication results for a few seconds.
```
2017-08-11 14:14:06 -07:00
Jeff Grafton a7f49c906d Use buildozer to delete licenses() rules except under third_party/ 2017-08-11 09:32:39 -07:00
Jeff Grafton 33276f06be Use buildozer to remove deprecated automanaged tags 2017-08-11 09:31:50 -07:00
zhangyujun 4355d7014d Fix the method name of BuiltInAuthenticationOptions
change the BuiltInAuthenticationOptions.WithAnyonymous to
WithAnonymous would be better.
2017-08-11 14:54:59 +08:00
Jordan Liggitt 0458fac8c0
Simplify bearer token auth chain, cache successful authentications 2017-08-09 23:37:24 -04:00
Christoph Blecker aac4d5382d
Move remaining cert helper functions to client-go/util/cert
- Move public key functions to client-go/util/cert
- Move pki file helper functions to client-go/util/cert
- Standardize on certutil package alias
- Update dependencies to client-go/util/cert
2017-08-03 13:17:07 -07:00
Jordan Liggitt d65610bf2f
Remove default binding of system:node role to system:nodes group 2017-07-26 13:53:14 -04:00
Davanum Srinivas f4011d485a Set external hostname in local-up-cluster
If we set --external-hostname, then the api server does not look
in the CloudProviderOptions.DefaultExternalHost method. While we
are at it, let's log an info message, so if there is a failure
the operator gets a hint that they can use --external-hostname
to bypass the lookup in the cloud provider. This will enable us
to set the CLOUD_PROVIDER to openstack for example and not have to
really run api server inside a openstack vm.
2017-07-24 07:58:46 -04:00
Eric Chiang e2f2ab67f2 *: remove --insecure-allow-any-token option
e2e and integration tests have been switched over to the tokenfile
authenticator instead.

```release-note
The --insecure-allow-any-token flag has been removed from kube-apiserver. Users of the flag should use impersonation headers instead for debugging.
```
2017-07-18 16:03:15 -07:00
Kubernetes Submit Queue f3dcf63130 Merge pull request #48576 from caesarxuchao/fix-ExternalAdmissionHookConfigurationManager
Automatic merge from submit-queue (batch tested with PRs 48576, 49010)

make externalAdmissionHookConfigurationManager distinguish API disabled error

The externalAdmissionHookConfigurationManager does not return "DisabledErr" even if the API is disabled, so the GenericWebhook admission controller will not fail open.

The GenericWebhook admission controller is default to off, so the bug is hidden in most cases. To be safe, we should cherrypick it to 1.7.

```release-note
Fix a bug where the GenericWebhook admission plugin does not fail open when the admissionregistration API is disabled
```
2017-07-18 00:35:43 -07:00
Jacob Simpson 29c1b81d4c Scripted migration from clientset_generated to client-go. 2017-07-17 15:05:37 -07:00
Chao Xu 9eb065ffd7 make externalAdmissionHookConfigurationManager distinguish API disabled error
Also added unit tests
2017-07-07 13:34:29 -07:00
Kubernetes Submit Queue 6acfb0f868 Merge pull request #47038 from yastij/DefaultExternalHost-for-registredCP
Automatic merge from submit-queue (batch tested with PRs 47038, 47105)

extending DefaultExternalHost for any registred cloud provider

**What this PR does / why we need it**: this PR enables DefaultExternalHost to work with any registered cloud provider.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
When determining the default external host of the kube apiserver, any configured cloud provider is now consulted
```
2017-06-27 08:29:25 -07:00
Kubernetes Submit Queue 714f97d7ba Merge pull request #47740 from liggitt/websocket-protocol
Automatic merge from submit-queue

Add token authentication method for websocket browser clients

Closes #47967

Browser clients do not have the ability to set an `Authorization` header programatically on websocket requests. All they have control over is the URL and the websocket subprotocols sent (see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket)

This PR adds support for specifying a bearer token via a websocket subprotocol, with the format `base64url.bearer.authorization.k8s.io.<encoded-token>`

1. The client must specify at least one other subprotocol, since the server must echo a selected subprotocol back
2. `<encoded-token>` is `base64url-without-padding(token)`

This enables web consoles to use websocket-based APIs (like watch, exec, logs, etc) using bearer token authentication.

For example, to authenticate with the bearer token `mytoken`, the client could do:
```js
var ws = new WebSocket(
  "wss://<server>/api/v1/namespaces/myns/pods/mypod/logs?follow=true",
  [
    "base64url.bearer.authorization.k8s.io.bXl0b2tlbg",
    "base64.binary.k8s.io"
  ]
);
```

This results in the following headers:
```
Sec-WebSocket-Protocol: base64url.bearer.authorization.k8s.io.bXl0b2tlbg, base64.binary.k8s.io
```

Which this authenticator would recognize as the token `mytoken`, and if authentication succeeded, hand off to the rest of the API server with the headers
```
Sec-WebSocket-Protocol: base64.binary.k8s.io
```

Base64-encoding the token is required, since bearer tokens can contain characters a websocket protocol may not (`/` and `=`)

```release-note
Websocket requests may now authenticate to the API server by passing a bearer token in a websocket subprotocol of the form `base64url.bearer.authorization.k8s.io.<base64url-encoded-bearer-token>`
```
2017-06-24 00:34:41 -07:00
Chao Xu 60604f8818 run hack/update-all 2017-06-22 11:31:03 -07:00
Chao Xu cde4772928 run ./root-rewrite-all-other-apis.sh, then run make all, pkg/... compiles 2017-06-22 11:30:52 -07:00
Chao Xu f4989a45a5 run root-rewrite-v1-..., compile 2017-06-22 10:25:57 -07:00
Jordan Liggitt 6a872c09eb
Use websocket protocol authenticator in apiserver 2017-06-21 09:47:34 -04:00
Chao Xu 8dbeee50c7 generated 2017-06-14 10:20:33 -07:00
Chao Xu 4d834b22ea make admission configuration manager retry 5 times if it's not bootstrapped yet 2017-06-14 10:19:20 -07:00
Yassine TIJANI 2eec2beed8 extending DefaultExternalHost for any registred cloud provider see #46567 2017-06-06 13:40:21 +02: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