Commit Graph

159 Commits (d51e131726b925e7088b90915e99042459b628e0)

Author SHA1 Message Date
BenTheElder 78d2fda480 Move proxySocket out of proxier.go to proxysocket.go
Moves proxySocket out of proxier.go to new proxysocket.go in proxy
package in order to start separating proxy logic and implementation and
make proxier more manageable to review.
2015-05-14 19:08:35 -04:00
Tim Hockin 667dd81905 un-export CreateProxier 2015-05-14 11:37:25 -07:00
Daniel Smith 16a6fb8ef7 Replace calls to time.After with time.NewTimer for explicit stopping 2015-05-04 14:29:33 -07:00
Eric Paris 6b3a6e6b98 Make copyright ownership statement generic
Instead of saying "Google Inc." (which is not always correct) say "The
Kubernetes Authors", which is generic.
2015-05-01 17:49:56 -04:00
Xiang Li 7e36a88068 pkg/proxy: a more reliable way to detect a closed proxy 2015-04-13 10:11:22 -07:00
Dawn Chen b6ec2f971e Merge pull request #6741 from xiang90/udp_timeout
proxy: lower udp timeout
2015-04-13 08:58:02 -07:00
Xiang Li 233ec922f3 proxy: lower udp timeout 2015-04-11 23:51:08 -07:00
Xiang Li 4b29947652 pkg/proxy: panic if run out of fd
When proxy runs out of fd, it fills the logs with error message.
From #6716, it is better to just panic().
2015-04-11 13:09:15 -07:00
Clayton Coleman 51db3bd654 Create a new testclient package that can be backed by disk files
Standardize how our fakes are used so that a test case can use a
simpler mechanism for providing large, complex data sets, as well
as represent queries over time.
2015-04-07 14:56:15 -04:00
Vishnu Kannan eb1c453a9a Updating kube-proxy logging levels to assist debugging. 2015-04-03 20:19:52 +00:00
Tim Hockin 186818d787 WIP: Implement multi-port Services 2015-03-30 19:28:11 -07:00
Alex Robinson 151b871eff Fix bug in kube-proxy of not updating iptables rules if a service's
public IPs change, and add tests to catch the bug.
2015-03-30 20:39:59 +00:00
Tim Hockin 8ae203825b Implement multi-port endpoints
Instead of endpoints being a flat list, it is now a list of "subsets"
where each is a struct of {Addresses, Ports}.  To generate the list of
endpoints you need to take union of the Cartesian products of the
subsets.  This is compact in the vast majority of cases, yet still
represents named ports and corner cases (e.g. each pod has a different
port number).

This also stores subsets in a deterministic order (sorted by hash) to
avoid spurious updates and comparison problems.

This is a fully compatible change - old objects and clients will
keepworking as long as they don't need the new functionality.

This is the prep for multi-port Services, which will add API to produce
endpoints in this new structure.
2015-03-27 12:36:32 -07:00
Abhishek Gupta b0c23c1046 Headless Services: Adding option to specify None for PortalIP 2015-03-20 12:10:03 -07:00
Salvatore Dario Minonne 31ddefc347 Finalize fields.Selector 2015-03-17 22:55:43 +01:00
Quinton Hoole cc72eaec3a Fix services namespace clash.
Serve identically names services in different namespaces on different external IP addresses.
2015-03-16 18:19:19 -07:00
Subin M 269ad3216f fix proxy_test.go file to avoid ChooseHostInterface 2015-03-13 01:40:48 +05:30
Tim Hockin 52298ab851 Merge pull request #4865 from sub-mod/proxier_go_change
use ChooseHostInterface in kube-proxy
2015-03-11 08:09:32 -07:00
Subin M b8c91e7344 use ChooseHostInterface in kube-proxy 2015-03-11 13:50:53 +05:30
Eric Tune 2ca265ae3b Remove --etcd_servers flag from kubelet and proxy.
All the distros that use this have been updated,
or have PRs out to update them, or owners
have been asked to fix RPMs.

Removing this prevents further use of this model.

Remove now dead code: EtcdClientOrDie

Remove now dead pkg/proxy/config/etcd.go.

Remove unused imports.
2015-03-10 09:29:09 -07:00
Tim Hockin 5dc98968c3 Refactor load balancer.
Flatten 3 parallel maps into a map to structs (balancerState).
2015-02-23 12:59:59 -08:00
Tim Hockin 8503c34694 Fix unprotected shared state in load balancer 2015-02-23 12:59:35 -08:00
Tim Hockin e88134f736 Some renames in round-robin balancer
Making a clear path for more service port changes,making this code more
comprehensible.
2015-02-23 12:56:44 -08:00
Tim Hockin 37b8c14a4f use a strong type for loadbalancer keys 2015-02-23 12:56:44 -08:00
Brendan Burns 9829128a75 Merge pull request #4580 from thockin/plural_20_endpoints
Part 2 of plural ports: make endpoints a struct
2015-02-20 15:42:19 -08:00
Daniel Smith 17feadf977 Merge pull request #4240 from thockin/hyperkube
Hyperkube cleanup
2015-02-20 11:12:32 -08:00
Eric Paris e8acfe5f81 change proxy to satisfy both gofmt 1.3 and 1.4 gofmt
gofmt -s from 1.4  does not like
	for _ = range BLAH
