Commit Graph

187 Commits

Author SHA1 Message Date
Han Kang 050d1b223c add /livez as a liveness endpoint for kube-apiserver
go fmt

make func private

refactor config_test

Two primary refactorings:

1. config test checkPath method is now each a distinct test
run (which makes it easier to see what is actually failing)

2. TestNewWithDelegate's root path check now parses the json output and
does a comparison against a list of expected paths (no more whitespace
and ordering issues when updating this test, yay).

go fmt

modify and simplify existing integration test for readyz/livez

simplify integration test

set default rbac policy rules for livez

rename a few functions and the entrypoint command line argument (and etcetera)

simplify interface for installing readyz and livez and make auto-register completion a bootstrapped check

untangle some of the nested functions, restructure the code

Kubernetes-commit: aa1b2d6d35c92a31be17357fc66cfc1eca8a67e0
2019-08-26 16:57:25 -07:00
David Eads ad3b19aeee add cache-control headers to kube-apiserver
Kubernetes-commit: f589c1213c8ba4fa0e31c523b2e9dcc27298084f
2019-08-26 09:39:29 -04:00
David Eads 47da497af8 allow an apiserver to only serve http1
Kubernetes-commit: 6eb62506e05d7181caf552e50d9b78609aea1943
2019-08-23 15:02:26 -04:00
Han Kang 2b0c93afef rename healthz methodNames to be more consistent w/ present day usages
Kubernetes-commit: 2e23788fda86c68e7f17cf0b66ee1017594c1055
2019-08-13 12:42:13 -07:00
Walter Fender 9bdac68d70 Get network-proxy working with GCE.
Got the proxy-server coming up in the master.
Added certs and have it comiung up with those certs.
Added a daemonset to run the network-agent.
Adding support for agent running as a sameon set on every node.

Added quick hack to test that proxy server/agent were correctly
tunneling traffic to the kubelet.

Added more WIP for reading network proxy configuration.
Get flags set correctly and fix connection services.
Adding missing ApplyTo
Added ConnectivityService.
Fixed build directives. Added connectivity service configuration.
Fixed log levels.
Fixed minor issues for feature turned off.
Fixed boilerplate and format.
Moved log dialer initialization earlier as per Liggits suggestion.
Fixed a few minor issues in the configuration for GCE.
Fixed scheme allocation
Adding unit test.
Added test for direct connectivity service.

Switching to injecting the Lookup method rather than using a Singleton.
First round of mikedaneses feedback.
Fixed deployment to use yaml and other changes suggested by MikeDanese.

Switched network proxy server/agent which are kebab-case not camelCase.
Picked up DIAL_RSP fix.
Factored in deads2k feedback.
Feedback from mikedanese
Factored in second round of feedback from David.
Fix path in verify.
Factored in anfernee's feedback.
First part of lavalamps feedback.
Factored in more changes from lavalamp and mikedanese.

Renamed network-proxy to konnectivity-server and konnectivity-agent.
Fixed tolerations and config file checking.
Added missing strptr
Finished lavalamps requested rename.
Disambiguating konnectivity service by renaming it egress selector.

Switched feature flag to KUBE_ENABLE_EGRESS_VIA_KONNECTIVITY_SERVICE

Kubernetes-commit: ebb65c5f4c51340f42c260cf00bde8629ed68d74
2019-05-20 12:44:51 -07:00
Dr. Stefan Schimanski 5f126c4400 apiserver: add --shutdown-delay-duration to keep serving until LBs stop serving traffic
Kubernetes-commit: 408f36b8825136c2b1771f642d88557e83a2ddb7
2019-02-22 15:13:28 +01:00
Clayton Coleman 72566fea6c Replace HTTP compression with an inline handler
The previous HTTP compression implementation functioned as a filter, which
required it to deal with a number of special cases that complicated the
implementation.

Instead, when we write an API object to a response, handle only that one
case. This will allow a more limited implementation that does not impact
other code flows.

Also, to prevent excessive CPU use on small objects, compression is
disabled on responses smaller than 128Kb in size.

Kubernetes-commit: 4ed2b9875d0498b5c577095075bda341e96fcec2
2019-05-04 17:36:36 -04:00
Mike Spreitzer 0cc4524200 Make AuthorizeClientBearerToken actually return if authn or authz is nil
There was a typo, the test was there but the return was not.

Added test that exposes the difference.

Kubernetes-commit: 7056e216addc7203f24c37a95c5c14ad194dddca
2019-06-18 23:37:16 -04:00
Han Kang 7fd71e31ef add readyz endpoint for kube-apiserver readiness checks
add startup sequence duration and readyz endpoint

