Commit Graph

240 Commits (835a87aed2478ee441f2dbfab15124315ddd880a)

Author SHA1 Message Date
Daniel Smith dca7363459 Serve API version list, test with an integration test. 2014-10-28 17:35:56 -07:00
Eric Tune 40a5ca034d Integration test on master, not just apiserver.
Moved code from cmd/apiserver to pkg/master.

test/integration/client_test made to use a master object,
instead of an apiserver.Handle.

Subsequent PRs will move more handler-installation into
pkg/master, with the goal that every http.Handler of a
standalone apiserver process can also be tested
in a "testing"-style go test.

In particular, a subsequent PR will test
authorization.
2014-10-27 09:14:58 -07:00
derekwaynecarr ce30b2657a Fix integration tests 2014-10-24 11:49:04 -04:00
Clayton Coleman 644eb70085 Refactor tests to split ObjectMeta from TypeMeta 2014-10-24 11:22:21 -04:00
Haney Maxwell 3160500940 Refactor kubelet access and add SSL 2014-10-22 14:53:59 -07: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
Daniel Smith d4c750a878 Fix vet-go.sh and some things it complained about 2014-10-15 11:56:19 -07:00
Daniel Smith 0431f2430d Use cache for minion lookups, don't hammer apiserver 2014-10-13 14:46:31 -07:00
Daniel Smith a292d8c416 Merge pull request #1667 from hmrm/add-kubelet-disable-flags
Allow disabling non-necessary kubelet and apiserver endpoints
2014-10-10 13:38:11 -07:00
derekwaynecarr 9e60bf1e43 Pod cache needs to be namespace-aware 2014-10-10 09:35:31 -04:00
Haney Maxwell c0bf974871 Allow disabling non-necessary kubelet and apiserver endpoints 2014-10-09 16:49:27 -07:00
Haney Maxwell 4d87159eda Allow etcd config file to be passed to apiserver, kubelet, and proxy 2014-10-07 14:25:54 -07:00
Daniel Smith cf203f1304 Fix build error in integration test 2014-10-07 13:10:58 -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 eb24c997e4 Merge pull request #1606 from lavalamp/fix
Try to fix flakiness by increasing timeouts
2014-10-06 17:22:51 -07:00
Daniel Smith a744623948 Try to fix flakiness by increasing timeouts, because that is always the best way to perform such a fix. 2014-10-06 17:14:34 -07:00
Brendan Burns ab6065944c Merge pull request #1584 from thockin/net
Flag-compatible IP type
2014-10-06 13:35:48 -07:00
Daniel Smith cc086908aa Merge pull request #1578 from brendandburns/controller
Extract the service controller from the apiserver.
2014-10-06 12:44:41 -07:00
Tim Hockin 0ad0a247c4 Flag-compatible IP type 2014-10-06 11:29:22 -07:00
Deyuan Deng a9e7cf8e40 Fix integration test read volume dir error. 2014-10-03 19:51:07 -04:00
Brendan Burns e6991d0a66 Extract the service controller from the apiserver, put it in the controller manager for now. 2014-10-03 15:27:22 -07:00
Brendan Burns f00fd8d2e3 Add an integration test for services. 2014-10-02 21:07:06 -07:00
derekwaynecarr 0a290506c2 Fix integration tests 2014-10-02 12:56:42 -04:00
Clayton Coleman ff2eca97d9 Refactor the client (again) to better support auth
* Allows consumers to provide their own transports for common cases.
* Supports KUBE_API_VERSION on test cases for controlling which
  api version they test against
* Provides a common flag registration method for CLIs that need
  to connect to an API server (to avoid duplicating flags)
* Ensures errors are properly returned by the server
* Add a Context field to client.Config
2014-10-01 15:23:37 -04:00
derekwaynecarr de1f94cbc7 Fix integration test 2014-09-30 14:31:17 -04:00
Clayton Coleman 5483333e29 Allow server and client to take api version as argument
* Defaults to v1beta1
* apiserver takes -storage_version which controls etcd storage version
  and the version of the client used to connect to other apiservers
