Commit Graph

488 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
7f200cb75b
Merge pull request #100868 from enj/enj/f/oidc_controller
oidc authenticator: make library usage easier
2021-04-10 19:04:20 -07:00
Kubernetes Prow Robot
42a4953c6e
Merge pull request #100186 from yangjunmyfm192085/run-test28
test: fix the error case of TestAuthenticationValidate
2021-04-08 20:28:34 -07:00
Kubernetes Prow Robot
26fba1403b
Merge pull request #99528 from pandaamanda/apiserver_validation_code_optimization
fix log message and optimize log format check logic
2021-04-08 14:28:34 -07:00
Monis Khan
5dd4c89df3
oidc authenticator: allow passing in CA via bytes
This change updates the OIDC authenticator code to use a subset of
the dynamiccertificates.CAContentProvider interface to provide the
root CA bytes.  This removes the hard dependency on a file based CA
and makes it easier to use this code as a library.

Signed-off-by: Monis Khan <mok@vmware.com>
2021-04-06 15:46:00 -04:00
JunYang
4e72e41387 test: fix the error of TestAuthenticationValidate
Signed-off-by: JunYang <yang.jun22@zte.com.cn>
2021-03-12 23:10:21 +08:00
Patrick Ohly
a94c141060 CSIStorageCapacity: promote API to beta
The v1alpha1 API is left in place for now to ease the migration.
2021-03-08 20:52:50 +01:00
xiongzhongliang
4a24a08f93 Optimize some codes 2021-03-05 18:23:39 +08:00
Jordan Liggitt
4515889574 Prefer v1 storage versions 2021-03-02 12:06:13 -05:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Shihang Zhang
cbf6e38bbd move RootCAConfigMap to ga 2021-02-22 15:59:27 -08:00
Kubernetes Prow Robot
1119a505ac
Merge pull request #98669 from liggitt/denyexec
Remove deprecated DenyEscalatingExec / DenyExecOnPrivileged admission
2021-02-02 06:52:28 -08:00
Jordan Liggitt
3579f88e4d Remove deprecated DenyEscalatingExec / DenyExecOnPrivileged admission 2021-02-01 16:55:22 -05:00
Michael Taufen
6aa80d9172 Graduate ServiceAccountIssuerDiscovery to GA
Waiting on KEP updates first:
https://github.com/kubernetes/enhancements/pull/2363
2021-02-01 11:44:23 -08:00
Tim Hockin
a8299079a5 Add denyserviceexternalips admission 2020-12-29 10:00:11 -08:00
Tim Hockin
02b77861ec Move defaultingressclass admission to net subdir 2020-12-28 09:58:30 -08:00
KeZhang
3562806d2d cleanup unused code for kubeapiserver 2020-12-09 09:29:34 +08:00
Jordan Liggitt
afd92b3b3e Revert "plumb context with request deadline"
This reverts commit 83f869ee13.
2020-11-19 18:15:04 -05:00
Abu Kashem
83f869ee13
plumb context with request deadline
- as soon as a request is received by the apiserver, determine the
timeout of the request and set a new request context with the deadline.
- the timeout filter that times out non-long-running requests should
use the request context as opposed to a fixed 60s wait today.
- admission and storage layer uses the same request context with the
deadline specified.
2020-11-14 11:54:17 -05:00
Sergey Kanzhelev
06da0e5e74 GA of RuntimeClass feature gate and API 2020-11-11 19:22:32 +00:00
Kubernetes Prow Robot
40ef0ad6e9
Merge pull request #95002 from p0lyn0mial/upstream-supress-err-conn-killed
stop logging killing connection/stream because serving request timed out and response had been started
2020-11-10 12:37:51 -08:00
Maciej Borsz
4d81f7e129 Improve observability of node authorizer:
* Adding some metrics to the graph
* Adding log message when node authorizer has synced

Change-Id: I3447d6bc389a0b82ded1db2a7a4ae41d79486c2b
2020-11-10 08:40:46 +01:00
Lukasz Szaszkiewicz
057986e32c stops puting a stacktrace of aborted requests in the logs
Aborted requests are the ones that were disrupted with http.ErrAbortHandler.
For example, the timeout handler will panic with http.ErrAbortHandler when a response to the client has been already sent
and the timeout elapsed.