add rbac bootstrapping policy for readyz

add integration test around grace period and readyz

rename startup sequence duration flag

copy health checks to fields

rename health-check installed boolean, refactor clock injection logic

cleanup clock injection code

remove todo about poststarthook url registration from healthz

Kubernetes-commit: 54dcf5c9c46fc4782d4861936309349b5a71a1ac
2019-05-30 11:19:49 -07:00
Jordan Liggitt 6562ecd83a Add GetResourceMapper to admission ObjectInterfaces
Kubernetes-commit: 92f735042e1cae38afe74364c036489fb7a81973
2019-05-13 11:24:20 -04:00
yue9944882 95755841db fixes compatibility w/ nil authorizer in apiserver
Kubernetes-commit: 2486174142023ef785f196afee69bbcb78ae1f52
2019-01-29 00:38:57 +08:00
Chao Xu fbe608d634 Loosing the request body size limit to 100MB to account for the size
ratio between json and protobuf.

Kubernetes-commit: 27166e48b86bf19570ae4e57775906cca1f52ad0
2019-02-07 14:43:35 -08:00
Chao Xu 4ebbf20f41 Adding a limit on the maximum bytes accepted to be decoded in a resource
write request.

Kubernetes-commit: b971b12d3cfa8887aa87957fbba92b90e3e99dc6
2019-02-06 16:58:24 -08:00
Chao Xu f60d1ce95c Set the maximum size increase the copy operations in a json patch can cause
Kubernetes-commit: f001f9e1dbce644a1b7d22b370ab37fc7d770c7e
2019-02-04 11:15:16 -08:00
Marek Counts 0550db794e move logs into component-base
all the code changes to move move /apiserver/pkg/util/logs into /component-base/logs

Kubernetes-commit: ba81a5409affb6b861d5994c1e2f7c74a05826e5
2019-01-17 09:06:12 -05:00
Jordan Liggitt 2109711572 Remove build/verify scripts for swagger 1.2 API docs, API server swagger ui / swagger 1.2 config
Kubernetes-commit: 9229399bd6049bc7766829b436d5cb5fe0dfe2f1
2019-01-15 10:44:36 -05:00
Davanum Srinivas 2710b17b80 Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135

Kubernetes-commit: 954996e231074dc7429f7be1256a579bedd8344c
2018-11-09 13:49:10 -05:00
Mike Danese 37ab80320b tokenreview: add APIAudiences config to generic API server and augment context
Kubernetes-commit: 21fd8f204128a7847786927b460d95be34a6dbde
2018-10-09 22:04:52 -07:00
Marian Lobur 7dbcbd39e2 Remove deprecated legacy audit logging code.
Kubernetes-commit: 3f730d4c255e7c8ee67a020eed0b8f0a8f634750
2018-07-05 13:57:17 +02:00
xuzhonghu e767cd8dbf kube-apiserver make use of GlogSetter
Kubernetes-commit: 38d48e8d025a9cceccfc8a80d72f751b8bb65dab
2018-06-05 10:32:46 +08:00
Solly Ross 42da2694e6 Autoset OpenAPI version w/o SecurityDefinitions
There's code to automatically populate OpenAPI info based on existing
generic apiserver config, but it only fires if securitydefinitions are
present.  This doesn't make much sense, since this info is both required
and independent of security definitions, and there's no easy, generic
way to generate security definitions for an aggregated API server.

