Commit Graph

632 Commits

Author SHA1 Message Date
Jordan Liggitt 754e90a0a3 Promote apiserver_requested_deprecated_apis metric to stable
Kubernetes-commit: 7877539e3095669629e81633019836d2cdb7c368
2021-05-11 16:24:58 -04:00
Julian V. Modesto c10cbf5412 Respect annotation size limit for SSA last-applied.
To support CSA and SSA interoperability, SSA updates the CSA
last-applied annotation.

This change ensures we don't set a big last-applied annotation if the
value is over the annotation limits.

Also, make sure that it's possible to opt-out of this behavior by
setting the CSA annotation to "" the empty string.

Kubernetes-commit: 6054320be1e50a450e9d1e19a79caa96f2035d4d
2021-05-18 15:06:48 -04:00
Marcel Zięba 489e43cad9 Add logging of filters to api calls logs
Kubernetes-commit: 7e01b7260ac5cc20c1fc236cae220857726dc330
2021-05-17 11:52:33 +00:00
zhuangqh 640ba0e40e docs: fix outdated enhancement doc link
Signed-off-by: zhuangqh <zhuangqhc@gmail.com>

Kubernetes-commit: adf28648cb32d17cd186a6c7e8b264419e6d0759
2021-02-24 15:22:50 +08:00
卢振兴10069964 549cbbf8de fix broken link in some files
Kubernetes-commit: b29a5fb0746f772b38da570cd8fdc77396ffca31
2021-04-13 08:43:24 +08:00
Abu Kashem b84fa01322 add more context to post timeout request activities
Kubernetes-commit: 66587afb60b10569aa4ed35d53a4a91fcc40abd2
2021-04-09 12:09:35 -04:00
Zhou Peng c233874954 [k8s.io/apiserver/pkg/endpoints/discovery/]: improve readability
Do not wrap code here

Signed-off-by: Zhou Peng <p@ctriple.cn>

Kubernetes-commit: 95f7b4d8544eeba0bc06122b1a35db1ab603f19d
2021-04-27 13:55:31 +08:00
Lukasz Szaszkiewicz a9e68c9b32 let objects without metadata pass through the managedFields admission controller
Not all objects provide metadata. There might be extention servers that allow for creating objects without the metadata field.

This PR changes the managedFileds admission to deal with objects without the metadata field.
Object without that field will be passed directly to the wrapped admission controller for further validation.

Kubernetes-commit: 3dbaf305ae1e52105a338987f3770ff104def68b
2021-04-29 14:08:36 +02:00
Andrea Nodari ca3910bf4a Add nil path to mapping when a CR has no "scale" subresource
This is to prevent the ScaleHandler to drop the entry. In this way
entries just get ignored.

Kubernetes-commit: 5b666a61a170f61c7e223085478b24a03612fa99
2021-04-18 13:55:15 +02:00
Andrea Nodari a178a9c5d1 Drop managed fields entries with unknown fields
This is aligned to the behaviour of server-side apply on main resources.

Kubernetes-commit: c10dd884c494734d12aceb41daaccd1d8da9356b
2021-04-09 17:17:23 +02:00
Andrea Nodari 9c3786c066 Do not add managed fields if a scale entry doesn't own replicas
This happens when a request changes the .status.replicas but not
.spec.replicas

Kubernetes-commit: 8e4b5c849b67b3a12dbd63391a4e75234382ba2c
2021-04-04 19:05:45 +02:00
Andrea Nodari 8c0975e184 Check request info when updating managed fields during scale
- Test all versions to make sure each resource version is in the
  mappings
- Fail when request info contains an unrecognized version. We have tests
  that guarantee that all known versions are in the mappings. If we
  get a version in request info that is not there we should fail fast to
  prevent inconsistent behaviour (e.g. for some reason the mappings is
  not up to date).

Ensure all known versions are in mappings

Kubernetes-commit: 09649e58b5a1368929e194991a763afc8011795e
2021-03-11 16:51:46 +01:00
Antoine Pelisse ddd271ff4e Use ScaleHandler for all scalable resources
Kubernetes-commit: 816e80206c169006de9d0a76cd385ee31c5aff39
2021-03-11 11:05:05 -08:00
Andrea Nodari 8df8282eaf Track ownership of deployments scale subresource
Kubernetes-commit: a9ea98b3b9272a7f7788a0d37891e4b13b9be38d
2021-01-23 18:50:14 +01:00
Gautier Delorme af9424d2c9 remove go-openapi/spec
Signed-off-by: Gautier Delorme <gautier.delorme@gmail.com>

