Commit Graph

103899 Commits

Author SHA1 Message Date
Elana Hashman
f9a827b895
Fix bugs in e2e pod test
- Update test to account for late synced statuses
- Terminated containers are not running
- Add missing format values to test logline
2021-10-05 11:51:12 -07:00
Elana Hashman
3005ef34f2
Ensure terminal pods maintain terminal status 2021-10-05 09:26:27 -07:00
Elana Hashman
5ff6c2396d
Do not sync Waiting statuses for Terminated pods 2021-10-04 11:05:54 -07:00
Kubernetes Prow Robot
04f747d09f
Merge pull request #104782 from kerthcet/cleanup/remove-cc-v1beta1
remove scheduler component config v1beta1
2021-10-04 08:53:08 -07:00
Kubernetes Prow Robot
e5976909c6
Merge pull request #105414 from pohly/log-example-verbosity
component-base: verbosity in example command
2021-10-04 04:19:38 -07:00
Kubernetes Prow Robot
c724abae81
Merge pull request #105375 from jonyhy96/fix-clock-util
node: test file use k8s.io/utils/clock instead
2021-10-04 04:19:31 -07:00
Kubernetes Prow Robot
e4e2c51648
Merge pull request #105042 from pohly/log-deprecate-klog-flags
deprecate klog flags
2021-10-04 04:19:18 -07:00
Kubernetes Prow Robot
f31453fe5b
Merge pull request #104894 from pacoxu/windows-arm
add windows arm support on client-side since go 1.17 supports
2021-10-04 04:19:07 -07:00
Kubernetes Prow Robot
9c0ef1ffec
Merge pull request #104058 from MadhavJivrajani/kind-design-rm-pr-template
Remove `kind/design` from PR template
2021-10-04 03:13:07 -07:00
Kubernetes Prow Robot
0ac956ff2b
Merge pull request #104968 from twpayne/twpayne/ones-count-64
Speed up counting of bits in allocator
2021-10-01 19:27:05 -07:00
Kubernetes Prow Robot
e380ce5714
Merge pull request #105384 from seans3/command-headers-fix
Fixes kubectl command headers which hangs on kubectl run
2021-10-01 18:25:17 -07:00
Kubernetes Prow Robot
c54ed73f9a
Merge pull request #104744 from robscott/topology-fixes
Excluding Control Plane Nodes from Topology Hints calculations
2021-10-01 18:25:06 -07:00
Kubernetes Prow Robot
0465cd7d04
Merge pull request #104227 from astraw99/fix_typo
Fix typo `registry`
2021-10-01 16:49:05 -07:00
Rob Scott
d7a640d831
Excluding Control Plane Nodes from Topology Hints calculations 2021-10-01 15:12:38 -07:00
Patrick Ohly
d6519150ca component-base: verbosity in example command
The global klog flags were not enabled (an oversight?). Once they
get added, logging at different verbosity levels can be demonstrated.
2021-10-01 23:37:12 +02:00
Patrick Ohly
27d6ce4479 deprecate klog flags
Upstream klog continues to support all of its flags, but in Kubernetes only
some will be supported going format (-v, -vmodule). With this change,
the kubelet flags now look like this:

  $ go run ./cmd/kubelet --help | grep -e --log-dir -e '--v ' -e --vmodule -e --logging-format
  --log-dir string                                           If non-empty, write log files in this directory (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --logging-format string                                    Sets the log format. Permitted formats: "json", "text".
                Non-default formats don't honor these flags: --add_dir_header, --alsologtostderr, --log_backtrace_at, --log_dir, --log_file, --log_file_max_size, --logtostderr, --one_output, --skip_headers, --skip_log_headers, --stderrthreshold, --vmodule, --log-flush-frequency, --add_dir_header, --alsologtostderr, --log_backtrace_at, --log_dir, --log_file, --log_file_max_size, --logtostderr, --one_output, --skip_headers, --skip_log_headers, --stderrthreshold, --vmodule.
  -v, --v Level                                                  number for the log level verbosity
      --vmodule moduleSpec                                       comma-separated list of pattern=N settings for file-filtered logging
2021-10-01 23:36:48 +02:00
Kubernetes Prow Robot
82da9bdaab
Merge pull request #105076 from pohly/log-flush-frequency-bug
initialize logging after flag parsing + refactor commands
2021-10-01 14:30:18 -07:00
Kubernetes Prow Robot
e414cf7641
Merge pull request #100482 from pohly/generic-ephemeral-volume-checks
generic ephemeral volume checks
2021-10-01 10:47:22 -07:00
Kubernetes Prow Robot
6044cdbb31
Merge pull request #105396 from liggitt/csr-test
Fix CSR test to accept certs shorter than the requested duration
2021-10-01 09:45:34 -07:00
Kubernetes Prow Robot
d3b37e1f6b
Merge pull request #104499 from liggitt/visitor-source
Propagate source to list items when flattening
2021-10-01 09:45:23 -07:00
haoyun
8d9fa1decc fix: use k8s.io/utils/clock instead
Signed-off-by: haoyun <yun.hao@daocloud.io>
2021-10-02 00:08:53 +08:00
Tom Payne
21755f9ec0 Speed up counting of bits in allocator
Benchmark:

goos: linux
goarch: amd64
pkg: k8s.io/kubernetes/pkg/registry/core/service/allocator
cpu: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz

Before:

BenchmarkCountBits-8     9459236               140.4 ns/op

After:

BenchmarkCountBits-8    140667842                9.541 ns/op
2021-10-01 17:09:56 +02:00
Tom Payne
125312a8cf Add extra test and benchmark for count bits 2021-10-01 17:08:36 +02:00
Patrick Ohly
1d181ad84f scheduler: fail the volume attach limit when PVC is missing
Previously, the situation was ignored, which might have had the effect that Pod
scheduling continued (?) even though the Pod+PVC weren't known to be in an
acceptable state.
2021-10-01 17:03:44 +02:00
Patrick Ohly
1e26115df5 consider ephemeral volumes for host path and node limits check
When adding the ephemeral volume feature, the special case for
PersistentVolumeClaim volume sources in kubelet's host path and node
limits checks was overlooked. An ephemeral volume source is another
way of referencing a claim and has to be treated the same way.
2021-10-01 17:03:44 +02:00
Kubernetes Prow Robot
c46d84b991
Merge pull request #105293 from verb/1.23-ec-validation
Validate PodSpec in EphemeralContainersUpdate
2021-10-01 07:31:34 -07:00
Kubernetes Prow Robot
ca08978c2d
Merge pull request #104653 from astraw99/fix-word-comment
Fix word most `comment` to `common` and typo
2021-10-01 07:31:22 -07:00
Jordan Liggitt
11c2674ec2 Fix CSR test to accept certs shorter than the requested duration 2021-10-01 09:14:54 -04:00
Kubernetes Prow Robot
883250145c
Merge pull request #104788 from 249043822/memorymanager-br
Fix initContainersReusableMemory delete bug in MemoryManager
2021-10-01 05:27:22 -07:00
Kubernetes Prow Robot
1d5349df0c
Merge pull request #103359 from m14815/commit-21.6.4
Remove Redundant type conversion
2021-10-01 04:19:22 -07:00
Kubernetes Prow Robot
26365faf31
Merge pull request #105185 from ialidzhikov/fix/azure-lb-deletion
Ignore VMs in vmss delete backend pools
2021-10-01 01:55:21 -07:00
Kubernetes Prow Robot
7d76d519ca
Merge pull request #105374 from xing-yang/update_volume_csi_owners
Bubble up to pkg/volume/OWNERS file
2021-09-30 21:17:21 -07:00
Kubernetes Prow Robot
0ff7486e21
Merge pull request #105385 from elweb9858/remove_owner
Removing elweb9858 from winkernel kube-proxy approver+reviewer lists
2021-09-30 19:47:21 -07:00
Kubernetes Prow Robot
dec5153eb0
Merge pull request #105383 from tkashem/lifecycle-signal
make lifecycle signal thread safe
2021-09-30 18:33:57 -07:00
Kubernetes Prow Robot
e136faa1c4
Merge pull request #105379 from pohly/volume-util-owners
pkg/volume/util: remove out-dated OWNERS
2021-09-30 18:33:45 -07:00
Kubernetes Prow Robot
e1b94fdac9
Merge pull request #105352 from ehashman/revert-102323-pie
Revert "Build non-static binaries with PIE buildmode"
2021-09-30 18:33:33 -07:00
Kubernetes Prow Robot
cab54856f1
Merge pull request #104933 from vikramcse/automate_mockery
conversion of tests from mockery to mockgen
2021-09-30 18:33:21 -07:00
Shuhei Kitagawa
ef0eff14ab
Add tests kubelet default config (#105116)
* Use utilpointer to get a pointer

* Add tests for kubelet default configs

* Change copyright year from 2015 to 2021

* Run gofmt

* Add all negative and all positive test cases
2021-09-30 17:29:33 -07:00
Kubernetes Prow Robot
b15f37ef22
Merge pull request #103391 from tanjing2020/runtimeclass
[e2e] Add description of use case “storage version with non-existing id should be GC'ed” execution conditions
2021-09-30 17:29:21 -07:00
Kubernetes Prow Robot
eebeff9f7e
Merge pull request #105372 from MadhavJivrajani/vendor-clock-utils
Vendor in k8s.io/utils
2021-09-30 15:35:15 -07:00
Sean Sullivan
1d1a5499e7 Fixes kubectl command headers which hangs on kubectl run 2021-09-30 13:53:00 -07:00
Lee Verberne
8b24dc07ff Test ephemeral container/pod conflicting fields
This adds a test case to cover the scenario where the fields of an
ephemeral container conflict with other fields in the pod and must be
detected by full PodSpec validation.
2021-09-30 21:47:19 +02:00
Abu Kashem
d3e2e9ede2
make lifecycle signal thread safe 2021-09-30 15:33:09 -04:00
elweb9858
365c5e5687 Removing elweb9858 from winkernel kube-proxy approver+reviewer lists 2021-09-30 11:40:37 -07:00
Patrick Ohly
07f6571a49 pkg/volume/util: remove out-dated OWNERS
There is no reason for having separate owners for this folder. The parent
folder has a much better OWNERS file with references to the SIG-Storage
aliases.
2021-09-30 17:54:46 +02:00
xing-yang
2833aee8ff Bubble up to pkg/volume/OWNERS file 2021-09-30 14:01:28 +00:00
Madhav Jivrajani
a43fca76ea run hack/{pind-dependency.sh, update-vendor.sh}
Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
2021-09-30 19:15:43 +05:30
Patrick Ohly
1957fb6508 command lines: harmonize command line parse error handling
The recommendation from #sig-cli was to print usage, then the error. Extra care
is taken to only print the usage instruction when the error really was about
flag parsing.

Taking kube-scheduler as example:

  $ _output/bin/kube-scheduler
  I0929 09:42:42.289039  149029 serving.go:348] Generated self-signed cert in-memory
  ...
  W0929 09:42:42.489255  149029 client_config.go:620] error creating inClusterConfig, falling back to default config: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined
  E0929 09:42:42.489366  149029 run.go:98] "command failed" err="invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable"

  $ _output/bin/kube-scheduler --xxx
  Usage:
    kube-scheduler [flags]

  ...
       --vmodule moduleSpec
                  comma-separated list of pattern=N settings for file-filtered logging

  Error: unknown flag: --xxx

The kubectl behavior doesn't change:

  $ _output/bin/kubectl get nodes
  Unable to connect to the server: dial tcp: lookup xxxx: No address associated with hostname

  $ _output/bin/kubectl --xxx
  Error: unknown flag: --xxx
  See 'kubectl --help' for usage.
2021-09-30 13:46:49 +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