Commit Graph

2450 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
b2042d6ce4
Merge pull request #118338 from aroradaman/mv-ipset
move pkg/util/ipset inside pkg/proxy/ipvs
2023-06-09 08:14:24 -07:00
TommyStarK
1fcfd1d509 pkg/util/iptables: use buf.String() instead of string(buf.Bytes())
Signed-off-by: TommyStarK <thomasmilox@gmail.com>
2023-06-05 19:47:47 +02:00
Daman Arora
2d8c820741 move pkg/util/ipset inside pkg/proxy/ipvs
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2023-05-31 00:30:20 +05:30
Lars Ekman
4aa5441de2 Move pkg/util/ipvs inside pkg/proxy/ipvs
Ipvs will never be used by any other component within K8s than
the proxy/ipvs

Signed-off-by: Lars Ekman <uablrek@gmail.com>
2023-05-27 18:37:50 +02:00
Daman Arora
c68f858658 proxy/ipvs: github user name change: daman1807 -> aroradaman
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2023-05-24 16:00:20 +05:30
kannon92
0819d34204 using parsers in applyDefaultImageTag 2023-05-15 15:53:47 +00:00
Daman Arora
a0133b7cc4 proxy/ipvs: added daman1807 as reviewer
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2023-05-14 16:29:43 +05:30
Kubernetes Prow Robot
a2e2df61a1
Merge pull request #117198 from charles-chenzz/deprecated_function
replace ioutil with os, update doc in kubelet
2023-05-02 08:18:14 -07:00
Kubernetes Prow Robot
8353d4623b
Merge pull request #117427 from cbandy/pkg-testing-setenv
Replace os.Setenv with testing.T.Setenv in tests
2023-04-29 08:28:16 -07:00
Chris Bandy
d38ac7e7c6 Replace os.Setenv with testing.T.Setenv in tests
T.Setenv ensures that the environment is returned to its prior state
when the test ends. It also panics when called from a parallel test to
prevent racy test interdependencies.
2023-04-17 20:39:46 -05:00
Daman
efb0563094 proxy/conntrack: moved pkg/util/conntrack -> pkg/proxy/conntrack 2023-04-16 15:52:52 +05:30
charles-chenzz
ccf7ddacfc replace ioutil with os, update doc 2023-04-13 09:02:46 +08:00
Kubernetes Prow Robot
dcf3792310
Merge pull request #116730 from danwinship/network-owners
sig-network OWNERS fixups
2023-04-11 18:19:44 -07:00
Kubernetes Prow Robot
d0fc9d16ce
Merge pull request #114800 from haoruan/feature-8976-spew-sprintf-refactor
Capture spew.Sprintf() with all our favorite config into a util func
2023-04-11 15:34:57 -07:00
Kubernetes Prow Robot
eb78b75a2c
Merge pull request #114746 from yangjunmyfm192085/fixtestcase
fix test cases that may be incorrect
2023-04-11 15:34:50 -07:00
Hao Ruan
f638e2849f replaced spew.Sprintf with a util pretty print function 2023-03-27 09:24:22 +08:00
Dan Winship
2f3800e100 Make pkg/util/iptables and pkg/util/ipvs owned by sig-network 2023-03-18 11:29:36 -04:00
Dan Winship
4381973a44 Revert (most of) "Issue 70020; Flush Conntrack entities for SCTP"
This commit did not actually work; in between when it was first
written and tested, and when it merged, the code in
pkg/proxy/endpoints.go was changed to only add UDP endpoints to the
"stale endpoints"/"stale services" lists, and so checking for "either
UDP or SCTP" rather than just UDP when processing those lists had no
effect.