Additionally, a new metric requestAbortsTotal was defined to count aborted requests. The new metric allows for aggregation for each group, version, verb, resource, subresource and scope.
2020-11-09 09:23:40 +01:00
Kubernetes Prow Robot
8d6829fe1e
Merge pull request #95896 from zshihang/flag
make flags of TokenRequest required
2020-11-05 18:36:50 -08:00
Shihang Zhang
a5021a4ddf make flags of TokenRequest required 2020-11-05 10:40:56 -08:00
Shihang Zhang
4c593b268a default service-account-extend-token-expiration to true 2020-11-05 09:07:01 -08:00
Shihang Zhang
d40f0c43c4 separate RootCAConfigMap from BoundServiceAccountTokenVolume 2020-11-04 17:10:39 -08:00
Kubernetes Prow Robot
d16112f76c
Merge pull request #96052 from wojtek-t/fix_watchcache_size
Disable watchcache for events
2020-11-02 07:30:53 -08:00
Abu Kashem
c09828e47d
thorw error if webhook retry backoof is not specified 2020-11-01 10:22:20 -05:00
Abu Kashem
53a1307f68
make backoff parameters configurable for webhook
Currently webhook retry backoff parameters are hard coded, we want
to have the ability to configure the backoff parameters for webhook
retry logic.
2020-11-01 10:18:25 -05:00
wojtekt
5a8f94cb30 Disable watchcache for events 2020-10-31 19:51:33 +01:00
Shihang Zhang
ff641f6eb2 mv TokenRequest and TokenRequestProjection to GA 2020-10-29 20:47:01 -07:00
Andrew Sy Kim
a0aebf96ec apiserver: support egress selection name 'controlplane' and deprecate 'master'
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
2020-10-26 10:24:16 -04:00
Kubernetes Prow Robot
e7b9453972
Merge pull request #93537 from timuthy/enhancement.move-resourcequota
Move ResourceQuota admission to k8s.io/apiserver lib
2020-09-15 12:26:58 -07:00
David Eads
c0c033b12f generated 2020-09-14 09:24:41 -04:00
David Eads
c7911a384c remove pod presets 2020-09-14 09:24:40 -04:00
Tim Usner
70d440bc7e Move ResourceQuota admission to k8s.io/apiserver 2020-09-04 14:53:52 +02:00
yiduyangyi
e6c4633232 fix golint failures in pkg/kubeapiserver/options, fix some incorrect replace of receiver name 2020-07-23 19:02:07 +08:00
yiduyangyi
0520d75838 fix golint failures in pkg/kubeapiserver/options, rename receiver name of BuiltInAuthorizationOptions to o 2020-07-23 18:52:15 +08:00
yiduyangyi
e441c07fe2 fix golint failures in pkg/kubeapiserver/options, use API Server in commemts instead of APIServer 2020-07-23 18:41:37 +08:00
yiduyangyi
e2838df7c7 fix golint failures in pkg/kubeapiserver/options 2020-07-15 16:03:08 +08:00
Patrick Ohly
22aeb81e84 CSIStorageCapacity: CSIStorageCapacity API
This adds the CSIStorageCapacity API change for
https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/1472-storage-capacity-tracking
2020-07-03 21:54:14 +02:00
Jordan Liggitt
e5e557e902 apiserver: add API server plumbing for adding warnings 2020-06-11 16:04:19 -04:00
Davanum Srinivas
07d88617e5
Run hack/update-vendor.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:33 -04:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
Jordan Liggitt
fd78947489 Indicate node authorizer does not support rule resolution 2020-05-12 20:34:13 -04:00
Tomas Nozicka
b22a170d46 Fix client-ca dynamic reload in apiserver 2020-04-29 16:03:09 +02:00
Jiajie Yang
ae0e52d28c Monitoring safe rollout of time-bound service account token. 2020-04-22 11:59:16 -07:00
Monis Khan
df292749c9
Remove support for basic authentication
This change removes support for basic authn in v1.19 via the
--basic-auth-file flag.  This functionality was deprecated in v1.16
in response to ATR-K8S-002: Non-constant time password comparison.

Similar functionality is available via the --token-auth-file flag
for development purposes.

Signed-off-by: Monis Khan <mok@vmware.com>
2020-03-11 20:55:47 -04:00
Rob Scott
132d2afca0
Adding IngressClass to networking/v1beta1
Co-authored-by: Christopher M. Luciano <cmluciano@us.ibm.com>
2020-03-01 18:17:09 -08:00
Kubernetes Prow Robot
03b7f272c8
Merge pull request #88246 from munnerz/csr-signername-controllers
Update CSR controllers & kubelet to respect signerName field
2020-02-28 23:38:39 -08:00
Jefftree
1b38199ea8 pass Dialer instead of egressselector to webhooks 2020-02-27 17:47:23 -08:00
Jefftree
d318e52ffe authentication webhook via network proxy 2020-02-27 17:47:23 -08:00
James Munnelly
d7e10f9869 Add Certificate signerName admission plugins 2020-02-27 15:50:14 +00:00
Jordan Liggitt
c80dcf56ee Ensure webhook/quota/deny admission comes last 2020-02-25 21:54:14 -05:00
Kubernetes Prow Robot
77e8c75f32
Merge pull request #87754 from MikeSpreitzer/apf-filter5
Add twice refactored filter and config consumer for API Priority and Fairness
2020-02-13 16:54:46 -08:00
Charles Eckman
5a176ac772 Provide OIDC discovery endpoints
- Add handlers for service account issuer metadata.
- Add option to manually override JWKS URI.
- Add unit and integration tests.
- Add a separate ServiceAccountIssuerDiscovery feature gate.

