Commit Graph

1266 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
cc4b7dc3c5
Merge pull request #111986 from enj/enj/i/transformer_leak
kms: fix go routine leak in gRPC connection
2022-09-08 09:49:46 -07:00
Monis Khan
4e68e9b5ad
kms: fix go routine leak in gRPC connection
Signed-off-by: Monis Khan <mok@microsoft.com>
2022-09-08 11:46:57 -04:00
Di Jin
0b400cf6aa Add an option for aggregator 2022-09-01 15:25:26 -07:00
Monis Khan
ec283e526b
Expand aggregated API server integration test to include CRUD
This change updates TestAggregatedAPIServer and the related test
server wiring to exercise the full network path between the Kube API
server and the aggregated API server.  We now assert that the wardle
API service and Kube API server discovery endpoints are fully healthy.
CRUD operations are performed through the Kube API server to the
wardle API server.

Signed-off-by: Monis Khan <mok@microsoft.com>
2022-08-30 10:44:01 -04:00
Kubernetes Prow Robot
132f29769d
Merge pull request #111697 from thockin/master
Docs: node-port-range should not overlap ephemeral
2022-08-12 13:44:32 -07:00
Kubernetes Prow Robot
759785ea14
Merge pull request #109090 from sarveshr7/multicidr-rangeallocator
Enhance NodeIPAM to support multiple ClusterCIDRs
2022-08-07 15:40:18 -07:00
Sarvesh Rangnekar
7093b10416 Introduce networking/v1alpha1 api, ClusterCIDR type
Introduce networking/v1alpha1 api group.

Add `ClusterCIDR` type to networking/v1alpha1 api group, this type
will enable the NodeIPAM controller to support multiple ClusterCIDRs.
2022-08-05 00:54:00 +00:00
Tim Hockin
5f59159bfc Docs: node-port-range should not overlap ephemeral 2022-08-04 10:26:26 -07:00
Sally O'Malley
47e7d8034f
kubelet tracing
Signed-off-by: Sally O'Malley <somalley@redhat.com>
Co-authored-by: David Ashpole <dashpole@google.com>
2022-08-01 12:55:02 -04:00
Kubernetes Prow Robot
610b7839a0
Merge pull request #111399 from Argh4k/i-111290
Modify timeout for etcd healthcheck
2022-07-27 07:36:28 -07:00
Maciej Wyrzuc
b42045a64f Add additional etcd check to readyz with 2 seconds timeout. 2022-07-27 12:23:02 +00:00
Davanum Srinivas
a9593d634c
Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-07-26 13:14:05 -04:00
Abirdcfly
00b9ead02c cleanup: remove duplicate import
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
2022-07-14 11:25:19 +08:00
Patrick Ohly
4c6338ac0f logs: replace config methods with functions
API types are only supposed to have methods related to serialization.
2022-06-17 20:22:13 +02:00
Patrick Ohly
1aceac797d logs: make LoggingConfiguration an unversioned API
Making the LoggingConfiguration part of the versioned component-base/config API
had the theoretic advantage that components could have offered different
configuration APIs with experimental features limited to alpha versions (for
example, sanitization offered only in a v1alpha1.KubeletConfiguration). Some
components could have decided to only use stable logging options.

In practice, this wasn't done. Furthermore, we don't want different components
to make different choices regarding which logging features they offer to
users. It should always be the same everywhere, for the sake of consistency.

This can be achieved with a saner Go API by dropping the distinction between
internal and external LoggingConfiguration types. Different stability levels of
indidividual fields have to be covered by documentation (done) and potentially
feature gates (not currently done).

Advantages:

- everything related to logging is under component-base/logs;
  previously this was scattered across different packages and
  different files under "logs" (why some code was in logs/config.go
  vs. logs/options.go vs. logs/logs.go always confused me again
  and again when coming back to the code):

  - long-term config and command line API are clearly separated
    into the "api" package underneath that

  - logs/logs.go itself only deals with legacy global flags and
    logging configuration

