Commit Graph

513 Commits (7dfa61a2d941176db040f5dc9c3ae13161914e3f)

Author SHA1 Message Date
Chao Xu 60604f8818 run hack/update-all 2017-06-22 11:31:03 -07:00
Chao Xu f2d3220a11 run root-rewrite-import-client-go-api-types 2017-06-22 11:30:59 -07:00
Kubernetes Submit Queue 9054e70ca3 Merge pull request #38751 from chenchun/warn
Automatic merge from submit-queue

Raise a warning instead of info if br-netfilter is missing or unset

Took quite a while to figure out why service VIP is unreachable on my cluster. It turns out br-nf-call-iptables is unset. I wish this message could be a warning to attract considerable attention.
2017-06-16 17:25:32 -07:00
Tim Hockin ce8309780f Proxy: comments around ClusterCIDR use 2017-06-01 12:36:31 -07:00
Wojciech Tyczynski 03c255d7c5 Store chain names to avoid recomputing them multiple times 2017-05-30 10:50:10 +02:00
Wojciech Tyczynski c4d51f12a2 Store port endpoint chain names to avoid recomputing it multiple times 2017-05-30 10:49:36 +02:00
Wojciech Tyczynski 88e3e8f470 Reuse args slice for generating iptable rules. 2017-05-30 10:49:35 +02:00
Wojciech Tyczynski 070f393bc8 Precompute probabilities in iptables kube-proxy. 2017-05-30 10:49:34 +02:00
Wojciech Tyczynski 1242e8ca20 Minor improvement for memory allocations 2017-05-30 08:11:12 +02:00
Kubernetes Submit Queue 25dc892a97 Merge pull request #46450 from MrHohn/fix-proxy-healthcheck-nilpointer
Automatic merge from submit-queue (batch tested with PRs 46450, 46272, 46453, 46019, 46367)

Fix potential nil pointer dereference for kube-proxy healthcheck

Found error log from https://storage.googleapis.com/kubernetes-jenkins/logs/ci-kubernetes-e2e-gce-slow/5222:
```
I0524 20:22:35.554156       7 healthcheck.go:226] Not saving endpoints for unknown healthcheck "kube-system/kubernetes-dashboard"
I0524 20:22:35.554172       7 proxier.go:923] syncProxyRules took 40.047209ms
I0524 20:22:35.554218       7 healthcheck.go:175] Healthcheck "e2e-tests-esipp-f7djn/external-local" closed: accept tcp [::]:32027: use of closed network connection
I0524 20:22:37.416133       7 logs.go:41] http: panic serving 169.254.169.254:49216: runtime error: invalid memory address or nil pointer dereference
goroutine 1623 [running]:
net/http.(*conn).serve.func1(0xc420b27220)
	/usr/local/go_k8s_patched/src/net/http/server.go:1721 +0xd0
panic(0x1c07e40, 0x2b11ee0)
	/usr/local/go_k8s_patched/src/runtime/panic.go:489 +0x2cf
k8s.io/kubernetes/pkg/proxy/healthcheck.hcHandler.ServeHTTP(0xc4201aea60, 0x15, 0xc4203233a0, 0xe, 0xc4203aa280, 0x2ab51a0, 0xc420ae4d20, 0xc4202e7a00)
	/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/proxy/healthcheck/healthcheck.go:200 +0x86
k8s.io/kubernetes/pkg/proxy/healthcheck.(*hcHandler).ServeHTTP(0xc420798390, 0x2ab51a0, 0xc420ae4d20, 0xc4202e7a00)
	<autogenerated>:8 +0x87
net/http.serverHandler.ServeHTTP(0xc4208d0210, 0x2ab51a0, 0xc420ae4d20, 0xc4202e7a00)
	/usr/local/go_k8s_patched/src/net/http/server.go:2568 +0x92
net/http.(*conn).serve(0xc420b27220, 0x2ab66e0, 0xc420945380)
	/usr/local/go_k8s_patched/src/net/http/server.go:1825 +0x612
created by net/http.(*Server).Serve
	/usr/local/go_k8s_patched/src/net/http/server.go:2668 +0x2ce
```

So seems like it's possible healthcheck server is still serving traffic after service entry is removed.

/assign @freehan 

**Release note**:

```release-note
NONE
```
2017-05-26 18:48:56 -07:00
Zihong Zheng 41c4e965c3 Fix potential nil pointer dereference for kube-proxy healthcheck 2017-05-25 10:26:51 -07:00
Tim Hockin 2856fde23b Use BoundedFrequencyRunner in kube-proxy 2017-05-24 20:33:15 -07:00
Tim Hockin 578d9fcf63 Logging/naming cleanup for service port names 2017-05-24 20:33:15 -07:00
Kubernetes Submit Queue 6f5193593d Merge pull request #46201 from wojtek-t/address_kubeproxy_todos
Automatic merge from submit-queue