it wants
	for range BLAH

But gofmt from 1.3 dies:
	./pkg/proxy/config/config.go:265:6: expected operand, found 'range'
	./pkg/proxy/config/config.go:268:3: expected '{', found 'EOF'

So instead, rewrite the code to make them both happy
2015-02-20 12:30:33 -05:00
Tim Hockin 8c2ff81ae0 move pkg/proxy/server to cmd/kube-proxy/app 2015-02-20 08:49:12 -08:00
Eric Paris 9965604d4b check gofmt with golang 1.4 2015-02-20 10:31:06 -05:00
Victor Marmol 2d1a8d0da0 Allow ApplyOomScoreAdj to specify what PID to adjust for. 2015-02-19 17:16:31 -08:00
Tim Hockin ae0062d001 Part 2 of plural ports: make endpoints a struct
Includes conversions for v1b[12] and tests and fixups for call sites.
2015-02-18 19:54:15 -08:00
Tim Hockin 411666decb Get rid of ServiceSpec.ProxyPort
As far as I know, nobody uses it.  It was replaced by PublicIPs.  If I were
being very polite I would leave it in internal, but since I am 99.99% sure
nobody uses it, I am cutting it.  Let's argue about it.
2015-02-03 22:45:00 -08:00
Tim Hockin 3b5ea74a48 Fix a race in kube-proxy causing runaways
It was an ABA problem where the proxy loop might see its own service as
"existing" when it had been destroyed and recreated (as in an update).

To prove this I added a counter of running ProxyLoop goroutines and check that
in tests.  If I undo my main change, the tests fail.  This makes the
proxier_test significantly slower (3 seconds vs 0.5 seconds).  Sorry.
2015-02-03 17:08:09 -08:00
Joe Beda 638069b879 Convert proxy server to hyperkube 2015-02-02 14:03:13 -08:00
Mike Danese d77743a07c gimports nits 2015-01-26 22:42:29 -08:00
Steve Reed f7e3cb12a6 Moves string slice sorting, copying and shuffling into pkg/util/slice 2015-01-22 14:20:23 -08:00
Steve Reed 38241c7e80 Copies endpoint slices before any sorting 2015-01-22 14:20:18 -08:00
Steve Reed 79a6bfb95f Fixes #3640 by shuffling endpoints in the round-robin load balancer 2015-01-22 14:19:56 -08:00
Mike Danese 8b65621aeb fix interface conversion panic 2015-01-16 12:23:16 -08:00
fabianofranz 0235bca2d3 When choosing a host interface proxier must only consider the ones with an address assigned 2015-01-14 17:09:27 -02:00
Daniel Smith 24e59de06e Merge pull request #3392 from erictune/reflector_proxy
Reconcile kubelet and kube-proxy watching code, initial steps.
2015-01-12 14:55:26 -08:00
Eric Tune 295800201e Make pkg/proxy/config more like pkg/kubelet/config
Split SourceAPI into two subobjects.

Parallel structure for endpoints, services will allow
changing to use generic code in pkg/client/cache/reflector.go.

Rename some funcs to be more like pkg/client/cache.
2015-01-12 14:37:04 -08:00
Brendan Burns 6ad88bb143 Clear resourceVersion on errors. 2015-01-12 11:45:38 -08:00
Tim Hockin 4fcd496d59 change everything to use new util/errors 2015-01-08 22:10:03 -08:00
Brendan Burns 0f60d7bca3 Reset the resourceVersion so that we poll again for non-timeout errors. 2015-01-06 11:45:03 -08:00
Tim Hockin ca27fb259c Don't use pointers for session affinity 2014-12-29 14:43:17 -08:00
Tim Hockin e045c6ce2f Split portals into host and container
After this DNS is resolvable from the host, if the DNS server is targetted
explicitly.  This does NOT add the cluster DNS to the host's resolv.conf.  That
is a larger problem, with distro-specific tie-ins and circular deps.
2014-12-29 09:18:12 -08:00
Mike Foley c4e94efe16 Sticky Session Implementation
- Added process to cleanup stale session affinity records
- Automatically set cloud provided load balancer for sticky session if the service requires it - Note, this only works on GCE right now.
- Changed sessionAffinityMap a map to pointers instead of structs to improve performance
- Commented out cookie and protocol from sessionAffinityDetail to avoid confusion as it is not yet implemented.
2014-12-18 18:46:10 -05:00
Eric Tune 64f1084c1a Rename util.config.Watcher -> util.config.Broadcaster.
Watch is a widely used term in the codebase, which doesn't capture
the key feature of this type: broadcasting a change to several
listeners.
2014-12-04 00:10:27 -08:00
Daniel Smith 6cb26e17a4 Merge pull request #2697 from erictune/no_accept_err
Proxy: Avoid log error.  Simplify locking.
2014-12-03 14:06:17 -08:00