* Changed signature of client.New to add version parameter
* All controller code and component code prefers the oldest (most common)
  server version
2014-09-18 23:27:28 -04: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
Brian Waldon 0bf4fabc19 kubelet: move docker-related code into sub-package 2014-09-11 13:12:28 -07:00
Daniel Smith fc09f988b4 Make tests pass again 2014-09-07 22:26:42 -07:00
Clayton Coleman 818f357128 Client should validate the incoming host value
Convert host:port and URLs passed to client.New() into the proper
values, and return an error if the value is invalid.  Change CLI
to return an error if -master is invalid.  Remove Client.rawRequest
which was not in use, and fix the involved tests. Add NewOrDie

Preserves the behavior of the client to not auth when a non-https
URL is passed (although in the future this should be corrected).
2014-08-28 13:47:36 -04:00
Clayton Coleman e840062c65 Delete all keys prior to running integration test 2014-08-28 09:58:39 -04:00
Daniel Smith 0a1dfa366e Make integration test pass. 2014-08-25 11:59:00 -07:00
Clayton Coleman 286c3c543c Improve the wait.Poll GoDoc and api
Add more tests, and switch to timeouts instead of cycles.
Deflake TestPoller
2014-08-23 12:18:03 -04:00
brendandburns 8f5dd8cf63 Merge pull request #984 from thockin/make_vs_new
Rename a bunch of "Make" functions to "New"
2014-08-20 22:06:57 -07:00
Tim Hockin 0f97a73c1b Rename a bunch of "Make" functions to "New"
Also rename some to other names that make better reading.  There are still a
bunch of "make" functions but they do things like assemble a string from parts
or build an array of things.  It seemed that "make" there seemed fine.  "New"
is for "constructors".
2014-08-20 21:27:19 -07:00
brendandburns 1bd4ae0c62 Merge pull request #943 from smarterclayton/only_wait_for_acceptance
Clients must wait for completion of actions
2014-08-20 21:01:21 -07:00
Clayton Coleman 493863eb93 Return immediately when controllers/pods are committed
Add client waiting conditions.
2014-08-20 18:46:10 -04:00
Clayton Coleman 34031dbc6a Remove excessive waiting in kubelet etcd loop
Listen to etcd longer, and wait a shorter time before reconnecting.
No longer an argument to the source.
2014-08-20 18:46:10 -04:00
derekwaynecarr fd8741edf2 Refactor kubelet to use http.ServeMux 2014-08-20 16:08:08 -05:00
Clayton Coleman bbf3b55e76 Extract RESTHandler and allow API groupings
Prepare for running multiple API versions on the same HTTP server
by decoupling some of the mechanics of apiserver.  Define a new
APIGroup object which represents a version of the API.
2014-08-13 10:53:34 -04:00
Clayton Coleman d7f46718a8 Kubelet should have a max think time before auto resync
The sync frequency should be part of the syncLoop and resync no
less often than every X seconds.  The current implementation runs
even if a config update was delivered less than X seconds ago.
2014-08-07 10:40:03 -04:00
Daniel Smith e75854a1f9 Merge pull request #759 from brendandburns/valid
Add c-identifier validation to service ids.
2014-08-05 12:32:02 -07:00
brendandburns cc4300c3ec Merge pull request #757 from lavalamp/repCtl
Remove etcd dep from controller manager
2014-08-05 11:47:31 -07:00
Brendan Burns 20a8f03d62 Add dns-952-identifier validation to service ids. 2014-08-05 11:40:48 -07:00
Robert Bailey 8671d69f34 Minor style fixes and keep the test manifest in sync. 2014-08-04 16:14:43 -07:00
Daniel Smith b430cebe72 Remove etcd dependency from controller manager. 2014-08-04 14:29:49 -07:00
Daniel Smith 928092e79e Etcd watcher verification
To make sure the etcd watcher works, I changed the replication
controller to use watch.Interface. I made apiserver support watches on
controllers, so replicationController can be run only off of the
apiserver. I made sure all the etcd watch testing that used to be in
replicationController is now tested on the new etcd watcher in
pkg/tools/.
2014-07-31 14:54:30 -07:00
Kelsey Hightower 6d1be5f0ee Add master.Config type and cleanup master configuration
Setting up a new master.Master instance requires passing
around too many arguments.