Address remaining TODOs in kube-proxy.

Followup PR from the previous two.
2017-05-22 20:54:14 -07:00
Wojciech Tyczynski 9e6de42745 Remove Save() from iptables interface 2017-05-22 13:23:49 +02:00
Wojciech Tyczynski ee505677f7 Address remaining TODOs in kube-proxy. 2017-05-22 09:18:55 +02:00
Kubernetes Submit Queue 336fb2f508 Merge pull request #45933 from smarterclayton/secret_reuse
Automatic merge from submit-queue

Move the remaining controllers to shared informers

Completes work done in 1.6 to move the last two hold outs to shared informers - tokens controller and scheduler. Adds a few more tools to allow informer reuse (like filtering the informer, or maintaining a mutation cache).

The mutation cache is identical to #45838 and will be removed when that merges

@ncdc @deads2k extracted from openshift/origin#14086
2017-05-20 23:08:09 -07:00
Clayton Coleman 3e095d12b4
Refactor move of client-go/util/clock to apimachinery 2017-05-20 14:19:48 -04:00
Wojciech Tyczynski 7ba30afbed Fix codestyle 2017-05-20 18:46:29 +02:00
Wojciech Tyczynski 758c9666e5 Call syncProxyRules when really needed and remove reasons 2017-05-20 18:46:28 +02:00
Wojciech Tyczynski c0c41aa083 Check whether service changed 2017-05-20 14:22:56 +02:00
Wojciech Tyczynski 05ffcccdc1 Check whether endpoints change 2017-05-20 14:22:07 +02:00
Wojciech Tyczynski 37a6989c79 Cleanup iptables proxier 2017-05-20 14:17:03 +02:00
Wojciech Tyczynski a3da8d7300 Fix naming and comments in kube-proxy. 2017-05-19 21:34:05 +02:00
Wojciech Tyczynski 7d44f83441 Descrese logs verbosity for iptables 2017-05-19 20:44:26 +02:00
Wojciech Tyczynski e3bb755270 Reuse buffers for generated iptables rules 2017-05-19 20:44:26 +02:00
Wojciech Tyczynski 4d29c8608f Avoid strings.Join which is expensive 2017-05-19 20:44:25 +02:00
Wojciech Tyczynski 5464c39333 Reuse buffer for getting iptables contents 2017-05-19 20:44:25 +02:00
Kubernetes Submit Queue f706b81007 Merge pull request #45642 from JiangtianLi/jiangtli-fixdns2
Automatic merge from submit-queue

Fix the issue in Windows kube-proxy when processing unqualified name. This is for DNS client such as ping or iwr that validate name in response and original question.

**What this PR does / why we need it**:
This PR is an additional fix to #41618 and [the corresponding commit](b9dfb69dd7). The DNS client such as nslookup does not validate name matching in response and original question. That works fine when we append DNS suffix to unqualified name in DNS query in Windows kube-proxy. However, for DNS client such as ping or Invoke-WebRequest that validates name in response and original question, the issue arises and the DNS query fails although the received DNS response has no error. 

This PR fixes the additional issue by restoring the original question name in DNS response. Further, this PR refactors DNS message routines by using miekg's DNS library.

This PR affects the Windows kube-proxy only.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Fix DNS suffix search list support in Windows kube-proxy.
```
2017-05-17 23:48:27 -07:00
Zihong Zheng aca4d469b2 Revert "Remove reasons from iptables syncProxyRules"
This reverts commit 77624a12d3.
2017-05-17 16:33:13 -07:00
Kubernetes Submit Queue 9a9a296556 Merge pull request #45889 from wojtek-t/kube_proxy_handlers
Automatic merge from submit-queue (batch tested with PRs 45953, 45889)

Add /metrics and profiling handlers to kube-proxy

Also expose "syncProxyRules latency" as a prometheus metrics.

Fix https://github.com/kubernetes/kubernetes/issues/45876
2017-05-17 13:56:47 -07:00
Wojciech Tyczynski 45ed99c3a6 Add syncProxyRules prometheus metric 2017-05-17 19:26:58 +02:00
Zihong Zheng 5992425588 Autogenerated files 2017-05-16 21:55:51 -07:00
Zihong Zheng c0920f75cf Move API annotations into annotation_key_constants and remove api/annotations package 2017-05-16 21:55:23 -07:00
Kubernetes Submit Queue 35eba22cc7 Merge pull request #41162 from MrHohn/esipp-ga
Automatic merge from submit-queue (batch tested with PRs 45623, 45241, 45460, 41162)

Promotes Source IP preservation for Virtual IPs from Beta to GA

Fixes #33625. Feature issue: kubernetes/features#27.

Bullet points:
- Declare 2 fields (ExternalTraffic and HealthCheckNodePort) that mirror the ESIPP annotations.
- ESIPP alpha annotations will be ignored.
- Existing ESIPP beta annotations will still be fully supported.
- Allow promoting beta annotations to first class fields or reversely.
- Disallow setting invalid ExternalTraffic and HealthCheckNodePort on services. Default ExternalTraffic field for nodePort or loadBalancer type service to "Global" if not set.

**Release note**:

```release-note
Promotes Source IP preservation for Virtual IPs to GA.

