Commit Graph

74 Commits

Author SHA1 Message Date
xigang 056896e970 Fix typo in ResourceEncodingConfig comment
Signed-off-by: xigang <wangxigang2014@gmail.com>

Kubernetes-commit: f844abfc6f950fd90a3b66355641ec53879d79a2
2025-04-18 15:55:38 +08:00
Siyuan Zhang 942f114031 Add option to explicitly enable future gv or gvr in runtime-config.
Signed-off-by: Siyuan Zhang <sizhang@google.com>

Kubernetes-commit: 3d2d8db83509eadcad0529fda1f8ef81e1682ca5
2025-02-07 16:43:58 -08:00
Siyuan Zhang 9bb4aa730a Refactor compatibility version code
Replace DefaultComponentGlobalsRegistry with new instance of componentGlobalsRegistry in test api server.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

move kube effective version validation out of component base.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

move DefaultComponentGlobalsRegistry out of component base.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

move ComponentGlobalsRegistry out of featuregate pkg.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

remove usage of DefaultComponentGlobalsRegistry in test files.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

change non-test DefaultKubeEffectiveVersion to use DefaultBuildEffectiveVersion.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

Restore useDefaultBuildBinaryVersion in effective version.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

rename DefaultKubeEffectiveVersion to DefaultKubeEffectiveVersionForTest.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

pass options.ComponentGlobalsRegistry into config for controller manager and scheduler.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

Pass apiserver effective version to DefaultResourceEncodingConfig.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

change statusz registry to take effective version from the components.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

Address review comments

Signed-off-by: Siyuan Zhang <sizhang@google.com>

update vendor

Signed-off-by: Siyuan Zhang <sizhang@google.com>

Kubernetes-commit: 8fc3a33454ba38783bb63de41ecf5343e2ced67c
2024-12-20 07:03:03 +00:00
Patrick Ohly b84662911c remove import doc comments
The "// import <path>" comment has been superseded by Go modules.
We don't have to remove them, but doing so has some advantages:

- They are used inconsistently, which is confusing.
- We can then also remove the (currently broken) hack/update-vanity-imports.sh.
- Last but not least, it would be a first step towards avoiding the k8s.io domain.

This commit was generated with
   sed -i -e 's;^package \(.*\) // import.*;package \1;' $(git grep -l '^package.*// import' | grep -v 'vendor/')

Everything was included, except for
   package labels // import k8s.io/kubernetes/pkg/util/labels
because that package is marked as "read-only".

Kubernetes-commit: 8a908e0c0bd96a3455edf7e3b5f5af90564e65b0
2024-12-02 14:43:58 +01:00
Joe Betz 7d5891a801 Unit test for emulated storage version selection
Kubernetes-commit: d5517b7a518c60e8e6f1aadc1806f4e2a254d6a9
2024-10-30 13:15:35 -04:00
Joe Betz f0baf72379 Don't pick versions that have a replacement as storage version
Kubernetes-commit: af811be190b7d04a49ecf47bf55a3858fa7e7e96
2024-10-30 11:47:43 -04:00
Kubernetes Prow Robot 4bece4d457 Merge pull request #128196 from richabanker/move-version
Move k8s.io/apiserver/pkg/util/version to component-base

Kubernetes-commit: 119f114f012ae6d1cd851bdb2c3f849307e83258
2024-10-29 18:49:35 +00:00
xuzhenglun 3abc312093 add test coverage for cohabitating resources in StroageFactory
Kubernetes-commit: d994895dc4580101f17661eb573fc282d4b8517d
2024-09-12 16:59:08 +08:00
xuzhenglun a096b0dd8d API emulation versioning honors cohabitating resources
Kubernetes-commit: cd5b27304f58f6b634be800ec4ec9990d28550a3
2024-09-09 17:54:35 +08:00
Siyuan Zhang b26fefe178 add DefaultComponentGlobalsRegistry flags in ServerRunOptions
Signed-off-by: Siyuan Zhang <sizhang@google.com>

Kubernetes-commit: 379676c4bef48e5d2add28851302b55b41fcabcf
2024-06-10 17:50:22 +00:00
Siyuan Zhang 00857ca9ec Add version mapping in ComponentGlobalsRegistry.
Signed-off-by: Siyuan Zhang <sizhang@google.com>

Kubernetes-commit: 4352c4ad2762ce49ce30e62381f8ceb24723fbcc
2024-05-31 20:29:48 -07:00
Siyuan Zhang 22612a3528 apiserver: Add API emulation versioning.
Co-authored-by: Siyuan Zhang <sizhang@google.com>
Co-authored-by: Joe Betz <jpbetz@google.com>
Co-authored-by: Alex Zielenski <zielenski@google.com>

Signed-off-by: Siyuan Zhang <sizhang@google.com>