- removal of separate Go APIs like logs.BindLoggingFlags and
  logs.Options

- LogRegistry becomes an implementation detail, with less code
  and less exported functionality (only registration needs to
  be exported, querying is internal)
2022-06-17 20:22:13 +02:00
Antonio Ojea
2124f17c72 unit tests for Class E IP addresses 2022-06-08 15:29:48 +02:00
Kubernetes Prow Robot
ee0a070865
Merge pull request #110082 from twilight0620/addTest2
add test case TestValidateServiceNodePort for validateServiceNodePort method
2022-05-26 08:45:35 -07:00
Wojciech Tyczyński
6f706775bc Clean shutdown of test apiserver 2022-05-26 10:42:48 +02:00
twilight0620
62298c0493 add test case TestValidateServiceNodePort for validateServiceNodePort method 2022-05-17 14:32:06 +08:00
Wojciech Tyczyński
2dd44d6226 Cleanup no-longer used storage cleanup method 2022-05-11 20:11:37 +02:00
Kubernetes Prow Robot
cc2807c521
Merge pull request #109303 from wojtek-t/clean_storage_shutdown
Cleanup rest storage resources on shutdown
2022-05-03 19:30:57 -07:00
Wojciech Tyczyński
0527a0dd45 Cleanup rest storage resources on shutdown 2022-04-19 15:59:13 +02:00
James Laverack
7d57d5c70d Revert "Introduce APIs to support multiple ClusterCIDRs (#108290)"
This reverts commit b9792a9dae.
2022-04-13 13:58:19 +01:00
Sarvesh Rangnekar
b9792a9dae
Introduce APIs to support multiple ClusterCIDRs (#108290)
* Introduce networking/v1alpha1 api, ClusterCIDRConfig type

Introduce networking/v1alpha1 api group.

Add `ClusterCIDRConfig` type to networking/v1alpha1 api group, this type
will enable the NodeIPAM controller to support multiple ClusterCIDRs.

* Change ClusterCIDRConfig.NodeSelector type in api

* Fix review comments for API

* Update ClusterCIDRConfig API Spec

Introduce PerNodeHostBits field, remove PerNodeMaskSize
2022-03-30 19:39:00 -07:00
Jefftree
67d3dbfaae Separate OpenAPI V2 and V3 Config 2022-03-29 17:49:56 -07:00
Kubernetes Prow Robot
5b8dbfbbcf
Merge pull request #108995 from pohly/log-contextual
contextual logging
2022-03-29 17:35:59 -07:00
Patrick Ohly
7de1b05e85 logging: add ContextualLogging feature
InitLogs overrides the klog default and turns contextual logging off. This
ensures that it is only enabled in Kubernetes commands that explicitly enable
it via a feature gate. A feature gate for it gets defined in
k8s.io/component-base/logs and is then used by Options.ValidateAndApply.

The effect of disabling contextual logging is very limited according to
benchmarks with kube-scheduler. The feature gets added anyway to satisfy the
PRR recommendation that features should be controllable.

The following commands have support for contextual logging:
- kube-apiserver
- kube-controller-manager
- kubelet
- kube-scheduler
- component-base/logs example

Supporting a feature gate check in ValidateAndApply and not in InitLogs is a
simplification: changing InitLogs to accept a FeatureGate would have implied
changing also component-base/cli.Run. This didn't seem worthwhile because
ValidateAndApply already covers the relevant commands.
2022-03-29 13:29:57 +02:00
Ross Peoples
f3b928a23d Import tzdata in apiserver, CronJob.timeZone fixes 2022-03-28 16:33:05 -05:00
carlory
fcc282f9f2 remove audit.k8s.io/v1[alpha|beta]1 versions 2022-03-08 14:37:26 +08:00
Kubernetes Prow Robot
d7d121999d
Merge pull request #108480 from wojtek-t/log_golang_envs
Log main golang runtime env vars
2022-03-04 00:10:51 -08:00
Wojciech Tyczyński
ef2e32ab65 Log main golang runtime env vars 2022-03-04 08:04:02 +01:00
David Eads
a59b92e8c0 reduce API surface area of whether a resource is enabled 2022-02-23 13:36:33 -05:00
Kubernetes Prow Robot
a1ac74224e
Merge pull request #108062 from aojea/lease_reconciler
apiserver: use endpoint lease reconciler as default
2022-02-11 07:37:45 -08:00
Antonio Ojea
5a20c425f2 apiserver: use endpoint lease reconciler as default
The apiserver owns and manages the kubernetes.default service.

It has 3 different options to reconcile the endpoints that belong to
that service:

- None: endpoints are handled by an external party.
- MasterCount: legacy, it reconciles based on the endpoints generated
and a flag specifying the number of master on the cluster.
- Lease: default since 1.11, each apiserver writes a lease in etcd
and renews periodically, the endpoints are generated based on the
existing leases.

It seems that when the default was set for the lease reconciler, the
controlplane code wasn't updated and kept using the master count
reconciler.

This also starts the deprecation of the master count reconciler in
favor of the lease reconciler.
2022-02-11 09:00:54 +01:00
David Eads
41b2662bac update resourceconfig to have per-resource preferences take priority 2022-02-10 10:53:16 -05:00
ahrtr
972dc46a1f replace deprecated io/ioutil with os and io for cmd 2022-02-01 13:59:41 +08:00
Davanum Srinivas
9405e9b55e
Check in OWNERS modified by update-yamlfmt.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-12-09 21:31:26 -05:00
Jian Zeng
9573b4a6b9
refactor(apiserver): remove the insecure flags
Signed-off-by: Jian Zeng <anonymousknight96@gmail.com>
2021-12-08 10:53:44 +08:00
Jiahui Feng
9c05de2f31 prune enum when OpenAPIEnums is disabled. 2021-11-09 13:00:00 -08:00
wangyysde
d2abddd909 rename v2beta2 to v2
Signed-off-by: wangyysde <net_use@bzhy.com>

Generation swagger.json.

Use v2 path for hpa_cpu_field.

run update-codegen.sh

Signed-off-by: wangyysde <net_use@bzhy.com>
2021-11-09 10:34:54 +08:00
Patrick Ohly
4df70dfd41 component-base: initialize logging as soon as possible
In various places log messages where emitted as part of validation or even
before it (for example, cli.PrintFlags). Those log messages did not use the
final logging configuration, for example text output instead of JSON or not the
final verbosity. The last point became more obvious after moving the setup of
verbosity into logs.Options.Apply because PrintFlags never printed anything
anymore.

In order to force applications to deal with logging as soon as possible, the
Options.Validate and Options.Apply methods are now private. Applications should
use the new Options.ValidateAndApply directly after parsing.
2021-11-03 11:55:54 +01:00
Patrick Ohly
3948cb8d1b component-base: move v/vmodule/log-flush-frequency into LoggingConfiguration
These three options are the ones from logs.AddFlags which are not deprecated.
Therefore it makes sense to make them available also via the configuration file
support in the one command which currently supports that (kubelet).

Long-term, all commands should use LoggingConfiguration, either with a
configuration file (as in kubelet) or via flags (kube-scheduler,
kube-apiserver, kube-controller-manager).

Short-term, both approaches have to be supported. As the majority of the
commands only use logs.AddFlags, that function by default continues to register
the flags and only leaves that to Options.AddFlags when explicitly requested.

A drive-by bug fix is done for log flushing: the periodic flushing called
klog.Flush and therefore missed explicit flushing of the newer logr
backend. This bug was never present in any release Kubernetes and therefore the
fix is not submitted in a separate PR.
2021-11-03 07:41:46 +01:00
Lukasz Szaszkiewicz
9e2bdfee02 rename to muxAndDiscoveryComplete 2021-10-19 13:26:59 +02:00
Lukasz Szaszkiewicz
53867975e7 apiserver: indroduces NotFoundHanlder
The new handler is meant to be executed at the end of the delegation chain.
It simply checks if the request have been made before the server has installed all known HTTP paths.
In that case it returns a 503 response otherwise it returns a 404.

We don't want to add additional checks to the readyz path as it might prevent fixing bricked clusters.
This specific handler is meant to "protect" requests that arrive before the paths and handlers are fully initialized.
2021-10-19 09:55:04 +02:00
Lukasz Szaszkiewicz
7a342a0f8a kube-apiserver: wires the notFoundHandler 2021-10-18 12:41:42 +02:00
Patrick Ohly
00e4a599f6 command lines: always show flags with hyphens
All Kubernetes commands should show flags with hyphens in their help text even
when the flag originally was defined with underscore. Converting a command to
this style is not breaking its command line API because the old-style parameter
with underscore is accepted as alias.

The easiest solution to achieve this is to set normalization shortly before
running the command in the new central cli.Run or the few places where that
function isn't used yet.

There may be some texts which depends on normalization at flag definition time,
like the --logging-format usage warning. Those get generated assuming that
hyphens will be used.
2021-09-30 13:46:49 +02:00
Patrick Ohly
21d1bcd6b8 initialize logging after flag parsing
It wasn't documented that InitLogs already uses the log flush frequency, so
some commands have called it before parsing (for example, kubectl in the
original code for logs.go). The flag never had an effect in such commands.

Fixing this turned into a major refactoring of how commands set up flags and
run their Cobra command:

- component-base/logs: implicitely registering flags during package init is an
  anti-pattern that makes it impossible to use the package in commands which
  want full control over their command line. Logging flags must be added
  explicitly now, something that the new cli.Run does automatically.

- component-base/logs: AddFlags would have crashed in kubectl-convert if it
  had been called because it relied on the global pflag.CommandLine. This
  has been fixed and kubectl-convert now has the same --log-flush-frequency
  flag as other commands.

- component-base/logs/testinit: an exception are tests where flag.CommandLine has
  to be used. This new package can be imported to add flags to that
  once per test program.

- Normalization of the klog command line flags was inconsistent. Some commands
  unintentionally didn't normalize to the recommended format with hyphens. This
  gets fixed for sample programs, but not for production programs because
  it would be a breaking change.

This refactoring has the following user-visible effects:

- The validation error for `go run ./cmd/kube-apiserver --logging-format=json
  --add-dir-header` now references `add-dir-header` instead of `add_dir_header`.

- `staging/src/k8s.io/cloud-provider/sample` uses flags with hyphen instead of
  underscore.

- `--log-flush-frequency` is not listed anymore in the --logging-format flag's
  `non-default formats don't honor these flags` usage text because it will also
  work for non-default formats once it is needed.

- `cmd/kubelet`: the description of `--logging-format` uses hyphens instead of
  underscores for the flags, which now matches what the command is using.

- `staging/src/k8s.io/component-base/logs/example/cmd`: added logging flags.

- `apiextensions-apiserver` no longer prints a useless stack trace for `main`
  when command line parsing raises an error.
2021-09-30 13:46:49 +02:00
Khaled Henidak (Kal)
a53e2eaeab
move IPv6DualStack feature to stable. (#104691)
* kube-proxy

* endpoints controller

* app: kube-controller-manager

* app: cloud-controller-manager

* kubelet

* app: api-server

* node utils + registry/strategy

* api: validation (comment removal)

* api:pod strategy (util pkg)

* api: docs

* core: integration testing

* kubeadm: change feature gate to GA

* service registry and rest stack

* move feature to GA

* generated
2021-09-24 16:30:22 -07:00
Abu Kashem
28f2b42a41
apf: update apf logic to use v1beta2 2021-09-09 08:28:58 -04:00
Abu Kashem
e2b8701545
apf: ebable v1beta2 2021-09-09 08:28:53 -04:00
Stephen Augustus
481cf6fbe7
generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-08-24 15:47:49 -04:00
Antonio Ojea
0cd75e8fec run hack/update-netparse-cve.sh 2021-08-20 10:42:09 +02:00
Kubernetes Prow Robot
3c72622a1f
Merge pull request #104229 from astraw99/fix_trivial_code
Fix single pointer variable parenthesis
2021-08-12 21:16:31 -07:00
astraw99
ff7307bf9c fix single pointer variable 2021-08-11 10:40:10 +08:00
Jordan Liggitt
39a1293cbc Drop beta REST APIs removed in 1.22 2021-08-09 11:10:16 -04:00
David Ashpole
9dd59017c4 add tracing to webhook requests 2021-07-09 06:30:05 -07:00
Kubernetes Prow Robot
694d6cd2b9
Merge pull request #103216 from dashpole/etcd_client_tracing
Add distributed tracing to the etcd client
2021-07-08 14:01:52 -07:00
maruiyan
da4aaf81cd Error should be checked first, then go to other steps. 2021-06-30 11:00:55 +08:00
David Ashpole
71f810bb71 Add distributed tracing to the etcd client 2021-06-26 09:19:39 -07:00
David Ashpole
79550ed40c Add distributed tracing to the apiserver using OpenTelemetry 2021-06-25 05:20:27 -07:00
Mike Spreitzer
0762f492c5 Add config checking for inflight limits
When API Priority and Fairness is enabled, the inflight limits must
add up to something positive.
This rejects the configuration that prompted
https://github.com/kubernetes/kubernetes/issues/102885

Update help for max inflight flags
2021-06-23 14:06:50 -04:00
Jordan Liggitt
2979c3325e Switch to go.etcd.io/etcd/client/v3 2021-06-15 09:53:06 -04:00
Mengjiao Liu
170c93bf05 JSON log format registration for kube-apiserver 2021-06-10 07:20:43 +08:00
Kubernetes Prow Robot
57fbeb8030
Merge pull request #101993 from wongma7/waitforetcd
Remove etcd connection apiserver preflight check
2021-06-08 12:26:20 -07:00
David Eads
84590fe27c remove --ssh- options, deprecated 13 releases, that only work on GCE 2021-06-03 13:54:35 -04:00
Danil-Grigorev
5d57b3794c Add DisableCloudProviders FG
FeatureGate acts as a secondary switch to disable cloud-controller loops
in KCM, Kubelet and KAPI.

Provide comprehensive logging information to users, so they will be
guided in adoption of out-of-tree cloud provider implementation.
2021-05-21 16:09:44 +02:00
Matthew Wong
c201a78dff Remove etcd connection apiserver preflight check 2021-05-19 13:46:20 -07:00
Kubernetes Prow Robot
8365e2384c
Merge pull request #101187 from GreenApple10/feature/import_cleanup
remove duplicate packet import
2021-04-30 12:06:25 -07:00
Kubernetes Prow Robot
fbc93bd34c
Merge pull request #101403 from wangyx1992/redundant-silce-nilcheck
cleanup: omit redundant nil check around loop in apiserver
2021-04-27 12:31:38 -07:00
Kubernetes Prow Robot
e640a01219
Merge pull request #101068 from BinacsLee/binacs-apiserver-remove-useless-code-logic
code cleanup: apiserver remove useless code logic
2021-04-26 00:03:01 -07:00
wangyx1992
b9ea207ff7 cleanup: omit redundant nil check around loop in apiserver
Signed-off-by: wangyx1992 <wang.yixiang@zte.com.cn>
2021-04-23 11:38:28 +08:00
BinacsLee
75dde4dce4 code cleanup: Abstract repetitive codes in cmd as a function 2021-04-22 23:35:04 +08:00
Shihang Zhang
925900317e allow multiple of --service-account-issuer 2021-04-19 09:54:11 -07:00
Kubernetes Prow Robot
cbe41b4e76
Merge pull request #101178 from dcwbq/delete_kubeletHTTPS_flag
Remove kube-apiserver `--kubelet-https` flag
2021-04-16 10:02:42 -07:00
c00522440
a1335cba68 del duplicate import 2021-04-16 16:57:57 +08:00
dcwbq
5d186d0d0c This flag will be removed in 1.22
Signed-off-by: dcwbq <biqiang.wu@daocloud.io>
2021-04-16 11:20:52 +08:00
Monis Khan
91241eac9b
Prune stale entries from OWNERS files
Signed-off-by: Monis Khan <mok@vmware.com>
2021-04-13 20:54:50 -04:00
BinacsLee
802a50e4e9 code cleanup: apiserver remove useless code logic 2021-04-13 21:33:41 +08:00
Kubernetes Prow Robot
dc54027341
Merge pull request #100208 from songxiao-wang87/mytest
spelling mistake
2021-04-11 03:05:59 -07:00
Kubernetes Prow Robot
5c5aa98215
Merge pull request #99578 from pandaamanda/remove_duplicate_apiserverServiceRange_validation
remove duplicated validation for service-cluster-ip-range
2021-04-09 01:18:48 -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
Kubernetes Prow Robot
b11d0fbdd5
Merge pull request #100171 from chenyw1990/fixGlobalFlagChange
add normalize function to global FlagSet
2021-03-23 22:08:04 -07:00
xiongzhongliang
e6d6409cf8 remove duplicated validation for service-cluster-ip-range 2021-03-19 11:17:07 +08:00
Kevin Delgado
66d2f4359e Add ability to skip OpenAPI handler installation 2021-03-18 22:41:42 +00:00
chenyw1990
e2020f62ac add normalize function to global FlagSet 2021-03-18 09:23:52 +08:00
songxiao-wang87
d78f3cd47b spelling mistake
Signed-off-by: songxiao-wang87 <461870555@qq.com>
2021-03-13 04:56:39 -05:00
Kubernetes Prow Robot
08b11727f5
Merge pull request #99951 from deads2k/fix-decodableversions
provide directly decodable versions for storageversion API
2021-03-09 16:08:40 -08:00
Morten Torkildsen
21fba79d45 Promote PDBs to GA 2021-03-09 10:29:11 -05:00
David Eads
fa03dee68c provide directly decodable versions for storageversion API 2021-03-09 08:36:32 -05:00
chenyw1990
edff740386 fix json log format panic, change the flag names in flagIsSet 2021-03-09 14:14:25 +08:00
Kubernetes Prow Robot
b139db1539
Merge pull request #99573 from pandaamanda/apiserver_identity_validate
cleanup: wrap the apiserver identity validation
2021-03-08 19:23:19 -08:00
Swetha Repakula
108fd44f7c Graduate EndpointSlice feature gate to GA 2021-03-06 15:58:47 -08:00
Swetha Repakula
a9891b4b9b Graduate EndpointSlice API to GA
* Removes discovery v1alpha1 API
  * Replaces per Endpoint Topology with a read only DeprecatedTopology
  in GA API
  * Adds per Endpoint Zone field in GA API
2021-03-05 12:02:41 -08:00
xiongzhongliang
c7bf5506ee cleanup: wrap the apiserver identity validation 2021-03-06 00:57:02 +08:00
xiongzhongliang
4a24a08f93 Optimize some codes 2021-03-05 18:23:39 +08:00
David Eads
a473ef6c0a use direct etcd creation to verify migrated v1beta1 admissionwebhooks 2021-03-03 17:33:27 -05: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
xiongzhongliang
00bfd28fbd fix some hardcoding
fix some hardcoding
2021-02-20 01:27:54 +08:00
Nikhita Raghunath
6cef3a4e33 *: remove nikhiljindal from OWNERS 2021-02-16 10:59:26 +05:30