This reverts most of commit aa8521df66
(but leaves the changes related to
ipvs.IsRsGracefulTerminationNeeded() since that actually did have the
effect it meant to have).
2023-03-14 12:18:58 -04:00
Dan Winship
eaa0791b56 copy pkg/proxy OWNERS to pkg/util/conntrack 2023-03-13 11:20:36 -04:00
Kubernetes Prow Robot
fa294f3e4e
Merge pull request #115527 from sondinht/ipvs_sh
Ipvs: Enable Source Port hash flag for "mh" method.
2023-02-14 04:25:30 -08:00
Lars Ekman
50cfd6ca80 Add uablrek in pkg/util/ipvs/OWNERS 2023-02-13 19:11:21 +01:00
Son Dinh
4f75949bcb Ipvs: Add a new FlagSourceHash to "mh" distribution method.
With the flag, ipvs uses both source IP and source port (instead of
only source IP) to distribute new connections evently to endpoints
that avoids sending all connections from the same client (i.e. same
source IP) to one single endpoint.

User can explicitly set sessionAffinity in service spec to keep all
connections from a source IP to end up on the same endpoint if needed.

Change-Id: I42f950c0840ac06a4ee68a7bbdeab0fc5505c71f
2023-02-11 20:51:02 +11:00
Artem Minyaylov
f573e14942 Update k8s.io/utils to latest version
Update all usages of FakeExec to pointer to avoid copying the mutex
2023-02-04 11:05:22 -08:00
Dan Winship
f994ae2521 Move GetHostname() from k/k/pkg/util/node to k/component-helpers/node/util
In fact, this actually uses pkg/util/node's GetHostname() but takes
the unit tests from cmd/kubeadm/app/util's private fork of that
function since they were more extensive. (Of course the fact that
kubeadm had a private fork of this function is a strong argument for
moving it to component-helpers.)
2023-01-27 18:24:38 -05:00
HirazawaUi
488b34eeb2 delete unused functions in pkg/util directory 2023-01-16 17:22:35 +08:00
JunYang
5111bced37 fix test cases that may be incorrect 2022-12-30 14:55:27 +08:00
Lars Ekman
90c03dcf9a gofmt 2022-12-23 12:34:31 +01:00
Lars Ekman
4ef7726c4e Remove obsolete test case 2022-12-23 11:46:45 +01:00
Lars Ekman
cf214d0738 Clean-up un-used code 2022-12-23 10:54:51 +01:00
Kubernetes Prow Robot
112a7a590c
Merge pull request #110723 from yangjunmyfm192085/fixklog
Fix incorrect log information and log structure
2022-12-16 19:17:41 -08:00
cncal
2670042dde fix wrong statement in unittest of BoundedFrequencyRunner 2022-11-15 17:36:26 +08:00
Michal Wozniak
4e732e20d0 Do not revert the pod condition if there might be running containers, skip condition update instead. 2022-11-07 16:22:29 +01:00
Kubernetes Prow Robot
3edbebe348
Merge pull request #110268 from danwinship/minimize-iptables-changes
minimize iptables-restore input
2022-11-01 18:06:46 -07:00
Kubernetes Prow Robot
4c657e5014
Merge pull request #110403 from claudiubelu/unittests-3
unittests: Fixes unit tests for Windows (part 3)
2022-10-31 15:52:44 -07:00
Kubernetes Prow Robot
36dd5f2846
Merge pull request #113191 from saltbo/refa-remove-unused-ipconfig
Remove the unused pkg/util/ipconfig
2022-10-23 19:22:25 -07:00
JunYang
856146e67e Fix incorrect log information
Update pkg/util/iptables/iptables.go

Co-authored-by: Dan Winship <danwinship@redhat.com>

Update pkg/util/iptables/iptables.go

Co-authored-by: Dan Winship <danwinship@redhat.com>

Update pkg/util/iptables/iptables.go

Co-authored-by: Dan Winship <danwinship@redhat.com>

Update pkg/util/iptables/iptables.go

Co-authored-by: Dan Winship <danwinship@redhat.com>

Update pkg/util/iptables/iptables.go

Co-authored-by: Dan Winship <danwinship@redhat.com>

