Commit Graph

2432 Commits

Author SHA1 Message Date
Carlos Eduardo Arango Gutierrez
a435ad33f4
Cleanup: pkg/util/ipset
Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
2022-03-25 14:14:17 -04:00
Kubernetes Prow Robot
cbf4186a57
Merge pull request #108452 from HirazawaUi/master
show error details removing or adding ipset entry
2022-03-20 16:31:12 -07:00
Kubernetes Prow Robot
54ee338758
Merge pull request #108351 from mengjiao-liu/fix_ipset_test
Fix incorrect test cases to cover code that needs to be tested in `TestValidateIPSet`
2022-03-18 15:01:56 -07:00
Mengjiao Liu
63f600eef4 Improve unit test coverage and readability in pkg/util/netsh/ 2022-03-11 17:04:39 +08:00
HirazawaUi
279fd9abe8 After adding or deleting an ipset entry error, the cause of the error will be displayed 2022-03-02 21:51:20 +08:00
Kubernetes Prow Robot
2de37aa9fa
Merge pull request #108276 from AllenZMC/improve_util_test_coverage
improve test coverage
2022-03-01 16:57:13 -08:00
Mengjiao Liu
63667626d9 Fix incorrect test cases to cover code that needs to be tested in TestValidateIPSet 2022-02-25 16:01:37 +08:00
czm
f31bf3ff12 improve test coverage 2022-02-22 23:04:44 +08:00
Dan Winship
4af471f8be proxy/iptables: move GetChainLines unit tests to the right package
GetChainLines is a utiliptables method, so it should be part of the
unit tests there.
2022-02-21 09:16:22 -05:00
Kubernetes Prow Robot
1659924a97
Merge pull request #108070 from jsafrane/remove-selinux
Remove util/selinux package
2022-02-11 18:19:47 -08:00
Jan Safranek
77aa06d0c8 Remove util/selinux package
The package says:

> the libcontainer SELinux package is only built for Linux, so it is
> necessary to have a NOP wrapper which is built for non-Linux platforms

This is not true, Kubernetes now imports
github.com/opencontainers/selinux/go-selinux and it has proper
multiplatform support (i.e. NOOP on non-Linux platforms).

Removing the whole package and calling go-selinux directly.
2022-02-11 15:20:35 +01:00
Mengjiao Liu
bc55118b5b Improve test coverage: add unit tests TestReadAtMost in pkg/util/tail 2022-02-11 10:20:42 +08:00
Kubernetes Prow Robot
f90267f062
Merge pull request #106840 from Nordix/multi-numa
ReservedMemory Configuration for NUMA
2022-01-27 06:46:25 -08:00
Kubernetes Prow Robot
3bd422dc76
Merge pull request #107293 from dims/jan-1-owners-cleanup
Cleanup OWNERS files - Jan 2021 Week 1
2022-01-13 10:30:30 -08:00
Kubernetes Prow Robot
a0dfd958d5
Merge pull request #107163 from cyclinder/fix_leak_goroutine
fix goroutine leaks in TestConfigurationChannels
2022-01-10 17:23:16 -08:00
Davanum Srinivas
9682b7248f
OWNERS cleanup - Jan 2021 Week 1
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-01-10 08:14:29 -05:00
cyclinder
928e686877 fix goroutine leaks in TestConfigurationChannels
Signed-off-by: cyclinder <qifeng.guo@daocloud.io>
2022-01-10 19:51:16 +08:00
Kubernetes Prow Robot
098b0e05d1
Merge pull request #107001 from mk46/unix_lib
replace syscall with sys/unix pkg in pkg/util/ipvs
2022-01-05 13:54:13 -08:00
Kubernetes Prow Robot
0fc6edeb1d
Merge pull request #106847 from cyclinder/log_the_payload
kube-proxy should log the payload when iptables-restore fails
2021-12-23 17:24:14 -08:00
cyclinder
97bd6e977d kube-proxy should log the payload when iptables-restore fails
Signed-off-by: cyclinder <qifeng.guo@daocloud.io>
2021-12-23 09:50:56 +08:00
songlh
8cceaa051d apply gofmt 2021-12-17 17:35:09 -05:00
songlh
d4f3dde804 time -> timer 2021-12-17 16:03:46 -05:00
songlh
a108393b8c add spaces to comments 2021-12-17 15:41:34 -05:00
songlh
8886e58ae9 add comments to the fix 2021-12-17 15:22:27 -05:00
songlh
ed1823a6c2 fixing three goroutine leaks in bounded_frequency_runner_test.go 2021-12-16 23:31:11 -05:00
Davanum Srinivas
497e9c1971
Cleanup OWNERS files (No Activity in the last year)
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-12-15 10:34:02 -05:00
Ravindra Thakur
a1f73cc247 ReservedMemory Configuration for NUMA
Kubelet throws error when multiple numa nodes are specified for memory
reservation. This is due to "," being used as separator for different
memory types within same numa node as well as for different numa nodes.