Kubernetes-commit: 34b0fcef5fc47e3fcddf7f6ca1b3e6176b2a5323
2021-04-20 17:48:33 +02:00
Andrea Nodari 2ec597ed01 Add "subresource" field to ManagedFieldEntry
This field is useful to namespace the managed field entries of a
subresource and differentiate them from the ones of the main resource.

Kubernetes-commit: 862d256195adf3be5475b1a6935e5feb78f884a5
2021-02-27 17:16:46 +01:00
Jordan Liggitt b97dfc761c allow evictions subresource to accept policy/v1 and policy/v1beta1
Kubernetes-commit: 33ad842480353f2816873bf728d75333948e4817
2021-03-31 16:54:55 -04:00
Monis Khan 2ad661f8c5 Prune stale entries from OWNERS files
Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: 91241eac9b7a7e62cc31e663147294bf6dc8f875
2021-04-07 10:38:27 -04:00
Kevin Delgado ea32c4f47f Chain the field manager creation calls in newDefaultFieldManager and test
Kubernetes-commit: d37461180a1e5a52aeb85cf5853e000acfeb852d
2021-04-13 16:15:25 +00:00
Abu Kashem bb69e234a6 apiserver: improve correlation by using the audit ID
- when we forward the request to the aggregated server, set the audit
  ID in the new request header. This allows audit logs from aggregated
  apiservers to be correlated with the kube-apiserver.
- use the audit ID in the current tracer
- use the audit ID in httplog
- when a request panics, log an error with the audit ID.

Kubernetes-commit: b607ca1bf3e1cf6152c446ea61ac7fdd9014e1f1
2021-03-02 19:27:43 -05:00
Abu Kashem f1a76db888 apiserver: manage audit ID associated with a request
Manage the audit ID early in the request handling logic so that it can
be used by different layers to improve correlation.
- If the caller does not specify a value for Audit-ID in the request
  header, we generate a new audit ID
- If a user specified Audit-ID is too large, we truncate it
- We echo the Audit-ID value to the caller via the response
  Header 'Audit-ID'

Kubernetes-commit: 31653bacb9b979ee2f878ebece7e25f79d3f9aa6
2021-03-02 19:22:39 -05:00
Brendan Burns 3ba2299cd2 Fix api installer to indicate PATCH may return a 201 for server side apply
Kubernetes-commit: cb72ce975630b44ec8786d5b72b1e0ee8bb1a0e4
2021-03-11 17:06:33 +00:00
Abu Kashem bf34b41185 refactor finishRequest
Kubernetes-commit: a8ff821a19b819a54a54d027ec631eab2ffaedc3
2021-03-22 18:01:33 -04:00
Abu Kashem 28c097bee7 move FinishRequest to its own package
Kubernetes-commit: 393a1f73fbaa1bf1facb8882eaf4fead16b94f58
2021-03-22 16:39:14 -04:00
Antoine Pelisse 49b6ebdaae fieldmanager: Strip managedfields BEFORE we update the timestamp
Kubernetes-commit: c8be9651ce0de1eee3fa785882fe01dee4b15d37
2021-03-09 12:46:07 -08:00
Danil-Grigorev de3d390777 Make selectors atomic
Ensure that all label selectors are treated as atomic values,
to exclude situations when selectors are being corrupted by
different actors attempting to apply their overlapping definition
for this field with server-side-apply.

Kubernetes-commit: d8a7764b6396b90313ae7bd50a845f4da4705d67
2021-01-12 18:29:56 +01:00
Marcel Zięba 7635650788 Fix incorret authentication metrics
Kubernetes-commit: 7dffc11abc37c4bd750a27553b6d983894bf865c
2021-03-08 13:34:55 +00:00
Kevin Delgado 86db6c67fb Server-Side Apply: Status Wiping/Reset Fields
Adds and implements ResetFieldsProvder interface in order to ensure that
the fieldmanager no longer owns fields that get reset before the object
is persisted.

Co-authored-by: Kevin Wiesmueller <kwiesmul@redhat.com>
Co-authored-by: Kevin Delgado <kevindelgado@google.com>

Kubernetes-commit: a1fac8cbd9289d95db4831a83239292ed56ce59d
2021-03-09 23:54:55 +00:00
David Eads 3f9e652c39 provide directly decodable versions for storageversion API
Kubernetes-commit: fa03dee68cea605b285b00ae5b6ce22659d95026
2021-03-08 09:33:46 -05:00
Han Kang fdbe19987d promote apiserver_request_duration_seconds to STABLE
Change-Id: I1b050b812738719aedd7ac6f4794ec742812e12d