Kubernetes-commit: ef73bb684bcc4402f66160f254193d2690b80f11
2018-07-19 17:32:40 -04:00
Dr. Stefan Schimanski 4c6f8fdc17 apiserver: make loopback logic in SecureServingOptions reusable
Kubernetes-commit: dc0a736d1ea924dfa35ece64cb59d551c2a0b51f
2018-07-04 17:08:23 +02:00
Dr. Stefan Schimanski 25a00cd3c1 apiserver: get rid of ReadWritePort in config
Kubernetes-commit: e32f380fa5df4361894570787814d0459baada93
2018-07-04 17:01:49 +02:00
Jordan Liggitt 6c34ac4aa5 Add healthz check to ensure logging is not blocked
Kubernetes-commit: b7b4b84afe4405cde976ceeeccb62acecac1c4f0
2018-06-09 17:32:14 -04:00
jennybuckley 900791d3ac Add additional authorization check for create-on-update
Kubernetes-commit: cc5c17e554a4d8f802043b337ca0787ec0ce7475
2018-07-03 11:20:16 -07:00
xuzhonghu 47a9a6d77a fix go import
Kubernetes-commit: 57393ec932398b6f53c6593421bfe0b12d445518
2018-06-01 14:05:44 +08:00
xuzhonghu f0fd6a74c2 Support dynamicly set logging verbosity
Kubernetes-commit: 73a22b2e611647de04aa8d7fe910fd4657e6a9d8
2018-05-14 16:19:38 +08:00
Jordan Liggitt 4645ab9a4c Correctly identify types served in the kube-apiserver openapi doc
Kubernetes-commit: 43551e82081a1fa364879bd49e67095a3fc0926b
2018-05-22 19:29:00 -04:00
Jordan Liggitt 25758bf0f8 Remove request context mapper
Kubernetes-commit: 8ea88a5092c767fc3141512db924fd0435f7670e
2018-04-18 11:12:15 -04:00
Dr. Stefan Schimanski 1075399c96 apiserver: enforce shared RequestContextMapper in delegation chain
Kubernetes-commit: 9f906618f04baceaf923e873530f9741e80ad2cb
2018-04-04 10:05:06 +02:00
David Eads 416f1ae672 update metrics to true like it is for kube-apiserver
Kubernetes-commit: 456fd386dc6db8ba5ced338a5935de8229c14047
2018-03-09 14:36:04 -05:00
Mike Spreitzer aa5d4f9f32 Fixes for HTTP/2 max streams per connection setting
This PR makes two changes.  One is to introduce a parameter
for the HTTP/2 setting that an api-server sends to its clients
telling them how many streams they may have concurrently open in
an HTTP/2 connection.  If left at its default value of zero,
this means to use the default in golang's HTTP/2 code (which
is currently 250).

The other change is to make the recommended options for an aggregated
api-server set this limit to 1000.  The limit of 250 is annoyingly low
for the use case of many controllers watching objects of Kinds served
by an aggregated api-server reached through the main api-server (in
its mode as a proxy for the aggregated api-server, in which it uses a
single HTTP/2 connection for all calls proxied to that aggregated
api-server).

Fixes #60042

Kubernetes-commit: 201c11f147c85b029665915bee3a62eea19d6d57
2018-02-19 14:18:07 -05:00
Mike Danese a7b5c83c7b apiserver: fix some typos from refactor
introduced in #59582

Kubernetes-commit: 83c1334e5110e6f492f0e375488978ebb16a62a5
2018-02-14 17:47:42 -08:00
Dr. Stefan Schimanski 338a852bbb apiserver: make SecureServingOptions and authz/n options re-usable
Kubernetes-commit: 4e0114b0dd3701b68c02d038edcf4fbe84515a68
2018-01-31 16:17:48 +01:00
David Eads 0989af6244 remove --tls-ca-file which had no effect
Kubernetes-commit: 114711f77d1f12e10b1190db02ca17302992f5ad
2018-01-29 10:29:14 -05:00
hzxuzhonghu f5af0796fc pass APIEnablement through apiserver chain
Kubernetes-commit: 2f403b7ad18a179514f1de77e29f1a2549ef030a
2017-12-21 11:27:20 +08:00
Davanum Srinivas 9dd28d8beb Fix ExternalAddress parsing problem under IPv6
`!strings.Contains(host, ":")` will fail miserably under ipv6

Kubernetes-commit: c258d4df84089b08b9cbd37b1dee4b00576a2532
2018-01-04 14:00:04 -05:00
Davanum Srinivas 30e6bc192e 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.

Kubernetes-commit: 31332fa84a0928085200ba5a2e35118516ee2c48
2017-12-04 15:06:07 -05:00
hzxuzhonghu 170e8ac6dd pass listener to genericapiserver
Kubernetes-commit: 6ba30f678c232793430a98770e7a851f1e814fd2
2017-11-16 13:32:12 +08:00
hzxuzhonghu 065ff42f34 gracefully shutdown apiserver after all non-long running requests finish
Kubernetes-commit: db4f0de28075f34bb4bfa8d821ad25cd3a7eba1f
2017-11-02 19:29:31 +08:00
Dr. Stefan Schimanski eecedb2781 Revert "audit backend run shutdown gracefully after http handler finish"
This reverts commit f42686081bff88e44b339562c4927775f4439671.