Update pkg/util/iptables/iptables.go

Co-authored-by: Dan Winship <danwinship@redhat.com>

Update pkg/util/iptables/iptables.go

Co-authored-by: Dan Winship <danwinship@redhat.com>

Update pkg/util/iptables/iptables.go

Co-authored-by: Dan Winship <danwinship@redhat.com>
2022-10-24 08:36:52 +08:00
Claudiu Belu
9f95b7b18c unittests: Fixes unit tests for Windows (part 3)
Currently, there are some unit tests that are failing on Windows due to
various reasons:

- paths not properly joined (filepath.Join should be used).
- Proxy Mode IPVS not supported on Windows.
- DeadlineExceeded can occur when trying to read data from an UDP
  socket. This can be used to detect whether the port was closed or not.
- In Windows, with long file name support enabled, file names can have
  up to 32,767 characters. In this case, the error
  windows.ERROR_FILENAME_EXCED_RANGE will be encountered instead.
- files not closed, which means that they cannot be removed / renamed.
- time.Now() is not as precise on Windows, which means that 2
  consecutive calls may return the same timestamp.
- path.Base() will return the same path. filepath.Base() should be used
  instead.
- path.Join() will always join the paths with a / instead of the OS
  specific separator. filepath.Join() should be used instead.
2022-10-21 19:25:48 +03:00
saltbo
cc90e819bc
refactor: replace the ioutil by the os and io
Signed-off-by: saltbo <saltbo@foxmail.com>
2022-10-20 15:13:28 +08:00
saltbo
266404ec8c
refactor: remove the unused pkg/util/ipconfig
Signed-off-by: saltbo <saltbo@foxmail.com>
2022-10-20 14:21:42 +08:00
Amim Knabben
7df6c02288 Remove Linux and Windows Kube-proxy Userspace mode 2022-10-05 16:59:02 -03:00
Dan Winship
818de5a545 proxy/iptables: Add metric for partial sync failures, add test 2022-09-26 16:31:42 -04:00
Mengjiao Liu
1b9e4eb073 Improve test readability by fixing previous code variables that could easily be changed and
improve unit test coverage in `pkg/util/taints/taints_test.go`
2022-09-16 17:23:35 +08:00
Mengjiao Liu
3ee0eea45c Remove unused functions in pkg/util/taints/ 2022-09-14 11:13:03 +08:00
Kubernetes Prow Robot
baf6014e0c
Merge pull request #112182 from dcbw/pkg-util-ipset-sig-net-approvers
pkg/util/ipset: add sig-network to reviewers/approvers
2022-09-01 20:08:04 -07:00
Kubernetes Prow Robot
9924814270
Merge pull request #108460 from Nordix/issue-72236
Prevent host access on VIP addresses in proxy-mode=ipvs
2022-09-01 12:59:18 -07:00
Dan Williams
24cf5e51a5 pkg/util/ipset: add sig-network to reviewers/approvers
Signed-off-by: Dan Williams <dcbw@redhat.com>
2022-09-01 11:35:11 -05:00
Aaron Crickenberger
cb98449156 pkg/util/coverage: update fakeTestDeps impl
testing.testDeps has had more methods added so fakeTestDeps needs to
follow suit
2022-08-25 17:23:49 -07:00
lojies
89fdd8858b code cleanup: omit comparison to bool constant 2022-08-17 14:46:32 +08:00
Michal Wozniak
04fcbd721c Introduction of a pod condition type indicating disruption. Its reason field indicates the reason:
- PreemptionByKubeScheduler (Pod preempted by kube-scheduler)
- DeletionByTaintManager (Pod deleted by taint manager due to NoExecute taint)
- EvictionByEvictionAPI (Pod evicted by Eviction API)
- DeletionByPodGC (an orphaned Pod deleted by PodGC)PreemptedByScheduler (Pod preempted by kube-scheduler)
2022-08-02 11:12:16 +02: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