This PR fixes the error by using ";" as the separator for
specifying multiple numa node configuration.

Signed-off-by: Ravindra Thakur <ravindra.nath.thakur@est.tech>
2021-12-14 16:15:23 +05:30
Manish Kumar
0a013e9a79 replace syscall with sys/unix pkg in pkg/util/ipvs 2021-12-14 00:09:02 +05:30
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
Kubernetes Prow Robot
b8c1b38261
Merge pull request #106406 from cyclinder/remove_DeleteChain_TODO
kube-proxy remove todo: call iptables -S first when delete chain
2021-12-07 17:26:56 -08:00
Antonio Ojea
d126b14838 migrate nolint coments to golangci-lint 2021-11-17 13:58:53 +01:00
Hanna Lee
30ea05ae7b Update IPVar and IPPortVar functions to have pointer receivers to fix 'ineffective assignment' 2021-11-17 08:56:00 +01:00
cyclinder
d8a801a7a2 kube-proxy remove todo: call iptables -S first when delete chain
Signed-off-by: cyclinder <qifeng.guo@daocloud.io>
2021-11-17 10:12:57 +08:00
caozhiyuan
bad4faf1b9 migrate --register-with-taints to KubeletConfiguration 2021-11-16 19:10:36 +08:00
Neha Lohia
fa1b6765d5
move pkg/util/node to component-helpers/node/util (#105347)
Signed-off-by: Neha Lohia <nehapithadiya444@gmail.com>
2021-11-12 07:52:27 -08:00
Kubernetes Prow Robot
c98b388a84
Merge pull request #105450 from danwinship/ipvs-dead-code
Remove some dead code in the ipvs proxy
2021-11-11 20:50:27 -08:00
ravisantoshgudimetla
02c1bac0b6 [kubelet]: Sync label periodically 2021-11-05 18:47:43 -04:00
ml
a2441a256b fix multiple typos 2021-10-29 21:43:52 +02:00
Dan Winship
508d574921 Remove some dead code in the ipvs proxy 2021-10-04 09:04:35 -04: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
Kubernetes Prow Robot
c5fbcd735d
Merge pull request #104939 from z1cheng/fix-conntrack-typo
Fix error message typo in conntrack
2021-09-17 19:22:06 -07:00
Ricardo Pchevuzinske Katz
37d11bcdaf Move node and networking related helpers from pkg/util to component helpers
Signed-off-by: Ricardo Katz <rkatz@vmware.com>
2021-09-16 17:00:19 -03:00
calvin0327
fb9caa6a84 structured log migration for pkg/util/netsh 2021-09-16 13:23:37 +08:00
Kubernetes Prow Robot
95391adbc0
Merge pull request #99529 from jialaijun/migrate_logs
Structured log migration for pkg/util/netsh
2021-09-14 02:41:07 -07:00
z1cheng
857b8fbe2b Fix error message typo in conntrack 2021-09-12 13:13:57 +08: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
355bc3df22
Merge pull request #104239 from mamil/fix-typo
Fix typo
2021-08-14 10:03:45 -07:00
raymonder jin
cdc225f297
bandwith --> bandwidth 2021-08-09 20:24:47 +08:00
Davanum Srinivas
26cc8e40a8
fix deadcode issues
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-07-14 08:41:21 -04:00
Kubernetes Prow Robot
756203fda0
Merge pull request #102576 from dobsonj/101911
kubelet: do not call RemoveAll on volumes directory for orphaned pods
2021-06-29 06:54:40 -07:00
Kubernetes Prow Robot
fc26906546
Merge pull request #103049 from gdsoumya/feat/errors
Updating github.com/pkg/errors with native go errors pkg
2021-06-25 23:43:23 -07:00
Kubernetes Prow Robot
06dfe683ce
Merge pull request #103123 from dims/remove-fakefs-to-drop-spf13/afero-dependency
Remove fakefs to drop spf13/afero dependency
2021-06-24 07:57:41 -07:00
Davanum Srinivas
5feff280e1
remove fakefs to drop spf13/afero dependency
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-06-24 09:51:34 -04:00
Kubernetes Prow Robot
41c3f5b58d
Merge pull request #100287 from pacoxu/structure-log/clean
structure log related: use %v for error as it is already quoted
2021-06-23 17:19:40 -07:00
Soumya Ghosh Dastidar
1e949fa928 updating github.com/pkg/errors with native errors pkg
Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>
2021-06-21 22:23:33 +05:30
Jonathan Dobson
01bb0f86b0 update comments and owners file for pkg/util/removeall 2021-06-15 10:41:02 -06:00
Jonathan Dobson
484eb01822 kubelet: do not call RemoveAll on volumes directory for orphaned pods 2021-06-08 13:57:35 -06:00
hantmac
127f14198d comment words correct
Signed-off-by: hantmac <hantmac@outlook.com>

comment words correct

Signed-off-by: 韩山杰 <shanjie.han@zhangmen.com>
2021-05-13 20:51:36 +08:00
Masashi Honma
39538463de test: Use bytes.Buffer.String
Fix some warnings from go-staticcheck.

"should use buffer.String() instead of string(buffer.Bytes()) (S1030)"

This warning is explained at this link.
https://staticcheck.io/docs/checks#S1030
2021-03-22 17:48:21 +09:00
pacoxu
bc3e7b5dca nit: use %v for error as it is already quoted 2021-03-16 17:42:43 +08:00
Kubernetes Prow Robot
9067b5691d
Merge pull request #97818 from damemi/remove-util-node-dep
Scheduler: remove direct dependency for k8s.io/kubernetes/pkg/util/node
2021-03-05 04:06:32 -08:00
Mike Dame
af045087d9 Move GetZoneKey function to component-helpers 2021-03-04 10:32:38 -05:00
Supriya Premkumar
e52e5e486c
Adds ineffassign to GO linter script.
Changes:
 - Enables ineffassign check in the verify scripts.
 - Fixes lint errs.
2021-03-03 08:28:10 -08:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
jialaijun
142e5b05cc migrate logs. 2021-02-27 17:47:32 +08:00
Benjamin Elder
122966522e drop obsolete verify-util-pkg.sh
https://github.com/kubernetes/test-infra/pull/21037 obsoletes this
2021-02-26 00:03:23 -08:00
Kubernetes Prow Robot
ccf8a2ef4f
Merge pull request #99088 from gavinfish/storage-resize
Storage: move filesystem resize code to kubernetes/mount-utils
2021-02-22 17:24:02 -08:00
Kubernetes Prow Robot
03b0ec955a
Merge pull request #98960 from BenTheElder/oom-test-v2
fix TestPidListerFailure on cgroupsv2
2021-02-19 22:17:41 -08:00
Dan Winship
95c6a488d8 Make kube-proxy check if IPv6 is really supported before assuming dual-stack 2021-02-17 09:11:15 -05:00
drfish
a04ab9debf Move filesystem resize code to kubernetes/mount-utils 2021-02-15 16:07:07 +08:00
Antonio Ojea
7223f12f39 don´t leak files on iptables tests
the iptables restore function, if it considers that the --wait flag
is not supported, creates a lock file to mimic the iptables behaviour.

The test should take this into account and remove the file.
2021-02-11 00:20:38 +01:00
Benjamin Elder
0156eb179e fix TestPidListerFailure on cgroupsv2 2021-02-10 00:15:12 -08:00
Artyom Lukianov
7561a0f96e memory manager: provide new flag var to parse reserved-memory parameter
The new flag will parse the `--reserved-memory` flag straight forward
to the []kubeletconfig.MemoryReservation variable instead of parsing
it to the middle map representation.

It gives us possibility to get rid of a lot of unneeded code and use the single
presentation for the reserved-memory.

Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
2021-02-09 01:10:01 +02:00
Hanlin Shi
4cd1eacbc1 Add rule to allow healthcheck nodeport traffic in filter table
1. For iptables mode, add KUBE-NODEPORTS chain in filter table. Add
   rules to allow healthcheck node port traffic.
2. For ipvs mode, add KUBE-NODE-PORT chain in filter table. Add
   KUBE-HEALTH-CHECK-NODE-PORT ipset to allow traffic to healthcheck
   node port.
2021-02-03 15:20:10 +00:00
Kubernetes Prow Robot
10744811f5
Merge pull request #95701 from masap/ipset2
ipset: Address a TODO, add test for netmask
2020-12-08 23:34:50 -08:00
Kubernetes Prow Robot
f8c589e745
Merge pull request #96975 from wangkai1994/master
Fix typo in conntrack.go
2020-12-08 21:05:34 -08:00
Kai
03cc04e108
Update conntrack.go 2020-12-01 14:21:47 +08:00
Tim Hockin
f63ca48a1f Clean up comments around old topology labels 2020-11-12 11:21:38 -08:00
Kubernetes Prow Robot
38f5dc8e7b
Merge pull request #96248 from qingsenLi/201105-IPVSProxyMode
Remove Const IPVSProxyMode
2020-11-10 13:41:28 -08:00
Tim Hockin
819ff9b087
Use topology labels instead of old beta names (#96033)
* Rename const for topology.../zone

* Rename const for topology.../region

* Rename const for failure-domain.../zone

* Rename const for failure-domain.../region

* Restore old names for compat
2020-11-05 20:26:50 -08:00
10177505
2cc888d474 Remove Const IPVSProxyMode 2020-11-05 16:17:18 +08:00
Kubernetes Prow Robot
f3fbd17bc8
Merge pull request #95697 from masap/ipset1
ipset: Address a TODO, add test for TestEntry() with IPv6 address
2020-11-04 20:47:05 -08:00
Masashi Honma
c6d2808ad6 ipset: Address a TODO, add test for TestEntry() with IPv6 address
This TODO was introduced by
commit 45ad69765e "wrapper ipset util".

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2020-10-22 08:20:24 +09:00
Masashi Honma
4d30435f24 ipset: Address a TODO, add test for netmask
This PR removes a TODO comment by adding some netmask tests. The TODO comment
introduced by commit e768924a62 "validate entry in ipset".

// TODO: CIDR /32 may not be valid

The comment says that 32 is invalid netmask, but in reality values ​​from 0 to
32 are valid because the result of the Linux ipset command says so.

$ sudo ipset create foo hash:ip,port,net
$ sudo ipset add foo 10.20.30.40,53,192.168.3.1/33
ipset v7.5: Syntax error: '33' is out of range 0-32
$ sudo ipset --version
ipset v7.5, protocol version: 7

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2020-10-19 20:22:02 +09:00
Antonio Ojea
e3c1777f7d conntrack log delete operations 2020-10-19 10:01:58 +02:00
Dan Winship
971477d9b5 kubelet: Set dual-stack hostNetwork pod IPs on dual-stack nodes
Add nodeutil.GetNodeHostIPs to return dual-stack node IPs (in
dual-stack clusters), and make kubelet use it.
2020-10-07 17:26:04 -04:00
Dan Winship
0b43753be7 utilnode: fix incorrect documentation about node name vs hostname
(The behavior is unchanged; the function always took a node name
rather than a hostname. Now it just documents that correctly.)
2020-10-07 17:25:56 -04:00
Srini Brahmaroutu
fbe5daed73 Change code to use staging/k8s.io/mount-utils 2020-09-16 21:51:24 -07:00
knight42
ce0a423ef7
test(iptables): deflake TestRestoreAllWaitOldIptablesRestore
Signed-off-by: knight42 <anonymousknight96@gmail.com>
2020-09-12 22:43:44 +08:00
knight42
b25af8e3c9
feat(iptables): be able to override iptables-1.4-compatible lock path 2020-09-12 22:43:43 +08:00
knight42
f6f0f7922a
test(iptables): deflake TestRestoreAllGrabOldLock
Signed-off-by: knight42 <anonymousknight96@gmail.com>
2020-09-05 01:07:46 +08:00
Luigi Bitonti
19793bd3fa Update k8s.io/utils dependency and use ebtables from there 2020-07-30 08:58:21 +01:00
Jordan Liggitt
f33dc28094 generated: hack/update-hack-tools.sh && hack/update-vendor.sh 2020-07-25 16:45:02 -04:00
Antonio Ojea
924553b7ee iptables don't do reverse DNS lookups
the iptables monitor was using iptables -L to list the chains,
without the -n option, so it was trying to do reverse DNS lookups.
A side effect is that it was holding the lock, so other components
could not use it.
We can use -S instead of -L -n to avoid this, since we only want
to check the chain exists.
2020-07-08 18:39:22 +02:00
Kubernetes Prow Robot
94e1c54735
Merge pull request #92655 from BenTheElder/cleanup-some-owners
Cleanup some owners
2020-07-01 23:14:08 -07:00
Benjamin Elder
2abc8afece eparis to emeritus 2020-06-30 09:50:44 -07:00
Kubernetes Prow Robot
a5b0e44196
Merge pull request #92440 from luigibk/ebtables-broutetable-and-deleterule
Add ebtables rule delete function + broute table + brouting chain
2020-06-29 18:34:26 -07:00
Benjamin Elder
d1ec9b3f9c fix pkg/util/coverage staticcheck 2020-06-23 18:30:32 -07:00
Luigi Bitonti
51f788c6dc Add ebtables rule delete function + broute table + brouting chain 2020-06-22 09:07:29 +01:00