Commit Graph

77 Commits

Author SHA1 Message Date
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
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
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
Subin M
b8c91e7344 use ChooseHostInterface in kube-proxy 2015-03-11 13:50:53 +05:30
Daniel Smith
650f6cb826 Revert "Multi-port Endpoints" 2015-02-23 13:53:21 -08:00
Tim Hockin
160f288832 Implement multi-port Endpoints
This is a part of multi-port services.
2015-02-22 09:35:12 -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
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
Tim Hockin
4fcd496d59 change everything to use new util/errors 2015-01-08 22:10: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
909f82f463 Proxy: Avoid log error. Simplify locking.
Don't log an error when Accept failed because the interface (portal)
was just removed.

Don't pass around a pointer to a serviceInfo since another thread
deletes those.  Instead, just check if service name is still in the
service map.

Delete the locking on the serviceInfo object since it is only used
by the "main" proxier thread.
2014-12-03 12:34:54 -08:00
Brendan Burns
6b009f06cd Merge pull request #2635 from thockin/public-ip
Enable public IPs even in not createExternal...
2014-12-01 14:56:22 -08:00
Meir Fischer
d1c93384e9 Set initial timeout on UDP proxy connection creation 2014-11-29 21:32:45 -05:00
Tim Hockin
e925deccb0 Fix iptables for old systems
The iptables args list needs to include all fields as they are eventually spit
out by iptables-save.  This is because some systems do not support the
'iptables -C' arg, and so fall back on parsing iptables-save output.  If this
does not match, it will not pass the check.  For example: adding the /32 on
the destination IP arg is not strictly required, but causes this list to not
match the final iptables-save output.  This is fragile and I hope one day we
can stop supporting such old iptables versions.
2014-11-26 12:50:44 -08:00
Tim Hockin
0c03f6e784 Enable public IPs even in not createExternal...
This allows the proxier to portal Public IPs even if the
createExternalLoadBalancer flag is not set.

This also fixes what appears to be a bug in the createExternalLoadBalancer path
wherein multiple PublicIPs would get truncated.
2014-11-26 10:54:28 -08:00
Meir Fischer
9b441d01ab reset err value to SetDeadline return 2014-11-22 23:48:27 -05:00
Tim Hockin
ea960711ff Clean up error logs.
Use %v for errors, tidy some messages, make error messages start lowe-case
(as per go guidelines).  Just accumulated nits.
2014-11-21 09:45:26 +08:00
Brendan Burns
4a8a2b5a9f Address comments. 2014-11-14 17:23:13 -08:00
Brendan Burns
2aa52d043b Add external services v2 support. 2014-11-14 11:32:54 -08:00
Brendan Burns
c2485a4056 Merge pull request #2147 from justinsb/ipv6
Initial ipv6 / iptables work
2014-11-14 10:34:37 -08:00
Brendan Burns
3b5029c673 Add some retry to the service proxy. 2014-11-12 16:48:27 -08:00
Tim Hockin
bc072206c0 UDP services need UDP portals 2014-11-05 17:47:40 -08:00
markturansky
bd7643c033 refactor services to v1beta3 2014-11-04 14:23:53 -05:00
Justin SB
9a053a4b59 Initial ipv6 / iptables work 2014-11-03 15:23:04 -08:00
Clayton Coleman
bb77a5d15f Rename ID -> Name 2014-10-22 15:00:26 -04:00
Tim Hockin
e907011111 Core support for ip-per-service 2014-10-16 08:36:47 -07:00
Tim Hockin
0ad0a247c4 Flag-compatible IP type 2014-10-06 11:29:22 -07:00
Tim Hockin
04cdf286a4 Make and use api.Protocol type 2014-09-27 20:31:37 -07:00
Clayton Coleman
4e56dafecc Introduce some default log verbosity control
Move a lot of common error logging into better buckets:

glog.Errorf() - Always an error
glog.Warningf() - Something unexpected, but probably not an error
glog.V(0) - Generally useful for this to ALWAYS be visible
            to an operator
            * Programmer errors
            * Logging extra info about a panic
            * CLI argument handling
glog.V(1) - A reasonable default log level if you don't want
            verbosity
            * Information about config (listening on X, watching Y)
            * Errors that repeat frequently that relate to conditions
              that can be corrected (pod detected as unhealthy)
glog.V(2) - Useful steady state information about the service
            * Logging HTTP requests and their exit code
            * System state changing (killing pod)
            * Controller state change events (starting pods)
            * Scheduler log messages
glog.V(3) - Extended information about changes
            * More info about system state changes
glog.V(4) - Debug level verbosity (for now)
            * Logging in particularly thorny parts of code where
              you may want to come back later and check it
2014-09-25 16:30:14 -04:00
Tim Hockin
dd9c562769 Get rid of un-needed lock 2014-09-20 11:40:02 -07:00
Tim Hockin
a559d8d9b2 Move some test-only code into the test 2014-09-20 11:38:05 -07:00
Tim Hockin
20826e6d50 Move copyBytes closer to use-sites 2014-09-20 11:31:13 -07:00
Tim Hockin
cf6ccaee54 Proxy: delete serviceInfo when stopping a service 2014-09-20 11:29:04 -07:00
Tim Hockin
450ccde521 Don't store name twice in proxy 2014-09-16 17:04:23 -07:00
Deyuan Deng
d5eb731b3f Fix leaking FD. 2014-09-15 19:12:32 -04:00
Tim Hockin
3181f3555d Wrap goroutines in HandleCrash() 2014-09-12 16:47:40 -07:00
Tim Hockin
1e50f118fd Move UDP backend setup to a function 2014-09-12 16:47:40 -07:00