Kubernetes-commit: 403301bfdf2c7312591077827abd2e72f445a53a
2024-01-19 16:07:00 -08:00
Wojciech Tyczyński 5bf4f58ab8 Remove storageConfig.Paging parameter
Kubernetes-commit: b386120da239bf9652fc02b2d2cbbd0fcc3cd121
2023-10-20 15:35:58 +02:00
Wojciech Tyczyński 71519801e7 Remove disablePaging param
Kubernetes-commit: 106f58686d58a790a86dc05b4c93a5da041de389
2023-10-20 15:30:03 +02:00
Wojciech Tyczyński 3030f660a8 Graduate APIListChunking to GA
Kubernetes-commit: 6acfa3cb4ac876e46ead5ba4772ba18e480435ce
2023-07-21 11:35:21 +02:00
Stephen Kitt 7fb4ad7511 api-machinery: stop using deprecated io/ioutil
This replaces deprecated ioutil functions as follows:

* ioutil.ReadAll -> io.ReadAll
* ioutil.ReadFile -> os.ReadFile
* ioutil.TempDir -> os.MkdirTemp
* ioutil.TempFile -> os.CreateTemp
* ioutil.WriteFile -> os.WriteFile

Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: b60a3a58df2791ae67764f6325be31aea5eca5a0
2023-05-02 15:08:18 +02:00
Marek Siarkowicz e9acd0c76d Fix the semantic meaning of etcd server within component statuses and metrics.
Instead of numerating all the etcd endpoints known by apiserver, we will
group them by purpose. `etcd-0` will be the default etcd, `etcd-1` will
be the first resource override, `etcd-2` will be the second override and
so on.

Kubernetes-commit: 03aad1f823cb719fa6e6b6d33fefa2a2140cc760
2023-07-19 14:25:54 +02:00
Marek Siarkowicz fb965cd2c4 Make etcd component status consistent with health probes
Co-authored-by: Antonio Ojea <antonio.ojea.garcia@gmail.com>

Kubernetes-commit: a60314c47ef28dd04b086a2ad4b4bfd40b6f86a4
2023-06-05 16:26:12 +02:00
SataQiu b683f5d16a kube-apiserver: print supported media types on failure to find a serializer
Kubernetes-commit: 56b46e13c21b483ebc70bd6e151eea0a45b399e8
2022-11-05 23:03:23 +08:00
Monis Khan 8d68e6f323 Load encryption config once
This change updates the API server code to load the encryption
config once at start up instead of multiple times.  Previously the
code would set up the storage transformers and the etcd healthz
checks in separate parse steps.  This is problematic for KMS v2 key
ID based staleness checks which need to be able to assert that the
API server has a single view into the KMS plugin's current key ID.

Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: f507bc255382b2e2095351053bc17e74f7100d35
2022-08-29 17:25:48 -04:00
Monis Khan 25ccbfa75c Use https links for k8s KEPs, issues, PRs, etc
Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: b738be9b46a899571303c8c887e32bf4d5b71a0a
2022-09-23 16:13:22 -04:00
David Eads 388a62292f prevent enabling beta by default for new api groups
Kubernetes-commit: af99d192cf95cd29e455d186878db409b8cbdf2c
2022-02-07 13:32:01 -05:00
David Eads 57ccdb5af8 reduce API surface area of whether a resource is enabled
Kubernetes-commit: a59b92e8c039fb3646dec18f9e64ee2b5462db42
2022-02-21 17:23:19 -05:00
David Eads 7fd5822a08 migrate more rest handlers to select by resource enablement
Kubernetes-commit: 0ec20f97d27e08be8d8bbbbff52e68a4409ab43c
2022-02-21 16:10:25 -05:00
David Eads 1452003cc5 update resourceconfig to have per-resource preferences take priority
Kubernetes-commit: 41b2662bac7a80d41dfbab13d72c9e1557c0f613
2022-02-09 15:44:47 -05:00
David Eads 28da9a6848 update the --runtime-config handling to ensure that user preferences always take priority over hardcoded preferences
Kubernetes-commit: e378fd2bae0fec4756a8e755395193337d13caa2
2022-02-09 13:05:12 -05:00
Mike Spreitzer b225af44fe Introduce storagebackend.ConfigForResource
This is a Config specialized for a GroupResource.
It will support generating new resource-specific metrics.

Kubernetes-commit: 85bcd243aa3c8769a5904a1aea44ce704f5e7174
2021-08-29 01:06:12 -04:00
Stefan Bueringer c8433b21e4 fix staticcheck: vendor/k8s.io/apiserver/pkg/server
Kubernetes-commit: ed0adcb65e92198177bf23db97807b3312d6be29
2020-11-17 11:58:13 +01:00
Ken Sipe 0c18993949 fix S1008 simplify bool returns
Signed-off-by: Ken Sipe <kensipe@gmail.com>