Kubernetes-commit: f6a89df3fb719f4db565c7dade63575ccbdb3031
2017-10-30 15:26:51 +01:00
hzxuzhonghu d1aa17bde6 audit backend run shutdown gracefully after http handler finish
Kubernetes-commit: f42686081bff88e44b339562c4927775f4439671
2017-10-20 16:26:49 +08:00
Robert Rati 80d8099973 Added PreShutdownHooks to the apiserver
Kubernetes-commit: 0840e6d86925f9bfa0b9beea0e7ddf52791e8523
2017-10-12 21:20:46 -04:00
supereagle 063df5c7b3 fix typos: remove duplicated word in comments
Kubernetes-commit: 87c29a08e1f51b2989ff15fc3e5857bc287e401f
2017-06-17 17:17:22 +08:00
p0lyn0mial f189d35f0e removes Authorizer and ExternalClientSet from kubeapiserver's admission initializer.
Kubernetes-commit: 6b1f1d14148fe3962594d8f4c9ca15d1c6171819
2017-10-03 18:08:30 +02: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 e4b1b0656b apiserver: make config completion structural recursion
Kubernetes-commit: 1bcea54104cb7f53e58924dd5413cf4ba7ceb587
2017-09-09 21:44:32 +00:00
David Eads 9f885389e9 make url parsing in apiserver configurable
Kubernetes-commit: ccc7c9bdfa80caee93953a96dec0d689d93f08e5
2017-09-04 14:03:48 +00:00
mbohlool eaf131e1fc Provide whole delegate chain to kube aggregator
Kubernetes-commit: 7cbdb90890ac89ec15be2b21b5cbdc51e94e42d6
2017-09-04 14:03:46 +00:00
Maciej Szulik 677d724b3a Allow audit to log authorization failures
Kubernetes-commit: 9fef244d4ccce0ea8daf37ab86a7af4892d000cf
2017-09-03 14:04:12 +00:00
xilabao a50d8a0b4f add selfsubjectrulesreview api
Kubernetes-commit: f14c1384387ac196e87334b5a0e05e01d7581387
2017-09-03 14:04:10 +00:00
Joe Betz e1e8bebf50 Add --request-timeout to allow the global request timeout of 60 seconds to be configured.
Kubernetes-commit: cb764756c6f152bfb866b161315369bc47ebf13c
2017-08-29 13:18:50 +00:00
huangjiuyuan c229fe60e4 fix typo in staging/src/k8s.io/apiserver/pkg/server/config.go
Kubernetes-commit: 1382d2f6e8baa2342e2b117b527d4b74d3b539ee
2017-08-29 13:13:50 +00:00
mbohlool e671fe20d7 Update main repo references to new kube-openapi repo
Kubernetes-commit: 400b77b48f972b1e10854980586559d5852088c7
2017-08-29 13:13:04 +00:00
deads2k 7f0ff974d5 rate limiting should not affect system masters
Kubernetes-commit: 8a3b4d81e6c3a74fa1afa5fd17d3bf42ba1e856d
2017-07-28 13:56:11 +00:00
Shiyang Wang 276c240fae Fix 401/403 apiserver errors do not return 'Status' objects
Kubernetes-commit: 3d6479f7216dcb61e56ab6dd53fad7176930645d
2017-07-05 23:59:23 +00:00
deads2k fc0bd6b232 make the panic handler first
Kubernetes-commit: 9b43bd4a5b234d528ebc0fd059ae69eedced8c7f
2017-07-05 23:59:22 +00:00
Scott Weiss b74e5942e2 add compression to GET and LIST api requests
this feature is gated; disabled by default

Kubernetes-commit: c305f72315a83c16c40fbbfd06b563f9e67208ff
2017-06-28 00:14:31 +00:00
deads2k 10de73bc53 move CRD behind TPR
Kubernetes-commit: 18177e2bdeafbddeb3d66fec0b8cb88794cd69ff
2017-06-13 20:47:29 +00:00
Tim St. Clair 8ff532a4cb Implement audit policy logic
Kubernetes-commit: a5de309ee261aea15bb1cc12647b32640c2ac196
2017-06-13 20:47:28 +00:00
Dr. Stefan Schimanski ec8d130fa7 audit: wire through non-nil context everywhere
Kubernetes-commit: ce942d19c378ecd335e7e158e30cdc184f9d6184
2017-06-13 20:47:28 +00:00
Dr. Stefan Schimanski f7d766d92d audit: add audit event to the context and fill in handlers
Kubernetes-commit: 0b5bcb021932355b3ff7c2b45fb579f4adad84bf
2017-06-13 20:47:28 +00:00
Dr. Stefan Schimanski 6bd3c73150 apiserver: move LongRunningRequestCheck type into endpoints/request
Kubernetes-commit: c1bf6e832e2887ef6cd0e7b7fa97a168fdf474e5
2017-06-13 20:47:27 +00:00
p0lyn0mial ceeef3670c This PR implements AdmissionOptions.ApplyTo
ApplyTo adds the admission chain to the server configuration the method lazily initializes a generic plugin
that is appended to the list of pluginInitializers.