Two api fields are defined correspondingly:
- Service.Spec.ExternalTrafficPolicy <- 'service.beta.kubernetes.io/external-traffic' annotation.
- Service.Spec.HealthCheckNodePort <- 'service.beta.kubernetes.io/healthcheck-nodeport' annotation.
```
2017-05-12 15:00:46 -07:00
Kubernetes Submit Queue 5576fafc63 Merge pull request #45723 from wojtek-t/simplify_iptables_proxy
Automatic merge from submit-queue (batch tested with PRs 45685, 45572, 45624, 45723, 45733)

Remove reasons from iptables syncProxyRules

The reasons are no longer useful, since we know if something changed anyway, I think.
2017-05-12 14:00:59 -07:00
Zihong Zheng 7ed716a997 Change to use ESIPP first class fields and update comments 2017-05-12 10:59:00 -07:00
Wojciech Tyczynski 77624a12d3 Remove reasons from iptables syncProxyRules 2017-05-12 13:32:02 +02:00
Kubernetes Submit Queue a126f40c58 Merge pull request #45622 from shyamjvs/mock-proxy
Automatic merge from submit-queue (batch tested with PRs 45571, 45657, 45638, 45663, 45622)

Use real proxier inside hollow-proxy but with mocked syscalls

Fixes https://github.com/kubernetes/kubernetes/issues/43701

This should make hollow-proxy better mimic the real kube-proxy in performance.
Maybe next we should have a more realistic implementation even for fake iptables (adding/updating/deleting rules/chains in an table, just not on the real one)? Though I'm not sure how important it is.

cc @kubernetes/sig-scalability-misc @kubernetes/sig-network-misc @wojtek-t @gmarek
2017-05-12 02:28:43 -07:00
Jiangtian Li 1760767047 Add error to function return 2017-05-11 00:30:07 -07:00
Jiangtian Li 33d878bc5a Run ./hack/update-bazel.sh to update deps in BUILD 2017-05-11 00:29:48 -07:00
Jiangtian Li 1eda859bf9 Fix the issue in unqualified name where DNS client such as ping or iwr validate name in response and original question. Switch to use miekg's DNS library 2017-05-11 00:29:20 -07:00
Shyam Jeedigunta 27fa52390b Use real proxier inside hollow-proxy but with mocked syscalls 2017-05-10 23:45:26 +02:00
Wojciech Tyczynski ce752e3fc9 Remove no-longer used code in proxy/config 2017-05-10 12:16:35 +02:00
Wojciech Tyczynski 57d35d5acb Switch winuserspace proxy to be event based for services 2017-05-10 12:14:37 +02:00
Kubernetes Submit Queue 332b095ca9 Merge pull request #44968 from MrHohn/kube-proxy-healthcheck
Automatic merge from submit-queue (batch tested with PRs 44727, 45409, 44968, 45122, 45493)

Separate healthz server from metrics server in kube-proxy

From #14661, proposal is on kubernetes/community#552.

Couple bullet points as in commit:
- /healthz will be served on 0.0.0.0:10256 by default.
- /metrics and /proxyMode will be served on port 10249 as before.
- Healthz handler will verify timestamp in iptables mode.

/assign @nicksardo @bowei @thockin 

**Release note**:

```release-note
NONE
```
2017-05-08 14:54:38 -07:00
Zihong Zheng e5db5dc3a1 Autogenerated files 2017-05-05 14:44:38 -07:00
Zihong Zheng ca59d909cf Separate healthz server from metrics server in kube-proxy
- /healthz will be served on 0.0.0.0:10256 by default.
- /metrics and /proxyMode will be served on port 10249
  as before.
- Healthz handler will verify timestamp in iptables mode.
2017-05-05 14:43:44 -07:00
Zihong Zheng eed08362d8 Add healthz server support to healthcheck package 2017-05-05 14:42:27 -07:00
Kubernetes Submit Queue 32335ee473 Merge pull request #45208 from MrHohn/proxy-localendpoint-logic
Automatic merge from submit-queue (batch tested with PRs 44590, 44969, 45325, 45208, 44714)

Fix onlylocal endpoint's healthcheck nodeport logic

I was in the middle of rebasing #41162, surprisingly found the healthcheck nodeport logic in kube-proxy is still buggy. Separate this fix out as it isn't GA related.

/assign @freehan @thockin

**Release note**:

```release-note
NONE
```
2017-05-05 14:08:15 -07:00