Commit Graph

2432 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
ef198ec7ca
Merge pull request #90316 from tangcong/fix-ipvs-staticheck-err
fix ipvs staticcheck error
2020-05-19 20:34:32 -07:00
Kubernetes Prow Robot
b170451caa
Merge pull request #90183 from dims/update-kubernetes-to-klog-v2
Update kubernetes to klog v2
2020-05-16 18:59:51 -07:00
Kubernetes Prow Robot
9769e0f5da
Merge pull request #90008 from gavinfish/scheduler-utilparsers
Scheduler: remove direct import to /pkg/util/parsers
2020-05-16 07:35:49 -07:00
Davanum Srinivas
07d88617e5
Run hack/update-vendor.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:33 -04:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
cici37
7f4d19167e Move pkg/util/configz to k8s.io/component-base 2020-04-29 12:17:25 -07:00
drfish
0b715ea690 Scheduler: remove direct import to /pkg/util/parsers 2020-04-26 23:41:52 +08:00
Kubernetes Prow Robot
15ed3b36d1
Merge pull request #90235 from cici37/addflag
Remove CCM dependency pkg/util/flag
2020-04-22 19:22:14 -07:00
Kubernetes Prow Robot
d2dcd6c399
Merge pull request #89896 from carlosedp/fix-89597
Add error messages to IPVS module
2020-04-22 17:02:41 -07:00
Carlos de Paula
b3d84fac52 Add error messages to IPVS module
Signed-off-by: Carlos de Paula <me@carlosedp.com>
2020-04-22 15:21:15 -03:00
cici37
15c844031f Remove CCM dependency pkg/util/flag 2020-04-22 10:06:11 -07:00
Jie Shen
363bb39142
Use utils.net to parse ports instead of atoi (#89120) 2020-04-21 20:55:52 -07:00
tangcong
764b902d72 fix ipvs staticcheck error 2020-04-21 07:25:28 +08:00
Steve Azzopardi
4936cd476b
Fix golint issues for pkg/util/rlimit
pkg/util/rlimit/rlimit_linux.go:25:1: exported function RlimitNumFiles should have comment or be unexported
pkg/util/rlimit/rlimit_linux.go:25:6: func name will be used as rlimit.RlimitNumFiles by other packages, and that stutters; consider calling this NumFiles
pkg/util/rlimit/rlimit_unsupported.go:25:1: exported function RlimitNumFiles should have comment or be unexported
pkg/util/rlimit/rlimit_unsupported.go:25:6: func name will be used as rlimit.RlimitNumFiles by other packages, and that stutters; consider calling this NumFiles

Ref: https://github.com/kubernetes/kubernetes/issues/68026
2020-04-14 21:00:41 +02:00
Tim Hockin
9551ecb7c3 Cleanup: Change "Ip" to "IP" in func and var names 2020-04-10 15:29:50 -07:00
Tim Hockin
efb24d44c6 Rename iptables IsIpv6 to IsIPv6 2020-04-10 15:29:50 -07:00
Tim Hockin
ef934a2c5e Add Protocol() method to iptables
Enables simpler printing of which IP family the iptables interface is
managing.
2020-04-10 15:29:49 -07:00
Kubernetes Prow Robot
ad4bd386eb
Merge pull request #86752 from SataQiu/fix-kubelet-20191231
Add error handler for rlimit.RlimitNumFiles
2020-04-01 22:14:38 -07:00
Kubernetes Prow Robot
c2ae0bd763
Merge pull request #74073 from Nordix/issue-70020
Issue #70020; Flush Conntrack entities for SCTP
2020-04-01 22:14:24 -07:00
Ricardo Pchevuzinske Katz
5c48f209a5 Update ipvs library to the new repo and upgrade library version 2020-03-26 11:20:01 -03:00
Lars Ekman
aa8521df66 Issue #70020; Flush Conntrack entities for SCTP
Signed-off-by: Lars Ekman <lars.g.ekman@est.tech>
2020-03-11 09:56:54 +01:00
Kubernetes Prow Robot
e4e3d72f1c
Merge pull request #83572 from chendotjs/tc-fix
bandwidth: use regexp to handle tc output and add IPv6 support
2020-03-04 13:18:38 -08:00
chenyaqi01
ef5c920325 bandwidth: use regexp to handle tc output
fix newly-added 'chain N' output from 'tc filter show dev XXX'
2020-03-03 20:07:11 +08:00
Clayton Coleman
b252865479
kubelet: Avoid sending no-op patches
In an e2e run, out of 1857 pod status updates executed by the
Kubelet 453 (25%) were no-ops - they only contained the UID of
the pod and no status changes. If the patch is a no-op we can
avoid invoking the server and continue.
2020-02-26 23:06:38 -05:00
Satyadeep Musuvathy
8c6956e5bb Refactor handling of local traffic detection. 2020-02-21 17:57:34 -08:00
Mike Danese
25651408ae generated: run refactor 2020-02-08 12:30:21 -05:00
Mike Danese
2637772298 some manual fixes 2020-02-07 18:17:40 -08:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
Kubernetes Prow Robot
1735f7a2b6
Merge pull request #87377 from gavinfish/pkg-util-netsh
Fix static check errors in pkg/util/netsh
2020-01-21 22:02:35 -08:00
drfish
f19f4e40f9 Fix static check errors in pkg/util/netsh 2020-01-20 13:25:34 +08:00
Guangwen Feng
e2e5bf5e0b Fix golint warning for pkg/util/procfs/procfs_linux.go
Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
2020-01-16 15:16:47 +08:00
SataQiu
51c742c1dd fix staticcheck failures of pkg/util/ipconfig pkg/util/iptables pkg/util/ipvs/testing 2020-01-09 16:05:11 +08:00
SataQiu
2a83443782 add error handler of unix.Setrlimit 2020-01-03 10:49:06 +08:00
Aresforchina
bfc4a7a1c5 fix staticcheck of pkg/util/ebtables 2020-01-02 18:16:50 +08:00
SataQiu
2497a1209b bump k8s.io/utils version 2019-12-21 14:54:44 +08:00
Kubernetes Prow Robot
e1c7112276
Merge pull request #85517 from andrewsykim/ipvs-timeout
support configuration of kube-proxy IPVS tcp,tcpfin,udp timeout
2019-12-17 12:00:43 -08:00
Kubernetes Prow Robot
d0e901807d
Merge pull request #85771 from aojea/iptables_lock
Be more agressive acquiring the iptables lock
2019-12-17 08:32:02 -08:00
Kubernetes Prow Robot
fb0956c234
Merge pull request #85016 from hvaara/fix-golint-pkg-util-sysctl-testing
Fix golint issues in pkg/util/sysctl/testing
2019-12-17 06:18:13 -08:00
Andrew Sy Kim
db2c048db9 support configuration of kube-proxy IPVS tcp,tcpfin,udp timeout
Signed-off-by: Andrew Sy Kim <kiman@vmware.com>
2019-12-17 04:35:08 -05:00
Jordan Liggitt
a65d8aeb76 Add UID precondition to kubelet pod status patch updates 2019-12-16 14:27:32 -05:00
Antonio Ojea
51814ae189
Be more agressive acquiring the iptables lock
iptables has two options to modify the behaviour trying to
acquire the lock.

--wait  -w [seconds]    maximum wait to acquire xtables lock
                        before give up
--wait-interval -W [usecs]  wait time to try to acquire xtables
                            lock
                            interval to wait for xtables lock
                            default is 1 second

Kubernetes uses -w 5 that means that wait 5 seconds to try to
acquire the lock. If we are not able to acquire it, kube-proxy
fails and retries in 30 seconds, that is an important penalty
on sensitive applications.
We can be a bit more aggresive and try to acquire the lock every
100 msec, that means that we have to fail 50 times to not being
able to succeed.
2019-12-03 17:38:13 +01:00
Kubernetes Prow Robot
c58b63267c
Merge pull request #85562 from gkarthiks/master
golint fixes for /pkg/util/iptables/testing
2019-11-27 10:46:45 -08:00
Kubernetes Prow Robot
7ed5eb6dcc
Merge pull request #81880 from MikeSpreitzer/fix81879
Bumped the number of times a node tries to lookup itself
2019-11-27 03:07:20 -08:00
gkarthiks
c38e79e76d refactor: incorporated the review comments
Signed-off-by: gkarthiks <github.gkarthiks@gmail.com>
2019-11-24 11:46:57 -08:00
gkarthiks
a4abc1dd4d refactor(golint): lint fixes for iptables test file
Signed-off-by: gkarthiks <github.gkarthiks@gmail.com>
2019-11-22 19:58:56 -08:00
gkarthiks
b05749c619 chore(gofmt): go format fix
Signed-off-by: gkarthiks <github.gkarthiks@gmail.com>
2019-11-19 08:30:16 -08:00
Karthikeyan Govindaraj
a4631c845e
chore(lint): lint fix in /pkg/util/iptables 2019-11-18 23:44:49 -08:00
Karthikeyan Govindaraj
bdc11c2806
chore(lint): fix iptable.go file lint 2019-11-18 23:43:51 -08:00
Travis Rhoden
0c5c3d8bb9
Remove pkg/util/mount (moved out of tree)
This patch removes pkg/util/mount completely, and replaces it with the
mount package now located at k8s.io/utils/mount. The code found at
k8s.io/utils/mount was moved there from pkg/util/mount, so the code is
identical, just no longer in-tree to k/k.
2019-11-15 08:29:12 -07:00
Kubernetes Prow Robot
e434d2dbab
Merge pull request #84295 from aojea/iptableslogs
Improve iptables logging
2019-11-14 17:49:51 -08:00
Kubernetes Prow Robot
6c5fb3ee60
Merge pull request #83491 from dcbw/winship-iptables-owner
pkg/util/iptables: add Dan Winship to approvers
2019-11-14 16:37:26 -08:00
Kubernetes Prow Robot
cb7cd5d7c6
Merge pull request #82031 from codenrhoden/mount-comments
Additional mount comments
2019-11-13 21:45:34 -08:00
Travis Rhoden
367f879131
Retire mount.Exec for k8s.io/utils/exec
This patch removes mount.Exec entirely and instead uses the common
utility from k8s.io/utils/exec.

The fake exec implementation found in k8s.io/utils/exec differs a bit
than mount.Exec, with the ability to pre-script expected calls to
Command.CombinedOutput(), so tests that previously relied on a callback
mechanism to produce specific output have been updated to use that
mechanism.
2019-11-13 14:09:57 -07:00
Roy Hvaara
e55fc5656c
Fix golint issues in pkg/util/sysctl/testing 2019-11-09 12:32:37 +01:00
Travis Rhoden
1fd8921546
Move mount/fake.go to mount/fake_mount.go
This patch moves fake.go to mount_fake.go, and follows to principle of
always returning a discrete type rather than an Interface. All callers
of "FakeMounter" are changed to instead use "NewFakeMounter()". The
FakeMounter "Log" struct member is changed to not be exported, and
instead only access through a new "GetLog()" method.
2019-11-08 08:07:41 -07:00
Travis Rhoden
47dc1d6af1
move exec files back 2019-11-08 08:04:33 -07:00
Travis Rhoden
1f651f5072
copy exec file to preserve history 2019-11-08 08:04:32 -07:00
Kubernetes Prow Robot
59aa8fd99e
Merge pull request #82698 from janario/fix/umount-subpath-warns
Unmount subpath should only scan the first level of files/directories
2019-11-08 02:16:14 -08:00
Andrew Sy Kim
07229d6c51 pkg/util/node: update GetZoneKey to check both beta and GA labels
Signed-off-by: Andrew Sy Kim <kiman@vmware.com>
2019-11-07 21:22:04 -05:00
Janario Oliveira
2ca213579d Renamed function 2019-11-07 10:05:26 +01:00
Janario Oliveira
67ec00d6b8 Unmount subpath should only scan the first level dir 2019-11-07 10:05:26 +01:00
Jordan Liggitt
297570e06a hack/update-vendor.sh 2019-11-06 17:42:34 -05:00
Travis Rhoden
d3d630281c
Additional mount comments
Add extra comments to clarify behavior.
2019-11-04 11:01:30 -07:00
Kubernetes Prow Robot
85575e929b
Merge pull request #83387 from danwinship/proxy-error-retry
If an iptables proxier sync fails, retry after iptablesSyncPeriod
2019-10-31 21:53:23 -07:00
Dan Winship
4c5f4cb353 BoundedFrequencyRunner: add RetryAfter 2019-10-29 07:36:00 -04:00
Yecheng Fu
c0788c1f21 Update GetMountRefs comments 2019-10-27 15:55:07 +08:00
Antonio Ojea
1268d1a8ff Improve iptables logging 2019-10-24 15:52:05 +02:00
Dan Winship
478fadccff BoundedFrequencyRunner: fix tests
The tests were using a fake timer that only ticked when the test cases
told it to, so it would only be correctly testing the
BoundedFrequencyRunner functionality if the test cases made it tick
whenever the BFR timer was supposed to expire, and didn't make it tick
at any other time. But they didn't do that. Fix it to tick
automatically at the correct times, and update the test cases
accordingly (including adding a new helper method for asserting that
the runner did nothing in cases when it's expected to have done
nothing).

Also fix two unrelated minor bugs in fakeTimer.
2019-10-22 08:17:30 -04:00
zouyee
a864fd2100 fix unsafe JSON construction
Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
2019-10-10 09:44:54 +08:00
Yassine TIJANI
c1487840bc move util/metrics to component-base
Signed-off-by: Yassine TIJANI <ytijani@vmware.com>
2019-10-08 14:42:31 +02:00
Kubernetes Prow Robot
e0cb1617db
Merge pull request #78357 from sbueringer/fix-golint-pkg-util
Fix golint issues in pkg/util/env
2019-10-05 08:41:10 -07:00
Dan Williams
765bb2707d pkg/util/iptables: add Dan Winship to OWNERS 2019-10-03 22:21:48 -05:00
Dan Winship
2f89c03c63 iptables.Monitor: don't be fooled by "could not get lock" errors 2019-10-02 11:35:12 -04:00
Kubernetes Prow Robot
74d2822662
Merge pull request #72535 from tallclair/content-type
Always set content-type & nosniff
2019-09-27 18:43:39 -07:00
Stefan Bueringer
fa36b19e79
Fix golint issues in pkg/util/env 2019-09-27 17:25:19 +02:00
chenyaqi01
3175c9e226 simplify regexp with raw string 2019-09-20 16:53:56 +08:00
Dan Winship
3948f16ff4 Add iptables.Monitor, use it from kubelet and kube-proxy
Kubelet and kube-proxy both had loops to ensure that their iptables
rules didn't get deleted, by repeatedly recreating them. But on
systems with lots of iptables rules (ie, thousands of services), this
can be very slow (and thus might end up holding the iptables lock for
several seconds, blocking other operations, etc).

The specific threat that they need to worry about is
firewall-management commands that flush *all* dynamic iptables rules.
So add a new iptables.Monitor() function that handles this by creating
iptables-flush canaries and only triggering a full rule reload after
noticing that someone has deleted those chains.
2019-09-17 10:19:26 -04:00
Dan Winship
b6c3d5416a Drop iptables firewalld monitoring support
The firewalld monitoring code was not well tested (and not easily
testable), would never be triggered on most platforms, and was only
being taken advantage of from one place (kube-proxy), which didn't
need it anyway since it already has its own resync loop.

Since the firewalld monitoring was the only consumer of pkg/util/dbus,
we can also now delete that.
2019-09-15 15:35:40 -04:00
Kubernetes Prow Robot
85827dc224
Merge pull request #82602 from danwinship/iptables-rhel-fix-2
Fix iptables version detection code to handle RHEL 7 correctly
2019-09-12 11:46:40 -07:00
Dan Winship
75888077d3 Fix iptables version detection code to handle RHEL 7 correctly 2019-09-11 18:47:58 -04:00
Tim Allclair
ef6cba0b36 Always set content-type & nosniff 2019-09-11 15:01:43 -07:00
Kubernetes Prow Robot
10979d4c75
Merge pull request #82032 from logicalhan/owners
add myself to util metrics owners
2019-09-11 14:04:33 -07:00
Kubernetes Prow Robot
3f4e30a80e
Merge pull request #82113 from kebe7jun/fix/log-format-and-typo
Fix sync pod log format
2019-09-11 10:39:14 -07:00
Kubernetes Prow Robot
d5da17e58e
Merge pull request #81432 from logicalhan/clean-shared-metrics
delete shared metrics (post metrics-stability migration)
2019-09-10 14:30:32 -07:00
Kubernetes Prow Robot
542f3c65a0
Merge pull request #78547 from MikeSpreitzer/fix-76699
Make iptables and ipvs modes of kube-proxy MASQUERADE --random-fully if possible
2019-09-03 14:34:58 -07:00
Mike Spreitzer
d86d1defa1 Made IPVS and iptables modes of kube-proxy fully randomize masquerading if possible
Work around Linux kernel bug that sometimes causes multiple flows to
get mapped to the same IP:PORT and consequently some suffer packet
drops.

Also made the same update in kubelet.

Also added cross-pointers between the two bodies of code, in comments.

Some day we should eliminate the duplicate code.  But today is not
that day.
2019-09-01 22:07:30 -04:00
Han Kang
d301e9c3a5 clean-up shared metrics code and remaining references (component-base's copy is a drop in replacement) 2019-08-30 10:41:52 -07:00
Travis Rhoden
935c23f2ad
Move HostUtil to pkg/volume/util/hostutil
This patch moves the HostUtil functionality from the util/mount package
to the volume/util/hostutil package.

All `*NewHostUtil*` calls are changed to return concrete types instead
of interfaces.

All callers are changed to use the `*NewHostUtil*` methods instead of
directly instantiating the concrete types.
2019-08-30 10:14:42 -06:00
Kubernetes Prow Robot
96439cc97f
Merge pull request #82028 from codenrhoden/rename-isbind
Rename mount.IsBind to mount.MakeBindOpts
2019-08-30 00:43:32 -07:00
Kubernetes Prow Robot
d6bc4eb853
Merge pull request #81624 from logicalhan/cm-migration
migrate controller-manager metrics to stability framework
2019-08-29 05:30:09 -07:00
KEBE
8dc401d141 Fix sync pod log format and a func typo. 2019-08-29 14:39:43 +08:00
Han Kang
59db3ac27e migrate controller-manager metrics to stability framework 2019-08-28 12:26:57 -07:00
Clayton Coleman
a49a554211
Move the IsMasterNode function to tests and mark it Deprecated
A future change will stop using this signal and instead use a
label selector passed on creation.
2019-08-28 11:17:27 -04:00
Han Kang
17c6414135 add myself to util metrics owners 2019-08-27 15:19:25 -07:00
Travis Rhoden
ef855c7c08
Rename mount.IsBind to mount.MakeBindOpts 2019-08-27 11:34:42 -06:00
Kubernetes Prow Robot
0eb1bfc9b5
Merge pull request #81732 from tallclair/merge-tolerations
Fix toleration comparison & merging logic
2019-08-27 09:25:09 -07:00
Kubernetes Prow Robot
bc46e8fc53
Merge pull request #81739 from codenrhoden/clarify-mkdir-mkfile-behavior
Move MakeFile/Dir from HostUtil to host_path vol
2019-08-27 00:53:24 -07:00
Tim Allclair
2e08288144 Remove conflict logic from PodTolerationRestriction 2019-08-26 15:31:15 -07:00
Tim Allclair
5a50b3f4a2 Fix toleration comparison & merging logic 2019-08-26 15:25:49 -07:00
Travis Rhoden
107039a265
Move MakeFile/Dir from HostUtil to host_path vol
The MakeFile and MakeDir methods in the HostUtil interface only had one
caller -- the Host Path volume plugin. This patch relocates MakeFile and
MakeDir to the Host Path plugin itself.
2019-08-26 10:46:08 -06:00
Travis Rhoden
a30ba6197d
Internalize mount.Interface.IsMountPointMatch
IsMountPointMatch() had no callers outside of the mount package, and has
internal implementation details. This patch makes it no longer be
public.
2019-08-26 09:47:07 -06:00
Kubernetes Prow Robot
7ebbe34d9c
Merge pull request #81794 from codenrhoden/split-host-utils2
Split HostUtil functionality into its own files
2019-08-24 22:28:21 -07:00
Mike Spreitzer
3bb3db1d36 Bumped the number of times a node tries to lookup itself
Increased the number of tries in pkg/util/node/node.go::GetNodeIP by
1, because the kube-proxy was giving up too early.

This is meant to address #81879
2019-08-23 22:04:41 -04:00
Kubernetes Prow Robot
f1453953b7
Merge pull request #81745 from codenrhoden/mv-hasmountrefs
mv HasMountRefs from mount pkg to vol/util
2019-08-23 00:52:13 -07:00
Kubernetes Prow Robot
37651f1cef
Merge pull request #80368 from danwinship/iptables-checks
iptables feature detection improvements
2019-08-22 13:31:20 -07:00
Travis Rhoden
b94ee6bcb1
Split HostUtil functionality into its own files
This patch takes all the HostUtil functionality currently found in
mount*.go files and copies it into hostutil*.go files. Care was taken to
preserve git history to the fullest extent.

As part of doing this, some common functionality was moved into
mount_helper files in preperation for HostUtils to stay in k/k and Mount
to move out. THe tests for each relevant function were moved to test
files to match the appropriate location.
2019-08-22 11:19:52 -06:00
Travis Rhoden
e0050ebc94
move testfiles back 2019-08-22 10:42:34 -06:00
Travis Rhoden
c55b19bc0a
copy testfiles to hostutil dir 2019-08-22 10:42:02 -06:00
Travis Rhoden
8bac909287
move files back to mount 2019-08-22 10:39:18 -06:00
Travis Rhoden
6a21076039
copy mount files to hostutils 2019-08-22 10:37:37 -06:00
Travis Rhoden
a7830a2c6e
mv HasMountRefs from mount pkg to vol/util
HasMountRefs is only used internal to K8s and should not be moved out
with the mount package. move it to pkg/volume/util instead.
2019-08-21 14:53:34 -06:00
Yassine TIJANI
4d9e4f0b45 move ShuffleStrings to pkg/proxy
Signed-off-by: Yassine TIJANI <ytijani@vmware.com>
2019-08-21 20:03:53 +01:00
Kubernetes Prow Robot
76e19a1619
Merge pull request #81204 from codenrhoden/rename-hu-pathexists
Rename HostUtils.ExistsPath to PathExists
2019-08-12 20:12:12 -07:00
Kubernetes Prow Robot
1d812991b6
Merge pull request #81230 from codenrhoden/rename-GetFSGroup
Rename HostUtils.GetFSGroup to HostUtils.GetOwner
2019-08-09 23:57:26 -07:00
Kubernetes Prow Robot
d816998bd8
Merge pull request #81187 from codenrhoden/rename-newosexec
Rename mount.NewOsExec to mount.NewOSExec
2019-08-09 22:17:13 -07:00
Kubernetes Prow Robot
c8c9d2e21c
Merge pull request #77167 from paulsubrata55/spaul-kube-proxy-fix
Fix for kube-proxy to wait for some duration for the node to be defined.
2019-08-09 19:47:14 -07:00
Travis Rhoden
0e73131ca6
Rename HostUtils.GetFSGroup to HostUtils.GetOwner
This patch renames GetFSGroup (a process property) to GetOwner (a file
property), returning both the uid and gid of the given pathname. This
method is only used in one place in the k/k codebase, but having
"GetOwner" instead of "GetGroup" seems to have more utility.
2019-08-09 13:20:35 -06:00
Travis Rhoden
14e25b7c04
Rename HostUtils.ExistsPath to PathExists 2019-08-09 12:40:19 -06:00
Travis Rhoden
4574473753
Rename mount.NewOsExec to mount.NewOSExec 2019-08-09 12:30:56 -06:00
Travis Rhoden
b47184e954
Fix most linting issues in pkg/util/mount
This patch adds comments to exported items that were missing them in
order to make the linter happy. Only code changes that were limited to
the scope of this package were made. There are other linting issues that
will effect callers, and that will be done a seperate patch.
2019-08-08 12:42:21 -06:00
Kubernetes Prow Robot
46e6fd12bf
Merge pull request #80526 from rosti/remove-normalizer
Remove unused package //pkg/util/normalizer
2019-08-08 10:03:58 -07:00
Kubernetes Prow Robot
19e85a9092
Merge pull request #80502 from xigang/master
Update CleanupAndExit and OnServiceSynced field comment and bugfix panic params in the construct method
2019-08-07 20:10:06 -07:00
Dan Winship
81cd27a51e iptables: simplify version handling 2019-08-01 12:05:31 -04:00
Dan Winship
8bced9b130 iptables: don't do feature detection on the iptables-restore binary
The iptables code was doing version detection on the iptables binary
but feature detection on the iptables-restore binary, to try to
support the version of iptables in RHEL 7, which claims to be 1.4.21
but has certain features from iptables 1.6.

The problem is that this particular set of versions and checks
resulted in the code passing "-w" ("wait forever for the lock") to
iptables, but "-w 5" ("wait at most 5 seconds for the lock") to
iptables-restore. On systems with very very many iptables rules, this
could result in the kubelet periodic resyncs (which use "iptables")
blocking kube-proxy (which uses "iptables-restore") and causing it to
time out.

We already have code to grab the lock file by hand when using a
version of iptables-restore that doesn't support "-w", and it works
fine. So just use that instead, and only pass "-w 5" to
iptables-restore when iptables reports a version that actually
supports it.
2019-08-01 11:49:50 -04:00
Emrecan BATI
90ce2d50d3 Add GetKernelVersion to ipvs.KernelHandler interface
ipvs `getProxyMode` test fails on mac as `utilipvs.GetRequiredIPVSMods`
try to reach `/proc/sys/kernel/osrelease` to find version of the running
linux kernel. Linux kernel version is used to determine the list of required
kernel modules for ipvs.

Logic to determine kernel version is moved to GetKernelVersion
method in LinuxKernelHandler which implements ipvs.KernelHandler.
Mock KernelHandler is used in the test cases.

Read and parse file is converted to go function instead of execing cut.
2019-07-31 22:10:44 +03:00
Rostislav M. Georgiev
8157c4c4a8 Remove unused package //pkg/util/normalizer
Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2019-07-25 15:36:00 +03:00
xigang
76aceca22f bugfix: panic log params in the construct method when maxInterval is less than minInterval 2019-07-24 09:42:13 +08:00
Kubernetes Prow Robot
5993ec5a5a
Merge pull request #80478 from silenceshell/patch-1
fix grammar error
2019-07-23 17:14:54 -07:00
Kubernetes Prow Robot
eb6bcfb345
Merge pull request #80096 from ZP-AlwaysWin/dev05
Fix golint failure in pkg/util/netsh/testing/
2019-07-23 17:14:41 -07:00
silenceshell
c9275c97aa
fix grammar err
"be of interest to you"
2019-07-23 19:18:29 +08:00
Kubernetes Prow Robot
f101466d2e
Merge pull request #77553 from s-urbaniak/fix-76956
pkg/util/workqueue/prometheus: fix double registration
2019-07-22 19:10:53 -07:00
ZP-AlwaysWin
a988719722 Fix golint failure in pkg/util/netsh/testing/ 2019-07-19 16:03:44 +08:00
Andrew Sy Kim
3629ed10fa add myself and lbernail as IPVS approvers
Signed-off-by: Andrew Sy Kim <kiman@vmware.com>
2019-07-11 19:06:59 -04:00
Brian Goff
7077bbd783 Use O_CLOEXEC in util packages
This prevents fd's from leaking to subprocesses.
2019-07-09 10:04:00 -07:00
Kubernetes Prow Robot
c8cee54240
Merge pull request #79391 from danwinship/nodeaddresses-update-fix
Don't use strategic merge patch on Node.Status.Addresses
2019-07-02 21:08:29 -07:00
Dan Winship
05a9634fb3 Hack PatchNodeStatus() to override the patch type on Status.Addresses 2019-07-02 19:16:30 -04:00
Khaled Henidak(Kal)
dba434c4ba kubenet for ipv6 dualstack 2019-07-02 22:26:25 +00:00
Khaled Henidak(Kal)
584d7103e2 node ipam controller for ipv6 dualstack 2019-07-02 15:39:06 +00:00
Kubernetes Prow Robot
ca6113fb8b
Merge pull request #78495 from odinuge/cgroups-hugetlb
Fix cgroup hugetlb size prefix for kB
2019-06-28 16:09:29 -07:00
Kubernetes Prow Robot
2501a9083d
Merge pull request #68513 from codenrhoden/mount-refactor
Refactor util/mount interface in prep for moving out of k/k
2019-06-28 13:57:28 -07:00
Odin Ugedal
2bcdb944f0
Update dependency opencontainer/runc 2019-06-28 21:23:05 +02:00
Kubernetes Prow Robot
eee3e976d8
Merge pull request #78294 from vllry/kp-remove-resource-container
Remove deprecated flag --resource-container from kube-proxy
2019-06-22 00:38:12 -07:00
Kubernetes Prow Robot
efa043151c
Merge pull request #79094 from gaorong/fix-IsLikelyNotMountPoint
fix kubelet can not delete orphaned pod directory when "/var/lib/kubelet/pods" directory symbolically links to another device's directory
2019-06-18 19:02:31 -07:00
Kubernetes Prow Robot
d3bbe03b08
Merge pull request #79032 from yastij/move-initsystem
move initsystem to kubeadm
2019-06-17 09:42:15 -07:00
Kubernetes Prow Robot
3ee8ae2721
Merge pull request #78888 from tedyu/mount-ref
Return early when mount ref is determined
2019-06-17 04:36:50 -07:00
Yassine TIJANI
c3904bbce6 move initsystem to kubeadm
Signed-off-by: Yassine TIJANI <ytijani@vmware.com>
2019-06-17 12:21:01 +02:00
Rong Gao
595fcf68d1 fix kubelet can not delete orphaned pod directory when the kubelet's root directory symbolically links to another device's directory 2019-06-17 15:39:25 +08:00
Vallery Lancey
dc0f14312e Removed deprecated --resource-container flag from kube-proxy. 2019-06-16 08:36:42 -07:00
Travis Rhoden
be7da5052f Refactor pkg/util/mount to be more reusable
This patch refactors pkg/util/mount to be more usable outside of
Kubernetes. This is done by refactoring mount.Interface to only contain
methods that are not K8s specific. Methods that are not relevant to
basic mount activities but still have OS-specific implementations are
now found in a mount.HostUtils interface.
2019-06-14 09:35:18 -06:00
Kubernetes Prow Robot
d30fbab4b8
Merge pull request #77915 from SataQiu/fix-golint-util-20190515
Fix golint failures of pkg/util/parsers pkg/util/sysctl pkg/util/system
2019-06-14 00:29:00 -07:00
Ted Yu
320dc6c54c Return early when mount ref is determined 2019-06-10 20:40:40 -07:00
Kubernetes Prow Robot
9b14c22375
Merge pull request #78428 from luksa/iptables-save-panic
Fix panic in kube-proxy when iptables-save prints to stderr
2019-05-31 23:23:00 -07:00
Kubernetes Prow Robot
5d1409a4bf
Merge pull request #78189 from ksubrmnn/initsystem
Use Service Control Manager as the Windows Initsystem
2019-05-31 22:02:34 -07:00
Kubernetes Prow Robot
bdf3d248eb
Merge pull request #77523 from andrewsykim/fix-xlb-from-local
iptables proxier: route local traffic to LB IPs to service chain
2019-05-31 12:22:53 -07:00
Kubernetes Prow Robot
46a3d82240
Merge pull request #78464 from andrewsykim/ipvs-reviewer
add myself and Laurent as ipvs proxy reviewers
2019-05-30 04:54:35 -07:00
ksubrmnn
4d7ee1cd5a Use system calls to manage Windows services 2019-05-29 17:33:47 -07:00
Kubernetes Prow Robot
e4c3540621
Merge pull request #78269 from jpbetz/reinvoke-intree
Reinvocation testing of in-tree admission plugins and fix podpreset to be idempotent
2019-05-29 03:11:03 -07:00
Kubernetes Prow Robot
1eba04822e
Merge pull request #78251 from byteor/master
[pkg/util/coverage]: group imports for readability
2019-05-29 03:10:38 -07:00
Andrew Sy Kim
f6d9a45643 add myself and Laurent as ipvs proxy reviewers
Signed-off-by: Andrew Sy Kim <kiman@vmware.com>
2019-05-29 01:43:50 -04:00
Joe Betz
a6e1db97f0 Merge tolerations in a consistent order 2019-05-28 15:10:16 -07:00
Marko Lukša
93a549679f Capture stderr output and write it to buffer on error 2019-05-28 17:09:29 +02:00
Kubernetes Prow Robot
a57fbaf635
Merge pull request #78088 from andrewsykim/ipvs-unit-test-graceful-termination
ipvs: add graceful termination unit tests
2019-05-28 07:18:11 -07:00
Marko Lukša
00e7505618 Discard stderr output when calling iptables-save 2019-05-28 14:43:28 +02:00
Marko Lukša
df23697ae7 Better error message if panic occurs during iptables-save output parsing 2019-05-28 11:38:27 +02:00
Subrata Paul
2862f3ec94 Updated node.go using update-gofmt.sh 2019-05-25 00:46:50 +05:30
Zhou Peng
31daeed3b2 [pkg/util/coverage]: group imports for readability
Signed-off-by: Zhou Peng <p@ctriple.cn>
2019-05-23 21:38:12 +08:00
Kubernetes Prow Robot
d8c3348520
Merge pull request #74880 from smileusd/fix-IsLikelyNotMountPoint-function
distinguish between mountpoints and symbolic link in IsNotMountPoint
2019-05-22 04:00:12 -07:00
Kalya Subramanian
e0fec1dc28 Include golang.org/x/sys/windows/svc/mgr to manage Windows services 2019-05-20 23:28:56 +00:00
Kubernetes Prow Robot
e476a60ccb
Merge pull request #73241 from vikaschoudhary16/selinux-label
Add correct selinux label at plugin socket directory
2019-05-20 11:07:17 -07:00
smileusd
a81f770472 add annotation about IsLikelyNotMountPoint can't to distinguish mounts and symbolic link 2019-05-20 11:35:24 +08:00
Andrew Sy Kim
15682dfc2a export serviceKey and realServerKey in fake ipvs for easier test fixtures
Signed-off-by: Andrew Sy Kim <kiman@vmware.com>
2019-05-19 23:09:42 +02:00
vikaschoudhary16
58d1b4d564 Add correct selinux label at plugin socket directory 2019-05-18 12:35:17 +05:30
Kubernetes Prow Robot
37281a400d
Merge pull request #76442 from viegasdom/fix-golint-utils-bandwith
Fix golint failures of util/bandwith/*.go
2019-05-15 22:56:08 -07:00
SataQiu
b36d8d431f fix golint failures of pkg/util/parsers pkg/util/sysctl pkg/util/system 2019-05-15 23:19:47 +08:00
Sergiusz Urbaniak
4532cfd85c
pkg/util/workqueue: delete deprecated metrics
This deletes deprecated metrics and simplifies registration.
2019-05-15 12:27:34 +02:00
Kubernetes Prow Robot
aa84b99fa0
Merge pull request #73101 from oz123/kubeadm_openrc_support
Add initial support for OpenRC
2019-05-10 10:37:59 -07:00
Sergiusz Urbaniak
0e291d1f1b
pkg/util/workqueue/prometheus: fix double registration
Currently, if workqueue metrics are registered twice, these metrics will be ignored. This fixes it.
2019-05-09 13:41:09 +02:00
Andrew Sy Kim
8dfd4def99 add unit tests for -src-type=LOCAL from LB chain
Signed-off-by: Andrew Sy Kim <kiman@vmware.com>
2019-05-07 15:22:46 -04:00
Kubernetes Prow Robot
5b47a92ad8
Merge pull request #76359 from monstercy/fixtypo-20190320
correcting some spelling errors
2019-05-03 04:08:31 -07:00
Kubernetes Prow Robot
b5c34d0c43
Merge pull request #74734 from codenrhoden/move-mountspath
Move MountsInGlobalPDPath from mount pkg to volume
2019-05-01 17:28:18 -07:00
Dan Winship
4d77d3e75f Update iptables.IsNotFoundError for iptables-nft error messages 2019-05-01 10:42:30 -04:00
Travis Rhoden
12b7f1450c Move MountsInGlobalPDPath from mount pkg to volume
Since pkg/util/mount is going to move out of k/k, this exported constant
that is Kubernetes specific needed to move somewhere else. Made sense to
move it to pkg/volume/util.

Update GetDeviceNameFromMount in the mount interface to now take a
pluginMountDir argument, which is volume plugin dir with the global
mount path appended to it already.
2019-04-29 09:56:00 -06:00
Subrata Paul
7e04eeab50 Updated pkg node BUILD for new lib inclusion 2019-04-29 19:07:02 +05:30
Subrata Paul
dd9402f451 Fix for kube-proxy to wait for some duration for the node to be defined
Kube-proxy must atleast wait for some duration for the node to defined so that it can fetch the node IP. This node IP is currently used in ipvs proxier for the node-port services.
2019-04-28 00:25:18 +05:30
JieJhih Jhang
098a7c5972 fix golint 2019-04-26 15:37:38 +08:00
Kubernetes Prow Robot
9d617776a3
Merge pull request #76801 from logicalhan/metrics-owners
add owners file to util/metrics and auto-labeling
2019-04-19 20:30:14 -07:00
Davanum Srinivas
7b8c9acc09
remove unused code
Change-Id: If821920ec8872e326b7d85437ad8d2620807799d
2019-04-19 08:36:31 -04:00
Han Kang
d278d59328 add owners file to util/metrics and auto-labeling 2019-04-18 17:01:13 -07:00
Kubernetes Prow Robot
e8e1e9b667
Merge pull request #75119 from sungjunyoung/fix-typo
Fix typo, old link for contributors
2019-04-18 11:28:03 -07:00
Kubernetes Prow Robot
32a49828fe
Merge pull request #76456 from codenrhoden/mv-exec-mounter
Move ExecMount to pkg/volume/util/exec
2019-04-17 12:16:20 -07:00
Zihong Zheng
8ac6119bec Add OWNERS file for sig-network utils 2019-04-11 13:49:03 -07:00
Travis Rhoden
f38d4938be Move ExecMount to pkg/volume/util/exec
This patch moves the ExecMounter found in pkg/util/mount to
pkg/volume/util/exec. This is done in preparation for pkg/util/mount to
move out of tree. This specific implemention of mount.Interface is only
used internally to K8s and does not need to move out of tree.
2019-04-11 12:19:55 -06:00
viegasdom
80578d5bf1 Changes code that still used BandWidthShaper instead of Shaper 2019-04-11 18:50:32 +01:00
viegasdom
1c468bf2e2 Fix golint failures of util/bandwith/*.go 2019-04-11 15:07:41 +01:00
Kubernetes Prow Robot
c62cd6e3a4
Merge pull request #76047 from codenrhoden/mv-nsenter-mount
Move nsenter mounter to pkg/volume/util/nsenter
2019-04-09 09:55:59 -07:00
Oz N Tiram
2a40ef473f Add initial support for OpenRC
* Gentoo has init scripts for kubelet
 * Added a new method of the InitSystem Interface
   This helps issuing nicer messages when not on systemd.
 * OpenRCInitSystem.ServiceExists uses CombinedOutput because
   the behaviour of OpenRC is different from systemd.

This is a partial fix for

 https://github.com/kubernetes/kubeadm/issues/1295
2019-04-08 22:27:35 +02:00
Travis Rhoden
1c045a09db Move nsenter mounter to pkg/volume/util/nsenter
As part of moving pkg/util/mount out of tree, the NSEnter implementation
of mount.Interface needs to be relocated out of pkg/util/mount, as it is
K8s specific. This patch relocates that mounter implementation to
pkg/volume/util/nsenter.

Since the NSEnter mounter shares a lot of its logic with the Linux
mounter implementation, many of the previously private methods of the
Linux mounter are now made public to maintain that shared code.

Additionaly, it was observed that *all* mount.Interface implemenations
were using the same common method for IsNotMountPoint, so this patch
removes that method from the mount.Interface definition and just exports
the common implementation instead.
2019-04-08 09:53:46 -06:00
Travis Rhoden
6e5bf40dd2 Remove apimachinery dep from mount library
As part of wanting to move the mount library into staging and then
k8s.io/utils, there can be no dependencies on k/k code, and that
includes k/apimachinery.

This patch makes a small implementation change to no longer need
k8s.io/apimachinery/pkg/util/sets
2019-04-02 13:49:46 -06:00
Kubernetes Prow Robot
7d15d41eb8
Merge pull request #74159 from dlipovetsky/issue-73249-revise-parsetaint
Update v1.Taint parser to accept the form `key:effect` and `key=:effect-`
2019-04-02 01:36:35 -07:00
Han Kang
8f63657e26 log out metric registration errors instead of silently ignoring them 2019-03-26 11:29:27 -07:00