apiserver.Config will hold an instance of SharedInformerFactory to ensure we only have once instance.
The field will be initialized in apisever.SecureServingOptions

Kubernetes-commit: 8cea69aa9812d6627ebdfa4f8b9c1d7624a8f3f5
2017-05-16 17:27:50 +00:00
deads2k 49f3eb05d8 refactor names for the apiserver handling chain
Kubernetes-commit: 4389f715768661731f0aae7438b2cc8414c9746a
2017-05-12 17:30:09 +00:00
mbohlool a44fceadf3 Update go-restful dependency
Kubernetes-commit: ea042c6ca0fc7eb8017012ca56d6879b8cf10637
2017-05-12 17:30:08 +00:00
deads2k 585812f439 use our own serve mux that directs how we want
Kubernetes-commit: c837c7fb1a227ef8c772ad15b08ff47593379543
2017-05-04 20:36:37 +00:00
deads2k 2b31ba8b9c separate discovery from the apiserver
Kubernetes-commit: e099f5eee60ad32661d28a2eda9d615ac25ba9a4
2017-05-02 20:36:05 +00:00
deads2k 01f14fece5 only log stacks on server errors
Kubernetes-commit: b73cddb2278d792c7e07d4e69969df32636ecb6d
2017-04-10 20:35:11 +00:00
Jordan Liggitt 72998a2b11 Allow disabling specific post-start hooks
Kubernetes-commit: 2c89ff59e22e0d9c825203c4cb94613a3b246d64
2017-03-31 20:37:16 +00:00
Jordan Liggitt b137e92ccf Plumb cipher/tls version serving options
Kubernetes-commit: e156aca4f21331465ba9406be362b9f16b8aba9e
2017-03-31 20:37:15 +00:00
deads2k 38fb6e78f7 move legacy insecure options out of the main flow
Kubernetes-commit: cd297546807fc08546905a2b96879d13bcf3a30b
2017-03-31 20:37:15 +00:00
deads2k b3af46c0dc wire in aggregation
Kubernetes-commit: 8e26fa25da6d3b1deb333fe2484f794795d1c6b9
2017-03-31 20:37:15 +00:00
deads2k 8c644986dc require codecfactory
Kubernetes-commit: 087a03022106c02f82a497f65b945f3cbab3f643
2017-03-31 20:37:15 +00:00
deads2k 6e5dbf8e26 rewire aggregation handling chain to be normal
Kubernetes-commit: b28966b48ae8e3e10427e0347f33a36053884e0a
2017-03-31 20:37:15 +00:00
deads2k 43ba6dde7a allow combining API servers
Kubernetes-commit: bccef75d7ae43be333e068748bb6f998dafa6d9d
2017-03-31 20:37:15 +00:00
deads2k 4620c09303 allow fallthrough handling from go-restful routes
Kubernetes-commit: 02efeeaf4087533803299356de1673c8400bc351
2017-03-31 20:37:15 +00:00
deads2k 7170396682 tweak defaults for recommended apiserver options
Kubernetes-commit: acba2cbd6d188a34f4c3032c933921ba22a0f77c
2017-03-18 19:56:08 +00:00
jg Chen 0446eafcdb fix misspell "roughly" in config.go 2017-02-23 09:48:09 -05:00
Dr. Stefan Schimanski 585aca0c2c k8s.io/apiserver: straighten EtcdOptions, backend Config and kube RESTOptionsFactory 2017-02-16 08:03:03 -05:00
deads2k 147d3934cf auto-create the loopback token 2017-02-14 14:04:06 -05:00
deads2k 9d21f84d8f streamline etcd options for aggregated api server 2017-02-13 07:36:42 -05:00
deads2k 284a95797b apiserver command line options lead to config 2017-02-13 07:36:41 -05:00
deads2k ad39e3715b add apiserver API group for structured configuration 2017-02-13 07:36:41 -05:00
Dr. Stefan Schimanski a372fcad62 Mechanical fixup imports: pkg/genericapiserver 2017-02-13 07:36:41 -05:00
Dr. Stefan Schimanski f3c3e07241 Mechanical move: pkg/genericapiserver -> k8s.io/apiserver 2017-02-13 07:36:41 -05:00