Add a master.Config type and group related master configs.
Refactor all commands to instantiate new masters using a
master.Config struct.
2014-07-26 22:07:24 -07:00
Kelsey Hightower 7a7dfeb85b integration: Fix multiple response.WriteHeader calls
The current integration tests do not return after delegating
HTTP requests, as a result an extra call to response.WriteHeader
is made for every request.

Fix the issue by returning after delegating HTTP requests.
2014-07-26 16:09:15 -07:00
Brendan Burns bf5ae4bb9d Fork API types. 2014-07-24 21:47:08 -07:00
Eric Tune ded67ead1e Make Kubelet type members private and provide New functions. 2014-07-22 14:40:59 -07:00
Brendan Burns 6c734b1c55 integrate minion health checking and caching. 2014-07-21 21:52:33 -04:00
Clayton Coleman 7767c2a2ac Switch the Kubelet to use kubelet/config
Also transfer the Kubelet from using ContainerManifest.ID to source specific
identifiers with namespacing.  Move goroutine behavior out of kubelet/ and
into integration.go and cmd/kubelet/kubelet.go for better isolation.
2014-07-21 21:27:26 -04:00
Kelsey Hightower dc7ee7c333 normalize -etcd_servers flag across all commands
The -etcd_servers flag is used inconsistently by the Kubernetes commands,
both externally and internally.

This patch fixes the issue by using the same type to represent a list of
etcd servers internally, and declares the -etcd_servers flag consistently
across all commands.

This patch should be 100% backwards compatible with no changes in behavior.
2014-07-20 07:48:47 -07:00
Brendan Burns c6255afe37 Make the service reconciller use the API, not a PodRegistry 2014-07-18 13:54:33 -07:00
Brendan Burns 5bf0820580 Fix integration tests. 2014-07-11 14:24:54 -07:00
Yuki Yugui Sonoda c25f44c137 Fixes golint errors in cmd/. 2014-07-08 16:08:24 +09:00
Brendan Burns a77248eb6f Add some more logging to better understand integration test timeouts. 2014-07-07 13:57:25 -07:00
Brendan Burns e3838e1153 Make poll period and timeout configurable.
Make poll period short for integration testing.
2014-07-07 10:13:27 -07:00
Daniel Smith 3b9735d787 Test atomic PUTs, and make them work.
Improve apiserver/logger.go's interface (it's pretty cool now).

Improve apiserver's error reporting to clients.

Improve client's handling of errors from apiserver.

