Commit Graph

92 Commits (2803fbe3434b24a623a7714b0c34b2a81eefe096)

Author SHA1 Message Date
James DeFelice 4abcf7449c implementation of proxy port allocation 2015-06-02 12:28:25 +00:00
Tim Hockin ac3cc3c518 Rename PORTAL_NET all over 2015-05-28 16:10:44 -07:00
Tim Hockin 4318ca5a8b Rename 'portal IP' to 'cluster IP' most everywhere
This covers obvious transforms, but not --portal_net, $PORTAL_NET and
similar.
2015-05-28 16:10:44 -07:00
Justin Santa Barbara 4b9b7ec2f9 Continue to support (deprecated) publicIPs
Not doing so breaks e2e tests and people that may be using them,
even though we will eventually want to stop supporting this now
that we have better alternatives for typical use cases (NodePort)
2015-05-23 16:37:27 -04:00
Justin Santa Barbara 7346cc8042 Add ServiceType = NodePort; wire everything up 2015-05-22 19:14:28 -04:00
Justin Santa Barbara 3884d5fc59 Add LoadBalancer status to ServiceStatus
This will replace publicIPs
2015-05-22 18:27:05 -04:00
Justin Santa Barbara 1ad4549f5f Proxy infrastructure for NodePorts
A service with a NodePort set will listen on that port, on every node.

This is both handy for some load balancers (AWS ELB) and for people
that want to expose a service without using a load balancer.
2015-05-22 17:21:49 -04:00
Tim Hockin 270c031bec Merge pull request #8484 from thockin/proxier-old-iptables
Clean up old iptables (pre-ip-per-service) legacy
2015-05-19 11:21:46 -07:00
Justin Santa Barbara 2473a81412 Add mutex lock to cleanupStaleStickySessions
Proxier.serviceMap is supposed to be guarded by the mutex
2015-05-19 09:11:05 -04:00
Tim Hockin b64868f23b Clean up old iptables (pre-ip-per-service) legacy 2015-05-18 20:27:40 -07:00
Tim Hockin a548d542db Rename AffinityType to ServiceAffinity 2015-05-18 17:21:30 -07:00
Clayton Coleman a2e4f95e32 Merge pull request #8269 from smarterclayton/add_proxier_error
Proxier should return typed errors
2015-05-18 10:00:44 -04:00
Clayton Coleman de36967c7e Proxier should return typed errors 2015-05-15 13:50:05 -04:00
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
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