Commit Graph

94 Commits

Author SHA1 Message Date
Jack Kleeman 40fefa1b37 Plumb dynamic SNI certificates
We create and use a dynamic certificate provider for the SNI serving
certificates. Currently we only use static serving certificate
providers, so the files are not reloaded, but we should be able to move
to a provider that is able to reload later on.

Kubernetes-commit: 84bc6b151d0726db0c737443874577f044e0e9c8
2019-10-08 19:03:56 +01:00
Jack Kleeman 8da4640a3d Plumb dynamic serving certificates
We create and use a dynamic certificate provider for the main apiserver
serving certificates: SNI will be handled separately later. Currently we
only use static serving certificate providers, so the files are not
reloaded, but we should be able to move to a provider that is able to
reload later on.

Kubernetes-commit: 6f89f1027488aeba4af0786988c2fd2ace9a6f1d
2019-10-07 18:49:24 +01:00
David Eads 695d42bf49 wire dynamic tlsconfig up to apiserver
Kubernetes-commit: abddbd87cdcf69053e9fc6e752ade7d92c6b9fd7
2019-10-04 08:37:26 -04:00
David Eads f591b4fabd add ability to pre-configure poststarthooks for apiservers
Kubernetes-commit: f14f4c933ee01d219ffbfa846875171e179019b7
2019-08-28 08:53:20 -04:00
Jordan Liggitt f7fbf2eee4 Limit YAML/JSON decode size
Kubernetes-commit: 8ef4566cefebf49f9a806a36df2105c9149785a1
2019-09-27 16:36:48 -04:00
Han Kang 26cf2f2052 expose and use an AddHealthChecks method directly on config
Kubernetes-commit: 97b58ece4a2ad1a366a9cf7deea9581373931238
2019-09-13 17:04:00 -07:00
Walter Fender da748a626b Add support for konnectivity service to the etcd3 client.
If konnectivity service is enabled, the etcd client will now use it.
This did require moving a few methods to break circular dependencies.

Factored in feedback from lavalamp and wenjiaswe.

Kubernetes-commit: edbb0fa2fe2084d5d9ce0cf9dc0d1b2d820bb392
2019-08-27 15:58:06 -07:00
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