Make failed PUTs return 409 (conflict)-- http status codes are amazingly
well defined for what we're doing!
2014-07-02 15:42:05 -07:00
Daniel Smith 969586a214 Add logging, fix crash
Crash was in kublet_server when fake docker client gives it nil pointer.
2014-07-01 17:38:07 -07:00
Daniel Smith bf3b34c2e9 Allow master's pod info getter to be faked. Wire up in integration tests in futile attempt to make travis pass. 2014-07-01 17:08:32 -07:00
Daniel Smith 587fb75a7a rearrange RunKubelet's parameters so that address and port are next to each other 2014-07-01 16:47:37 -07:00
Daniel Smith b820e026f6 Improve logging. 2014-07-01 14:02:14 -07:00
Daniel Smith 50bbf39925 improvements to integration test organization 2014-07-01 14:02:14 -07:00
brendandburns d53c56dd29 Merge pull request #314 from thockin/valid2
Fix examples to set manifest ID and version
2014-06-30 20:21:32 -07:00
brendandburns 65a62278b1 Merge pull request #286 from lavalamp/exampleEtcd
Separate scheduler from registry
2014-06-30 20:17:07 -07:00
Tim Hockin 9affd6d260 Fix examples to set manifest ID and version
Part 4 in a series of changes towards data validation.
2014-06-30 16:16:06 -07:00
Daniel Smith 011ce9d871 Add crash handler bypass for testing. 2014-06-29 12:35:43 -07:00
Tim Hockin 6c79937a42 Reduce logging noise
Don't use %#v for errors.
Do use %+v when more detail than %v is needed.
Fix typos Kublet -> Kubelet.
2014-06-28 22:16:26 -07:00
Daniel Smith 134f44e3fa Merge pull request #276 from brendandburns/minion
Initial integration of the cloud based minion registry.
2014-06-27 22:56:47 -07:00
Brendan Burns 431fcac8b0 Initial integration of the cloud based minion registry. 2014-06-27 22:49:27 -07:00
Daniel Smith b21facafb1 Merge pull request #273 from brendandburns/kubelet
Make the docker endpoint a flag.
2014-06-27 17:09:25 -07:00
Brendan Burns f8060c5b3d Make the docker endpoint a flag. 2014-06-27 17:01:12 -07:00
Daniel Smith 9a0f89170e Fix comments. Add timeout to integration test; don't make travis run for 15 minutes any more. 2014-06-27 15:40:23 -07:00
Brendan Burns b25f950362 Use etcd compare and swap to update the list of pods, to remove a race. 2014-06-27 11:09:36 -07:00
Tim Hockin 9f9e75f508 Switch to glog for logging, bridge logging to glog.
1) imported glog to third_party (previous commit)
2) add support for third_party/update.sh to update just one pkg
3) search-and-replace:
  s/log.Printf/glog.Infof/
  s/log.Print/glog.Info/
  s/log.Fatalf/glog.Fatalf/
  s/log.Fatal/glog.Fatal/
4) convert glog.Info.*, err into glog.Error*

Adds some util interfaces to logging and calls them from each cmd, which
will set the default log output to write to glog.  Pass glog-wrapped
Loggers to etcd for logging.

Log files will go to /tmp - we should probably follow this up with a
default log dir for each cmd.

The glog lib is sort of weak in that it only flushes every 30 seconds, so
we spin up our own flushing goroutine.
2014-06-24 20:51:57 -07:00
Daniel Smith f7968ce00b Make integration test the manifest url feature. Make kubelet's docker pull command testable. 2014-06-24 16:57:35 -07:00
Daniel Smith fd66a8b59b Readability fixes & address review comments. 2014-06-24 15:16:21 -07:00
Daniel Smith 6900431b13 Add kubelet testing to integration test. Test that kubelet makes the requested containers. Check that the url manifest feature works. 2014-06-24 15:14:40 -07:00
Daniel Smith 61a494d303 First step of combination. 2014-06-24 09:38:22 -07:00
Daniel Smith 79ee5aa250 Implement minion registry. Minions now a first-class object. 2014-06-23 13:27:52 -07:00
Brendan Burns 302ec0f37b Wire in the pod cache. Just used for List for now. 2014-06-18 22:26:35 -07:00
Brendan Burns 420b2fdd57 Add support for populating host ip address. 2014-06-18 14:57:50 -07:00
Daniel Smith d8206503b8 Make integration/localkube work with new controller library 2014-06-18 13:10:39 -07:00
Daniel Smith 59d9763a52 remove package name, not needed here 2014-06-11 17:20:16 -07:00
Brendan Burns 5cb4444176 Task -> Pod #4, the final chapter 2014-06-08 23:00:12 -07:00
Brendan Burns 6018497174 Task -> Pod part #3 2014-06-08 22:38:45 -07:00
Joe Beda 2c4b3a562c First commit 2014-06-06 16:40:48 -07:00