Kubernetes-commit: b287287a3093e895a77ccf78053adffcaa7a67c9
2020-06-26 10:39:16 -05:00
Davanum Srinivas 5879417a28 switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 442a69c3bdf6fe8e525b05887e57d89db1e2f3a5
2020-04-17 15:25:06 -04:00
Jordan Liggitt 54aa70b012 Add support for --runtime-config=api/beta=false, --feature-gates=AllBeta=false
Allow disabling all beta features and APIs

Kubernetes-commit: a5760dee812d280e4de203fccf58214051d0d62a
2019-10-12 09:59:14 -04:00
Wenjia Zhang e518fe04f6 Resolve uncompatibility from update: etcd CAFile -> TrustedCAFIle
Kubernetes-commit: 9ead9373f350c7ad438257a9e8b8977a67b900eb
2019-10-23 11:15:43 -07:00
Clayton Coleman 78a40897c5 Unify runtime.SerializerInfo with negotiate.AcceptedMediaTypes
There was no reason to have two types and this avoids ~10% of allocations
on the GET code path.

```
BenchmarkGet-12          	  100000	    109045 ns/op	   17608 B/op	     146 allocs/op

BenchmarkGet-12          	  100000	    108850 ns/op	   15942 B/op	     132 allocs/op
```

Kubernetes-commit: 0489d0b1cf139253b82f73b072578073bc5616d6
2019-03-21 21:00:55 -04:00
Chao Xu d99ef88606 Expose storage version hash
Kubernetes-commit: 3b618af0d435628feedf06f97bd1c69340d07d95
2019-01-14 19:31:25 -08:00
Chao Xu b1f08321f6 Simplify the resource_encoding_config.go, since we don't need per group override at all
Kubernetes-commit: 4ea07084dddde5be97d5405696fae47bca4d4663
2018-09-28 16:07:31 -07:00
Chao Xu f516170e82 Remove unnecessary group storage version defaults. The storage version
is either decided by the schema's version priority, or by the per
resource override.

This fixes a bug where the "batch" group is encoded in v1beta1, which
was hidden when --storage-versions is a valid flag.

Kubernetes-commit: 98a1003f57988ccc361af7aee5d0ae49de66dbb4
2018-08-21 17:45:14 -07:00
vsamidurai 77c59f4906 update docs.go files under staging/src/k8s.io/apiserver/pkg/server
Kubernetes-commit: 03d892a44df6dbcac7ad28f1519d7d606f42e1ee
2019-02-03 20:43:13 +00:00
Kubernetes Prow Robot cb1e16cec7 sync: squashed up to merge 1f7e9fd9a2b31ee21babef2cbdd18caeb8c14cdc in e72b32558c8e9ed16690ef5a8e909c12fcc47f87 2019-02-01 14:44:40 +00:00
Jordan Liggitt fe4a2dbfb0 preserve behavior of ignoring invalid --runtime-config keys and api/all=false
Kubernetes-commit: fc3fca2857a18464cfff8aff5f9e4b062f293ac5
2019-01-04 13:50:21 -05:00
Dr. Stefan Schimanski 7d47897b55 apiserver: separate transport setting from storagebackend.Config
Kubernetes-commit: 7b242533a217bd809e2c846c3e3fadf7bf6edee8
2018-09-12 10:59:01 +02:00
Jordan Liggitt 837d33c6f5 Allow enabling/disabling specific extensions/v1beta1 resources
Kubernetes-commit: e016e132f519dbfb63ce09f6084d6dd64617f615
2018-12-20 13:08:14 -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
Jordan Liggitt 3b6fc08803 Remove etcd2 storage backend
Kubernetes-commit: 85ae79500fba7d6e51292b12daff829027b59872
2018-10-01 16:48:14 -04:00
David Eads c41d1d0993 simplify api registration
Kubernetes-commit: c5445d3c56e06ab366b9cca34bd69c5cc386ec47
2018-05-07 08:32:20 -04:00
David Eads 3fa442d40a stop duplicating preferred version order
Kubernetes-commit: a89291a5dec0b63809b875e912b1563d50f86dba
2018-04-26 09:38:43 -04:00
David Eads bf8532c54e remove KUBE_API_VERSIONS
Kubernetes-commit: a68c57155e728b2782408cbab88ecee0444a4ba8
2018-04-25 16:07:15 -04:00
David Eads b26d126ba9 core v1 API requires autoscaling/v1 to serve the Scale endpoint
Kubernetes-commit: 1a753659cfc973e900620bf1443178b6cdda27e0
2018-04-24 10:16:59 -04:00
David Eads 88d943c0e6 eliminate indirection from type registration
Kubernetes-commit: e7fbbe0e3c91f34836b999e695aa133503cfdae5
2018-04-24 08:21:23 -04:00
Kubernetes Publisher 627fa76a8b sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-15 09:38:17 +00:00
Wojciech Tyczynski b81f74623f Fix race in healthchecking etcds leading to crashes
Kubernetes-commit: 38387aec0db3eda3a7debb4558a223ac92a41389
2018-02-20 12:17:39 +01:00