Kubernetes-commit: 69e3d89a38b198d6261e675a31853583f3cce8f7
2021-03-07 17:14:36 -08:00
Kevin Wiesmueller b101f44b76 cleanup managedFields admission and test
Kubernetes-commit: 2d1ba0c35829a2f146a712d49cb21f382c9894cb
2021-03-04 23:20:51 +01:00
Kevin Wiesmueller 8ef7c0686d only use managedFields decoding for admission check
Kubernetes-commit: 98d498117b5566c1229d754d97923f61600660d8
2021-03-01 20:29:15 +01:00
Kevin Wiesmueller 7c5bd1b084 harden managedFields decoding
Kubernetes-commit: 470ad03d076cae44bc98c64a08eea32e65f1bb9f
2021-03-01 19:58:56 +01:00
Kevin Wiesmueller 543879f479 fix test dependencies
Kubernetes-commit: 295e47f60b64332ef4e3268db282184357440675
2021-02-26 20:33:36 +01:00
Kevin Wiesmueller e4b883c5c7 update licenses and bazel
Kubernetes-commit: 1a8e2bf0358651151a6440717b4de1f662c4571b
2021-02-26 20:14:22 +01:00
Kevin Wiesmueller 04593d2277 prevent fieldManager admission from wrapping nil
Kubernetes-commit: 22dfa6ae1b431cb8e8afe72ce7d60360bf766337
2021-02-26 20:14:11 +01:00
Kevin Wiesmueller a69b2cb302 use existing validation code and decoding in fieldManager admission
Kubernetes-commit: fc1841d72f7418dd2606fb796f2a1b664bb3a721
2021-02-26 20:03:10 +01:00
Kevin Wiesmueller f9c68c0e80 export and cleanup managedFields decoding
Kubernetes-commit: 589ca1be1c9e75b1730feacd1af6e2c817f693ac
2021-02-26 17:47:52 +01:00
Kevin Wiesmueller 82e671a5f8 add managedFields admission
Kubernetes-commit: f86b59ab79227929e7f283b859b4c59317399807
2021-02-11 16:22:16 +01:00
Kevin Wiesmueller 81cd3ef7b0 fix admission controller
Kubernetes-commit: 429a96da5e856c435b08b50791d462120724c475
2021-02-11 16:11:43 +01:00
Kevin Wiesmueller 7da058f6bb disable webhook for testing
Kubernetes-commit: ffbae9c5b4a3df9f7400d0047a5d7a957adf295d
2021-02-01 17:56:49 +01:00
Kevin Wiesmueller 08a5711ffb update bazel
Kubernetes-commit: a06f981fb1388976cd6427d7a4284d36dd2f2448
2021-01-14 20:33:50 +01:00
Kevin Wiesmueller a29734176f use managedFields admission controller in create/patch/update
Kubernetes-commit: 3d306e222de3b13a55030a53fef93622bb300646
2021-01-14 20:15:11 +01:00
Kevin Wiesmueller 4a5fdad93b implement managedFields admission controller
Kubernetes-commit: d5ae113e8dfba62709b1fccb8dbc26c6dde9b3e5
2021-01-14 20:14:38 +01:00
Han Kang 1cd0838bc2 bump apiserver_request_total to STABLE status
We've dropped the content-type field since it is effectively unbounded
(we had a sec-vuln about this before actually). We retain all other
fields, despite their unboundedness due to the fact that we can now
explicitly set bounds on label values.

Change-Id: Icc483fc6a17ea6382928f4448643cda6f3e21adb

Kubernetes-commit: cfd00de6866e636332bdcd3f46d6d2ffd8d2bc88
2021-03-04 07:52:00 -08:00
Kagaya 2422ff2d3b fix staticcheck for k8s.io/apiserver/pkg/endpoints
Kubernetes-commit: 9b02c89acd1c2c5664fdaa98884d17dfd5dad135
2021-02-27 15:37:00 +08:00
chymy f5152b019f Fix static failures for vendor/k8s.io/apiserver/pkg/endpoints/handlers
Kubernetes-commit: 04515b9c0a8634ddbb48883cdceb1c265ae97015
2021-02-26 21:01:55 -05:00
Alan Zhu 3292215ff4 at most every may result in less than expected times if overloaded
Signed-off-by: Alan Zhu <zg.zhu@daocloud.io>

Kubernetes-commit: 67234271ef50da475b4627b484b3b45ee54e8f8d
2021-02-25 16:27:42 +08:00
Han Kang 302deaf21a add myself to approvers for apiserver metrics
Change-Id: Iaf78c3ffb2779701ba50cbbf38c0d7642930572f

Kubernetes-commit: be4db5ac559cc4ac49a6a6e279b8054c0808ec54
2021-02-18 13:55:35 -08:00
Maciej Borsz b4f179e734 Use more real world examples in BenchmarkSerializeObject
Kubernetes-commit: f01f2b122923798d60893c6c189a204b94fe5723
2021-02-18 10:56:51 +01:00