Commit Graph

292 Commits (72f8a369d021037ca6179339d50ad595b5462a6c)

Author SHA1 Message Date
Kubernetes Submit Queue 6a431d1c0e
Merge pull request #60912 from m1093782566/refactor-hostport
Automatic merge from submit-queue (batch tested with PRs 60898, 60912, 60753, 61002, 60796). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix TODO: move openHostPorts and closeHostPorts into a common struct and add UTs

**What this PR does / why we need it**:

* Fix [TODO](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/network/hostport/hostport.go#L132): move openHostPorts and closeHostPorts into a common struct, and eliminate the `hostportOpener` parameter in openHostPorts(), to make them looks more consistent.

* Add UTs for closeHostPorts.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-03-20 17:37:10 -07:00
m1093782566 13a6306bea move openHostPorts and closeHostPorts into a common struct 2018-03-08 11:13:46 +08:00
Dan Williams 8778e50083 kubelet: make --cni-bin-dir accept a comma-separated list of CNI plugin directories
Allow CNI-related network plugin drivers (kubenet, cni) to search a list of
directories for plugin binaries instead of just one.  This allows using an
administrator-provided path and fallbacks to others (like the previous default
of /opt/cni/bin) for backwards compatibility.
2018-03-01 10:51:18 -06:00
Dan Williams ee2ea223e7 kubenet: accept a list of CNI binary plugin paths 2018-03-01 10:50:40 -06:00
Dan Williams 69ac723b78 cni: convert "vendor" option to multiple plugin binary search paths
It's only used for the test code and after talking with Rajat, the
vendor stuff was never really used anyway.  So convert the vendor
code into a plain array of plugin binary search paths, which is all
the vendor code was doing anyway.
2018-03-01 10:43:23 -06:00
Dan Williams 16eaaaed83 cni: clarify bin/conf directory variable names
pluginDir -> confDir
DefaultNetDir -> DefaultConfDir
DefaultCNIDir -> DefaultBinDir
2018-03-01 10:43:22 -06:00
Zihong Zheng 6004452bed Auto-updated BUILD files 2018-02-27 11:18:11 -08:00
Zihong Zheng dfbec1a63a [kube-proxy] Move ipv6 related funcs to utils pkg 2018-02-27 11:12:45 -08:00
Kubernetes Submit Queue ac25308c08
Merge pull request #59771 from MrHohn/custom-pod-dns-e2e
Automatic merge from submit-queue (batch tested with PRs 60324, 60269, 59771, 60314, 59941). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Promote configurable pod resolv.conf to Beta and add an e2e test

**What this PR does / why we need it**:
Feature issue: https://github.com/kubernetes/features/issues/504

There is no semantic changes. `CustomPodDNS` feature gate will be turned on by default.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #56521

**Special notes for your reviewer**:
/assign @bowei @thockin 

**Release note**:

```release-note
Adds BETA support for `DNSConfig` field in PodSpec and `DNSPolicy=None`.
```
2018-02-24 20:01:44 -08:00
Pavithra Ramesh 098a4467fe Remove conntrack entry on udp rule add.
Moved conntrack util outside of proxy pkg
Added warning message if conntrack binary is not found
Addressed review comments.
ran gofmt
2018-02-22 23:34:42 -08:00
Zihong Zheng 9e5e0c6a59 More unit test for configurable pod resolv.conf 2018-02-22 23:17:13 -08:00
Jeff Grafton ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
Di Xu 48388fec7e fix all the typos across the project 2018-02-11 11:04:14 +08:00
Lee Verberne e10042d22f Increment CRI version from v1alpha1 to v1alpha2
This also incorporates the version string into the package name so
that incompatibile versions will fail to connect.

Arbitrary choices:
- The proto3 package name is runtime.v1alpha2. The proto compiler
  normally translates this to a go package of "runtime_v1alpha2", but
  I renamed it to "v1alpha2" for consistency with existing packages.
- kubelet/apis/cri is used as "internalapi". I left it alone and put the
  public "runtimeapi" in kubelet/apis/cri/runtime.
2018-02-07 09:06:26 +01:00
stewart-yu 2fefca4a0b remove unnecessary function getBuggyHostportChain 2018-01-09 10:38:53 +08:00
Di Xu 92c9c9ad30 ignore nonexistent ns net file error when deleting container network 2018-01-03 14:00:35 +08:00
Jeff Grafton efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
m1093782566 f7611017e9 check and set promiscuous mode with netlink because vishvananda/netlink already supports it 2017-12-11 10:39:57 +08:00
MrHohn 9f9c721b20 Support Custom Pod DNS in kubelet, gated by feature gate 2017-11-20 16:18:10 -08:00
Zihong Zheng 386d1b61bd Consolidate DNS codes in kubelet pkg 2017-11-16 21:07:24 -08:00
Kubernetes Submit Queue 6e950cc629
Merge pull request #55651 from MrHohn/kubelet-dns-pkg
Automatic merge from submit-queue (batch tested with PRs 55657, 54758, 47584, 55758, 55651). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Move DNS related kubelet codes into its own package

**What this PR does / why we need it**:
Ref https://github.com/kubernetes/features/issues/504, this PR rearranges DNS related kubelet codes into its own pacakge and adds an OWNERS file.

Again, there is no functional changes, just that codes are moved around and couple fields (`clusterDomain`, `clusterDNS`, `resolverConfig`) are replaced with a `dnsConfigurer` struct.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #NONE 

**Special notes for your reviewer**:
/assign @bowei @thockin 

**Release note**:

```release-note
NONE
```
2017-11-15 23:57:35 -08:00
Kubernetes Submit Queue 7ad180aae0
Merge pull request #55153 from chenchun/fix
Automatic merge from submit-queue (batch tested with PRs 54436, 53148, 55153, 55614, 55484). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix hostport duplicate chain names

Fixes bad conversion from int32 to string. Without this patch, getHostportChain/hostportChainName generates the same chain names for ports 57119/55429/56833 of the same pod.

closes #55771

```release-note
Fixes bad conversion in host port chain name generating func which leads to some unreachable host ports.
```
2017-11-15 12:58:01 -08:00
Zihong Zheng 0bc2e1f62f Move DNS related kubelet codes into its own package 2017-11-15 10:56:44 -08:00
Chun Chen c6375c20b7 Add tests to test if legacy chains/rules can be cleaned up 2017-11-15 15:15:04 +08:00
Chun Chen 5d23dd82ab Remove bugy chains as well to clean up old chain/rule 2017-11-15 15:15:04 +08:00
Chun Chen 932cf077ee Fix hostport duplicate chain names
closes #55771
2017-11-15 15:15:03 +08:00
Robert Pothier 0fd30adb3d ip6tables should be set in the noop plugin
The noop plugin currently sets the iptables for IPv4.
This updates that to also set the iptables for IPv6 so
IPv6 can have parity with IPv4.
2017-11-13 11:17:21 -05:00
Kubernetes Submit Queue f14c0382e4
Merge pull request #54460 from yanxuean/cnibindir
Automatic merge from submit-queue (batch tested with PRs 54460, 55258, 54858, 55506, 55510). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

redendancy code and error log message in cni

**What this PR does / why we need it**:
redendancy code and error log message in cni
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```

/sig-node
2017-11-11 10:45:16 -08:00
Casey Callendrello 23f4afc463 kubenet: disable DAD in the container.
Since kubenet externally guarantees that IP address will not conflict,
we can short-circuit the kernel's normal wait. This lets us avoid the 1
second network wait.
2017-11-07 17:42:02 +01:00
Madhan Raj Mookkandy d7f9e22815 Sandbox Support for Windows + CNI
Following are part of this commit
+++++++++++++++++++++++++++++++++

* Windows CNI Support
	(1) Support to use --network-plugin=cni
	(2) Handled platform requirement of calling CNI ADD for all the containers.
	(2.1) For POD Infra container, netNs has to be empty
	(2.2) For all other containers, sharing the network namespace of POD container,
	      should pass netNS name as "container:<Pod Infra Container Id>", same as the
              NetworkMode of the current container
	(2.3) The Windows CNI plugin has to handle this to call into Platform.
              Sample Windows CNI Plugin code to be shared soon.
* Sandbox support for Windows
	(1) Sandbox support for Windows. Works only with Docker runtime.
	(2) Retained CONTAINER_NETWORK as a backward compatibilty flag,
	    to not break existing deployments using it.
	(3) Works only with CNI plugin enabled.

(*) Changes to reinvoke CNI ADD for every new container created. This is hooked up with PodStatus,
    but would be ideal to move it outside of this, once we have CNI GET support
2017-11-02 17:40:20 -07:00
Casey Callendrello 256d6cc83a kubenet: yield lock while executing CNI plugin.
The CNI plugin can take up to 3 seconds to execute. CNI plugins can safely be
executed in parallel, so yield the lock to speed up pod creation.

Fixes: #54651
2017-10-30 15:55:26 +00:00
yanxuean 988694ff62 error log message in buildCNIRuntimeConf
Signed-off-by: yanxuean <yan.xuean@zte.com.cn>
2017-10-24 15:30:13 +08:00
Kubernetes Submit Queue a9e244d81f Merge pull request #53564 from supereagle/remove-network-plugin-dir-flag
Automatic merge from submit-queue (batch tested with PRs 53743, 53564). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubelet: remove the --network-plugin-dir flag

**What this PR does / why we need it**:
This flag has been replaced with `--cni-bin-dir`,  and has been deprecated in Kubernetes 1.7.
It is safe to remove in Kubernetes 1.9 according to the deprecation policy.

**Which issue this PR fixes**: fixes #46410

**Special notes for your reviewer**:
/assign @mtaufen @freehan @dchen1107

**Release note**:
```release-note
Remove the --network-plugin-dir flag.
```
2017-10-23 13:39:12 -07:00
Kubernetes Submit Queue 257b6f38e9 Merge pull request #43661 from xiangpengzhao/revert-genmac
Automatic merge from submit-queue (batch tested with PRs 43661, 54062). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix #43583 (kubenet: remove code forcing bridge MAC address)

**What this PR does / why we need it**:
*kubenet: remove code forcing bridge MAC address*

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #43583 

**Special notes for your reviewer**:

**Release note**:

```release-note
```

cc @dcbw @freehan
2017-10-18 13:11:20 -07:00
supereagle 0b88971505 kubelet: remove the --network-plugin-dir flag 2017-10-18 09:37:19 +08:00
Jeff Grafton aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
Kubernetes Submit Queue eaaa93c70c Merge pull request #53446 from sjenning/network-plugin-metrics
Automatic merge from submit-queue (batch tested with PRs 53454, 53446, 52935, 53443, 52917). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubelet: add latency metrics to network plugin manager

This PR adds latency metrics to the network plugin operations, namely `GetPodNetworkStatus()`, `SetUpPod()`, and `TearDownPod()`.

I recently had to debug and issue where a PLEG relist hang was occurring due to a hang in a CNI plugin and it would have been really nice to have these.  Between the these new metrics and `docker_operations_latency_microseconds`, we will be able to account for nearly all the time consuming routines in the PLEG relist.

@derekwaynecarr @smarterclayton @eparis @vishh 

```release-note
Metrics were added to network plugin to report latency of CNI operations
```
/sig node
2017-10-05 05:06:25 -07:00
Seth Jennings 607fddf984 kubelet: add metrics to network plugin manager 2017-10-04 12:13:35 -05:00
x1957 f28140429e fix comment 2017-09-30 01:00:24 +08:00
xiangpengzhao 0484a1c2c5 Remove backward compatibility of hostportChainName 2017-09-10 00:24:00 +08:00
Dan Williams c19965c740 cni: print better error when a CNI .configlist is put into a .config 2017-08-17 11:01:05 -05:00
Michael Taufen 24bab4c20f move KubeletConfiguration out of componentconfig API group 2017-08-15 08:12:42 -07:00
Jeff Grafton a7f49c906d Use buildozer to delete licenses() rules except under third_party/ 2017-08-11 09:32:39 -07:00
Jeff Grafton 33276f06be Use buildozer to remove deprecated automanaged tags 2017-08-11 09:31:50 -07:00
Jeff Grafton cf55f9ed45 Autogenerate BUILD files 2017-08-11 09:30:23 -07:00
Kubernetes Submit Queue 5d24a2c199 Merge pull request #49300 from tklauser/syscall-to-x-sys-unix
Automatic merge from submit-queue

Switch from package syscall to golang.org/x/sys/unix

**What this PR does / why we need it**:

The syscall package is locked down and the comment in https://github.com/golang/go/blob/master/src/syscall/syscall.go#L21-L24 advises to switch code to use the corresponding package from golang.org/x/sys. This PR does so and replaces usage of package syscall with package golang.org/x/sys/unix where applicable. This will also allow to get updates and fixes
without having to use a new go version.

In order to get the latest functionality, golang.org/x/sys/ is re-vendored. This also allows to use Eventfd() from this package instead of calling the eventfd() C function.

**Special notes for your reviewer**:

This follows previous works in other Go projects, see e.g. moby/moby#33399, cilium/cilium#588

**Release note**:

```release-note
NONE
```
2017-08-03 04:02:12 -07:00
Kubernetes Submit Queue f2dc80bfe5 Merge pull request #48822 from caseydavenport/drive-by-fix-todo
Automatic merge from submit-queue (batch tested with PRs 47738, 49196, 48907, 48533, 48822)

Fix TODO: rename podInfraContainerID to sandboxID

**What this PR does / why we need it**:

Code-cleanup in kubelet to use consistent naming for sandbox ID. Not super urgent, but thought it would be nice to knock off some TODOs. 

**Which issue this PR fixes**

Fixes a TODO in the code, no associated issue.

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-07-28 03:10:37 -07:00
Tobias Klauser 4a69005fa1 switch from package syscall to x/sys/unix
The syscall package is locked down and the comment in [1] advises to
switch code to use the corresponding package from golang.org/x/sys. Do
so and replace usage of package syscall with package
golang.org/x/sys/unix where applicable.

  [1] https://github.com/golang/go/blob/master/src/syscall/syscall.go#L21-L24

This will also allow to get updates and fixes for syscall wrappers
without having to use a new go version.

Errno, Signal and SysProcAttr aren't changed as they haven't been
implemented in /x/sys/. Stat_t from syscall is used if standard library
packages (e.g. os) require it. syscall.SIGTERM is used for
cross-platform files.
2017-07-21 12:14:42 +02:00
Casey Davenport 78709456ab Fix TODO: rename podInfraContainerID to podSandboxID 2017-07-20 17:45:55 -07:00
ymqytw 9b393a83d4 update godep 2017-07-20 11:03:49 -07:00