Additional notes:
- If not explicitly overridden, the JWKS URI will be based on
  the API server's external address and port.

- The metadata server is configured with the validating key set rather
than the signing key set. This allows for key rotation because tokens
can still be validated by the keys exposed in the JWKs URL, even if the
signing key has been rotated (note this may still be a short window if
tokens have short lifetimes).

- The trust model of OIDC discovery requires that the relying party
fetch the issuer metadata via HTTPS; the trust of the issuer metadata
comes from the server presenting a TLS certificate with a trust chain
back to the from the relying party's root(s) of trust. For tests, we use
a local issuer (https://kubernetes.default.svc) for the certificate
so that workloads within the cluster can authenticate it when fetching
OIDC metadata. An API server cannot validly claim https://kubernetes.io,
but within the cluster, it is the authority for kubernetes.default.svc,
according to the in-cluster config.

Co-authored-by: Michael Taufen <mtaufen@google.com>
2020-02-11 16:23:31 -08:00
Mike Spreitzer
73614ddd4e Added API Priority and Fairness filter and config consumer 2020-02-10 22:54:40 -05:00
Monis Khan
9b23f22472
Make oidc authenticator audience agnostic
This change removes the audience logic from the oidc authenticator
and collapses it onto the same logic used by other audience unaware
authenticators.

oidc is audience unaware in the sense that it does not know or
understand the API server's audience.  As before, the authenticator
will continue to check that the token audience matches the
configured client ID.

The reasoning for this simplification is:

1. The previous code tries to make the client ID on the oidc token
a valid audience.  But by not returning any audience, the token is
not valid when used via token review on a server that is configured
to honor audiences (the token works against the Kube API because the
audience check is skipped).

2. It is unclear what functionality would be gained by allowing
token review to check the client ID as a valid audience.  It could
serve as a proxy to know that the token was honored by the oidc
authenticator, but that does not seem like a valid use case.

3. It has never been possible to use the client ID as an audience
with token review as it would have always failed the audience
intersection check.  Thus this change is backwards compatible.

It is strange that the oidc authenticator would be considered
audience unaware when oidc tokens have an audience claim, but from
the perspective of the Kube API (and for backwards compatibility),
these tokens are only valid for the API server's audience.

This change seems to be the least magical and most consistent way to
honor backwards compatibility and to allow oidc tokens to be used
via token review when audience support in enabled.

Signed-off-by: Monis Khan <mok@vmware.com>
2020-02-04 13:24:49 -08:00
Kubernetes Prow Robot
720e6de6b9
Merge pull request #85168 from Jefftree/admission-wh-proxy
Use Network Proxy for Admission Webhooks
2020-01-08 16:07:40 -08:00
Jefftree
1289bdaba4 network proxy with admission wh 2020-01-08 15:01:38 -08:00
Jin Hase
49b6e40461 Clean up kube-apiserver reference document 2019-12-24 21:21:06 +09:00
Ted Yu
1cb3992d1b Switch storage version to use v1.CSINode in 1.18 2019-11-25 19:14:09 -08:00
Jordan Liggitt
dc0e51dd18 Plumb authorization webhook version from CLI to config 2019-11-18 23:58:05 -08:00
Mike Danese
d16dde36a3 inline GC in expiring cache
This allows us to drop the background goroutine with negligable
difference in performance.
2019-11-15 17:50:31 -08:00
Kubernetes Prow Robot
19b4017b5d
Merge pull request #84424 from mikedanese/expcache
Add an expiring cache for the caching token authenticator
2019-11-14 17:50:06 -08:00
Mike Danese
3f194d5b41 migrate token cache to cache.Expiring 2019-11-14 13:50:15 -08:00
hwdef
b3377e61de pkg/kubeapiserver: fix staticcheck warning 2019-11-14 11:24:22 +08:00
Kubernetes Prow Robot
94efa988f4
Merge pull request #84813 from deads2k/admission-feature-gates
remove global variable dependency from admission plugins
2019-11-12 10:23:14 -08:00
Jordan Liggitt
d54a70db5c Switch kubelet/aggregated API servers to use v1 subjectaccessreviews 2019-11-11 17:19:11 -05:00
Jordan Liggitt
5ef4fe959a Switch kubelet/aggregated API servers to use v1 tokenreviews 2019-11-11 17:19:10 -05:00
Kubernetes Prow Robot
49a9b6cadf
Merge pull request #84727 from danwinship/ipv6-bind
fix apiserver to advertise IPv6 endpoints if bound to IPv6
2019-11-08 18:44:24 -08:00
David Eads
675c2fb924 add featuregate inspection as admission plugin initializer 2019-11-08 13:07:40 -05:00
Dan Winship
afa0b808f8 Fix apiserver to advertise IPv6 endpoints if bound to IPv6
Also rename utilnet.ChooseBindAddress() to ResolveBindAddress(), to
better describe its functionality.
2019-11-06 11:31:43 -05:00
Kubernetes Prow Robot
2aeacf025b
Merge pull request #84723 from hypnoglow/fix-golint-kubeapiserver
Fix golint issues in pkg/kubeapiserver
2019-11-05 22:18:20 -08:00
Igor Zibarev
03dfa1a641 Fix golint issues in pkg/kubeapiserver 2019-11-05 22:25:32 +03:00
Kubernetes Prow Robot
1d1385af91
Merge pull request #83474 from msau42/topology-ga
CSI Topology ga
2019-11-04 15:28:27 -08:00
Michelle Au
603a2aa8a9 Add CSINode to storage/v1 2019-10-28 13:41:13 -07:00
Jordan Liggitt
20b2439457 Feature-gate RuntimeClass informer starts 2019-10-24 01:18:07 -04:00
David Eads
6beb96261e wire up a means to dynamically reload ca bundles for kube-apiserver 2019-10-23 11:01:56 -04:00
draveness
1163a1d51e feat: update taint nodes by condition to GA 2019-10-19 09:17:41 +08:00
David Eads
5825634669 add the ability for dynamic header names in delegated authentication 2019-10-11 11:50:37 -04:00
David Eads
51195dd860 add ability to authenticators for dynamic update of certs 2019-10-01 09:50:20 -04:00
Kubernetes Prow Robot
478c26c0dc
Merge pull request #82033 from logicalhan/reviewers
add logicalhan to reviewers for api-machinery directories
2019-09-26 16:55:37 -07:00
mengyang02
da072063d1 to use existing validating function 2019-09-24 20:16:17 +08:00
Ted Yu
cdc1b71bde WithAuthentication should wrap WithMaxInFlightLimit 2019-09-19 13:39:49 -07:00
Kubernetes Prow Robot
8af33f9733
Merge pull request #81946 from deads2k/cache
add cache-control headers to kube-apiserver
2019-08-28 05:11:39 -07:00
Han Kang
b6831039b7 add logicalhan to reviewers for api-machinery directories 2019-08-27 10:40:29 -07:00
David Eads
f589c1213c add cache-control headers to kube-apiserver 2019-08-26 13:00:31 -04:00
Tim Allclair
c6173b28a9 Enable the RuntimeClass admission controller for scheduling 2019-08-23 13:33:06 -07:00
Jordan Liggitt
61774cd717 Plumb context to admission Admit/Validate 2019-08-20 11:11:00 -04:00
Ted Yu
3d2bc6f6ae Constant time password comparison 2019-08-07 22:07:57 -07:00
Kubernetes Prow Robot
e4f1588352
Merge pull request #78484 from egernst/runtimeclass-admission
Runtimeclass admission
2019-06-28 23:35:24 -07:00
draveness
ca6003bc75 feat: cleanup PodPriority features gate 2019-06-23 11:57:24 +08:00
Eric Ernst
e8608300c2 autogenerated code update based in new plugin
Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-06-19 17:20:11 -07:00
Eric Ernst
2d326345f2 add RuntimeClass admission controller plugin
Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-06-19 17:20:11 -07:00
Jordan Liggitt
9469fc0a71 Map replicationcontrollers/scale to extensions/v1beta1 replicationcontrollers/scale 2019-05-28 14:30:20 -04:00
SataQiu
64193630a7 cleanup: move the comment to its place 2019-05-23 12:29:12 +08:00
Daniel (Shijun) Qian
5268f69405 fix duplicated imports of k8s code (#77484)
* fix duplicated imports of api/core/v1

* fix duplicated imports of client-go/kubernetes

* fix duplicated imports of rest code

* change import name to more reasonable
2019-05-08 10:12:47 -07:00
Christopher M. Luciano
4bac85c162
ingress: use networking api group for default storage of ingress
Signed-off-by: Christopher M. Luciano <cmluciano@us.ibm.com>

The change to registrytest was found by liggitt to mitigate a NPE error.
This is necessary since ingress is a cohabitating resource that is not
stored in the default version for the networking resource.

Signed-off-by: Christopher M. Luciano <cmluciano@us.ibm.com>
2019-05-01 15:14:11 -04:00
Kubernetes Prow Robot
98b6f35999
Merge pull request #74610 from oomichi/issue/74038-2
Enable StorageObjectInUseProtection by default
2019-04-16 02:11:29 -07:00