Commit Graph

91 Commits (a4abafea02babc529c9b5b9c825ba0bb3eec74c6)

Author SHA1 Message Date
derekwaynecarr c6eb371c93 Fixup unit tests 2014-10-24 11:49:04 -04:00
derekwaynecarr 580cb5ea4f Rework client.Interface 2014-10-24 11:47:30 -04:00
Clayton Coleman 644eb70085 Refactor tests to split ObjectMeta from TypeMeta 2014-10-24 11:22:21 -04:00
Clayton Coleman 7550c146dc Replace struct initializers for TypeMeta with ObjectMeta 2014-10-24 11:22:21 -04:00
Clayton Coleman bb77a5d15f Rename ID -> Name 2014-10-22 15:00:26 -04:00
derekwaynecarr d4e1076306 Fix etcd in proxy for namespace awareness 2014-10-16 16:28:06 -07:00
Daniel Smith 1f9a4750b5 Fix dangerous Sprintf 2014-10-16 14:36:36 -07:00
Tim Hockin e907011111 Core support for ip-per-service 2014-10-16 08:36:47 -07:00
Daniel Smith 8007614085 Remove untested and unused code 2014-10-13 16:06:44 -07:00
Clayton Coleman a5462c0678 Change test cases to verify the client sends the received resourceVersion 2014-10-07 19:00:26 -04:00
Clayton Coleman 82bcdd3b3b Make ResourceVersion a string internally instead of uint64
Allows us to define different watch versioning regimes in the future
as well as to encode information with the resource version.

This changes /watch/resources?resourceVersion=3 to start the watch at
4 instead of 3, which means clients can read a resource version and
then send it back to the server. Clients should no longer do math on
resource versions.
2014-10-07 19:00:26 -04:00
Daniel Smith 2dde76bd03 Fix struct tag in apparently untested config struct 2014-10-07 14:01:45 -07:00
Clayton Coleman d3e51a0f24 Rename JSONBase -> TypeMeta in preparation for v1beta3
Will make subsequent refactor much easier
2014-10-07 11:12:16 -04:00
Tim Hockin 0ad0a247c4 Flag-compatible IP type 2014-10-06 11:29:22 -07:00
derekwaynecarr fc67d822c6 Add context as parameter to client interface functions 2014-10-02 12:51:36 -04: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
Clayton Coleman 61e3ce7ddc Make runtime less global for Codec
* Make Codec separate from Scheme
* Move EncodeOrDie off Scheme to take a Codec
* Make Copy work without a Codec
* Create a "latest" package that imports all versions and
  sets global defaults for "most recent encoding"
  * v1beta1 is the current "latest", v1beta2 exists
  * Kill DefaultCodec, replace it with "latest.Codec"
  * This updates the client and etcd to store the latest known version
* EmbeddedObject is per schema and per package now
* Move runtime.DefaultScheme to api.Scheme
* Split out WatchEvent since it's not an API object today, treat it
like a special object in api
* Kill DefaultResourceVersioner, instead place it on "latest" (as the
  package that understands all packages)
* Move objDiff to runtime.ObjectDiff
2014-09-16 16:26:43 -04:00
Clayton Coleman fe614aeda2 Simple refactor for ease of readability
runtime.DefaultCodec -> latest.Codec
2014-09-16 16:12:35 -04: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
Tim Hockin 86d12681f2 Inject UDP timeout to enable testing 2014-09-12 16:47:40 -07:00
Tim Hockin 38416f6a23 Implement UDP proxying in kube-proxy 2014-09-12 16:47:40 -07:00
Tim Hockin cad6122fe4 Refactor proxy code to make room for UDP 2014-09-12 16:38:17 -07:00
Brendan Burns a343a93b2d Fix a bug where we don't return an error. 2014-09-09 10:29:00 -07:00
Brian Ketelsen 83d3da1436 changed address variable to bindAddress. Used net.JoinHostPort() instead of fmt.Sprintf() 2014-09-07 23:50:36 -07:00
Brian Ketelsen 34922226fd allow proxy to accept a listen address. fixes #1220 2014-09-07 23:27:43 -07:00
Daniel Smith 48ce23ac91 Make client use pointers 2014-09-07 22:19:24 -07:00
Daniel Smith 1c2b65788d Rename Codec and ResourceVersioner to add Default in front, to allow for types of those names 2014-09-07 22:19:24 -07:00
Clayton Coleman 01e668187c Services and Endpoints weren't properly sync'ing
They need incremental changes and a resync on start.
2014-09-03 16:04:55 -04:00
Daniel Smith a63966e73c Combine pkg/apitools and pkg/api/common and call the result pkg/runtime 2014-09-02 11:15:44 -07:00
Daniel Smith 099c8fd36f Propagate rename; tests pass again. 2014-09-02 10:42:06 -07:00
Vojtech Vitek (V-Teq) 59f58cd043 Unify Godoc formatting, fix various typos
Signed-off-by: Vojtech Vitek (V-Teq) <vvitek@redhat.com>
2014-09-02 13:41:03 +02:00
Clayton Coleman 9006eadcfe kube-proxy can read config from the apiserver
All clients that talk to a "master" as a host:port or URL
(scheme://host:port) parameter.  Add tests.
2014-08-27 15:49:01 -04:00
Tim Hockin 23fc00be5c Fix a race in proxy.
addService() eventually calls getServiceInfo(), but the serviceInfo object may
not be installed yet (race).
2014-08-25 21:38:16 -07:00
Brendan Burns da74625ac6 Fix the proxier when a service with the same port is re-created, actually restart the proxy. 2014-08-19 12:24:10 -07:00
Joe Beda 8092a80ad9 Merge pull request #903 from erictune/cleanup4
Pass obj with lock by reference.
2014-08-14 14:29:01 -07:00
Eric Tune ee91a19f90 Pass obj with lock by reference. Methods->funcs.
Fixes "lock passed by value" issues raised by "go vet".
2014-08-14 14:01:27 -07:00
Brendan Burns 7ea2a37219 deflake tests. 2014-08-13 15:41:42 -07:00
Clayton Coleman 7d24615d8e Etcd can close the watch channel for services
Need to loop and reopen if it's closed.
2014-08-13 14:21:16 -04:00
Michal Fojtik afbd7a6147 Make proxy/config/etcd.go less verbose when etcd is not available 2014-08-12 11:51:44 +02:00
Kouhei Ueno 2e02967aca Avoid data race in Proxier.OnUpdate
The bug was that the proxier is passed as value on method decleration.
This caused a copy of Proxier to be created when the method was invoked.
The copy being a shallow copy turned out to have them both reference
a same map instance, but their mutexes were different instances.
This turned out to use different mutexes before operating on a same map
instance, which didn't make sense.
2014-08-06 04:34:54 +09:00
brendandburns f87a93af7a Merge pull request #754 from kelseyhightower/proxy-cleanup
proxy: cleanup and minor refactoring
2014-08-05 11:46:52 -07:00
Kelsey Hightower 1d3e660248 proxy: cleanup and minor refactoring
This change includes minor refactoring and cleanup of the proxy
package including the following items:

 * Rename source files with misspelling of round robin
 * Remove unnecessary and redundant comments
 * Update comments for clarity
 * Add locking when updating the round-robin index
 * Improve method receiver names
 * Rename the LoadBalance method to NextEndpoint to add clarity

No changes in behaviour have been introduced.
2014-08-05 07:18:12 -07:00