Commit Graph

2118 Commits (c72a5b2c107f2578e98249d1d55682671544ab9b)

Author SHA1 Message Date
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 154a91cd33 Rename runtime.DefaultScheme to latest.Codec for ease of readability 2014-09-16 16:19:35 -04:00
Clayton Coleman fe614aeda2 Simple refactor for ease of readability
runtime.DefaultCodec -> latest.Codec
2014-09-16 16:12:35 -04:00
derekwaynecarr 0c20fffa06 No DNS in vagrant cross minions, need explicit IP as host 2014-09-11 13:38:50 -04:00
Brendan Burns e7625c8d91 Add current state to replica controller. 2014-09-09 16:19:18 -07:00
Brendan Burns 4ba4762827 Insert the current state of a replica controller. 2014-09-09 15:23:34 -07:00
Daniel Smith 41754f5bd4 Merge pull request #1192 from smarterclayton/standardize_etcd_errors
Return standard API errors from etcd registry by operation
2014-09-08 15:57:08 -07:00
Clayton Coleman 3ffe259ac7 Return standard API errors from etcd registry by operation
Adds pkg/api/errors/etcd, which defines default conversions
for common CRUD operations from etcd to api.
2014-09-08 18:46:01 -04:00
Daniel Smith 759c3f9033 Rename all XStorage types to REST for clarity 2014-09-08 15:19:13 -07:00
Dawn Chen 7ace5a3e83 Passing pod UUID to Kubelet. 2014-09-08 14:24:09 -07:00
brendandburns 753b80c9b8 Merge pull request #1105 from lavalamp/proxy
Add a generic proxier
2014-09-08 12:51:24 -07:00
Daniel Smith fc09f988b4 Make tests pass again 2014-09-07 22:26:42 -07:00
Daniel Smith 0d30a656ef Do interface{} -> runtime.Object rename everywhere 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
Daniel Smith e2b645ec15 Add a generic proxier
To proxy traffic to anything that implements ResourceLocation.
Currently, this is only services. This is easily extensible to minions
(would supercede existing mechanism) and pods.
2014-09-05 13:33:30 -07:00
Clayton Coleman 34c40e4e48 Errors should be part of api/errors, not apiserver
Renames constructor methods to be errors.New<name> which changed a few
places.
2014-09-03 17:16:00 -04: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) 42c656501c Add several missing pkg Godoc files
Signed-off-by: Vojtech Vitek (V-Teq) <vvitek@redhat.com>
2014-09-02 13:41:11 +02: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
Deyuan Deng d528949547 Fix pod status error with List method. 2014-09-01 21:23:50 -04:00
Joe Beda 2d8e160775 Merge pull request #1117 from lavalamp/fixApi
Invert api and api/v1beta1 dependencies
2014-08-29 14:59:15 -07:00
Daniel Smith aa9b9b9fa8 Invert api and api/v1beta1 dependencies
This is some cleanup that has been needed for a while.
There's still one more step that could usefully be done, which is to
split up our api package into the part that provides the helper
functions and the part that provides the internal types. That can come
later.

The v1beta1 package is now a good example of what an api plugin should
do to version its types.
2014-08-29 12:15:30 -07:00
Clayton Coleman bafc422ac0 Add the resource version to api.*List items from etcd
Allows clients to watch more easily (can invoke Get, then
Watch).
2014-08-28 23:17:00 -04:00
Brian Waldon 816c4a3c76 Remove unnecessary parameter from NewRegistry 2014-08-28 16:52:45 -07:00
Daniel Smith 4de254444e Add simple service redirection 2014-08-27 20:51:41 -07:00
Clayton Coleman 083d81b6d7 Expose REST resource for endpoints and watch on services/endpoints
Will allow kube-proxies to listen on endpoints.
2014-08-27 15:49:01 -04:00
Clayton Coleman b5e1e044bc Move EndpointsController to its own package
Avoids recursive loop with endpoint registry defined
2014-08-27 15:49:00 -04:00
Clayton Coleman 52923a1348 Return validation errors from storage create/update 2014-08-26 13:30:55 -04:00
Daniel Smith 72b35816cd Need to remove pods that change labels. 2014-08-25 15:56:54 -07:00
brendandburns 5155222edc Merge pull request #961 from lavalamp/removeAssignCall
Remove synchronous assignPod call from create pod
2014-08-25 15:25:27 -07:00
Daniel Smith b8c57ea181 Merge pull request #1006 from satnam6502/master
Make validation check for legal service port numbers.
2014-08-25 14:51:22 -07:00
Daniel Smith 98ef76c164 Remove references to scheduler from pod storage. 2014-08-25 11:59:00 -07:00
Daniel Smith ddba004ad0 Add constraint package to let us reject invalid assignments. 2014-08-25 11:59:00 -07:00
Daniel Smith 0a1dfa366e Make integration test pass. 2014-08-25 11:59:00 -07:00
Daniel Smith 29e9e13188 Remove synchronous assignPod call from create pod 2014-08-25 11:59:00 -07:00
Brendan Burns 3012c10ae3 Add a log when we drop a minion because of health checks. 2014-08-25 11:43:02 -07:00
Satnam Singh 4105f7ef61 Code review changes to adjust pacakge name for storage_test.go 2014-08-25 10:38:11 -07:00
Clayton Coleman 58f8ac860f Set creation timestamp on services 2014-08-23 14:33:24 -04:00
Satnam Singh 7fcaf80f67 Make validation check for legal serive port numbers. 2014-08-22 14:44:21 -07:00
Brendan Burns 5839378adc Add a validation that replicaSelector matches PodTemplate.Labels 2014-08-21 22:18:55 -07: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
Tim Hockin 95e0be9a63 Move FakeCloud into its own pkg 2014-08-20 20:16:41 -07:00
Clayton Coleman 493863eb93 Return immediately when controllers/pods are committed
Add client waiting conditions.
2014-08-20 18:46:10 -04:00
Brendan Burns a198bbb0ae Switch api.Status to *api.Status in a bunch of places. 2014-08-20 10:21:49 -07:00
Deyuan Deng c104551025 Improve pkg/registry/service code coverage. 2014-08-19 20:13:00 -04:00
brendandburns 88baa52134 Merge pull request #918 from lavalamp/bindImpl
Implement bindings
2014-08-18 18:19:33 -07:00
Daniel Smith d363d5d942 Merge pull request #944 from brendandburns/service
Add a better test for service environment variables. Fix bugs.
2014-08-18 16:59:21 -07:00
Daniel Smith 138b560efb Implement bindings
This will effectively cause no changes until we remove the assignPod
call from CreatePod().
2014-08-18 16:55:44 -07:00
Brendan Burns 3eb044b495 Add a better test for service environment variables
Fix bugs.
2014-08-18 16:53:59 -07:00
Daniel Smith 4b2867fd8a Standardize watch usage in registry/storage objects. Fix up extremely confusing pod test object. 2014-08-16 19:07:41 -07:00
Daniel Smith e40e5b53a7 Add Watch to /pods. 2014-08-16 19:07:29 -07:00
Daniel Smith 26e2256178 Remove unused and not completely correct code 2014-08-15 18:20:37 -07:00
Paul Morie c69160059b Change CreationTimestamp to a util.Time and set in each storage implementation
Because time.Time doesn't work correctly with our YAML package, it is necessary
to introduce a type, util.Time, which serializes correctly to JSON and YAML.

Eventually we would like timestamping to cut across storage implementations;
for now, we set it in each storage.
2014-08-14 16:26:29 -04:00
Clayton Coleman 231ed95a61 Typo in name 2014-08-13 14:36:23 -04:00
Kelsey Hightower c21a0ca39f Breakup the registry package into separate packages.
Currently all registry implementations live in a single package,
which makes it bit harder to maintain. The different registry
implementations do not follow the same coding style and naming
conventions, which makes the code harder to read.

Breakup the registry package into smaller packages based on
the registry implementation. Refactor the registry packages
to follow a similar coding style and naming convention.

This patch does not introduce any changes in behavior.
2014-08-11 20:58:09 -07:00
Clayton Coleman c6dcfd544f Merge pull request #839 from yugui/fix/api-status
Make storage.Delete return *api.Status instead of api.Status
2014-08-11 20:01:28 -04:00
Daniel Smith c372b74bc8 Merge pull request #847 from thockin/health
Use IntOrString for health checks
2014-08-11 16:28:24 -07:00
brendandburns 3222f61bca Merge pull request #557 from lavalamp/podLocation
Prepare for external scheduler
2014-08-11 15:27:24 -07:00
Daniel Smith b5352a81c7 Use DesiredState rather than CurrentState for Host. 2014-08-11 15:12:51 -07:00
Daniel Smith b7752a86d4 Add debugging info printing to etcd fake
And make tests pass again.
2014-08-11 13:09:24 -07:00
Tim Hockin 7201227cb1 Use IntOrString for HTTP health check ports
Clean up code to be more testable.  Add test cases for named and numeric
ports in HTTP health checks.  Improve tests.
2014-08-10 23:26:42 -07:00
Daniel Smith 7d605467dc New scheduler API
This commit adds a Binding object. The idea is that schedulers can write
these to cause pods to be asssigned to hosts. I'll provide an implementation
along with a rudimentary scheduler plugin.

This continues k8s' tradition of phrasing all APIs as RESTful handlers.
2014-08-10 19:05:03 -07:00
Daniel Smith 5cdce0e35a Prepare for external scheduler
1. Change names of Pod statuses (Waiting, Running, Terminated).
2. Store assigned host in etcd.
3. Change pod key to /registry/pods/<podid>. Container location remains
   the same (/registry/hosts/<machine>/kublet).
2014-08-10 15:05:36 -07:00
Yuki Yugui Sonoda d359f3c396 Make storage.Delete return *api.Status instead of api.Status
as apiserver.APIServer.finishReq expects.

This solves the warning in finishReq:
"programmer error: use *api.Status as a result, not api.Status."
2014-08-09 22:18:24 +09:00
Daniel Smith 49cded3800 Simplify ResourceWatcher interface to one function. 2014-08-08 14:09:13 -07:00
Daniel Smith 71709ae09e Make replication controller use client 2014-08-08 14:09:13 -07:00
Daniel Smith 283fdba6ab Add more parameters to Watch
* Add labels selector (same as List)
* Add fields selector
 * Plan to let you select pods by Host and/or Status
* Add resourceVersion to let you resume a watch where you left off.
2014-08-08 14:09:13 -07:00
Clayton Coleman c9fc0bcf3d Decouple apiserver from codec implementation
The apiserver on initialization must be provided with a codec
for encoding and decoding all handled objects including api.Status
and api.ServerOp.  In addition, the RESTStorage Extract() method
has been changed to New(), which returns a pointer object that the
codec must decode into (the internal object).  Switched registry
methods to use pointers for Create/Update instead of values.
2014-08-07 13:35:35 -04:00
Clayton Coleman 67dbd15929 Address remaining comments from #756
Rename Encoding to Codec, Versioning to ResourceVersioner.  Add
GoDoc.  Add Delete(key, recursive) to EtcdHelper
2014-08-06 11:25:35 -04:00
Daniel Smith 860050b507 Merge pull request #745 from smarterclayton/add_structured_reason
Evolve the api.Status object with Reason/Details
2014-08-05 13:28:19 -07:00
Clayton Coleman 4f88b778a6 Evolve the api.Status object with Reason/Details
Contains breaking API change on api.Status#Details (type change)

Turn Details from string -> StatusDetails - a general
bucket for keyed error behavior.  Define an open enumeration
ReasonType exposed as Reason on the status object to provide
machine readable subcategorization beyond HTTP Status Code. Define
a human readable field Message which is common convention (previously
this was joined into Details).

Precedence order: HTTP Status Code, Reason, Details. apiserver would
impose restraints on the ReasonTypes defined by the main apiobject,
and ensure their use is consistent.

There are four long term scenarios this change supports:

1. Allow a client access to a machine readable field that can be
   easily switched on for improving or translating the generic
   server Message.

2. Return a 404 when a composite operation on multiple resources
   fails with enough data so that a client can distinguish which
   item does not exist.  E.g. resource Parent and resource Child,
   POST /parents/1/children to create a new Child, but /parents/1
   is deleted.  POST returns 404, ReasonTypeNotFound, and
   Details.ID = "1", Details.Kind = "parent"

3. Allow a client to receive validation data that is keyed by
   attribute for building user facing UIs around field submission.
   Validation is usually expressed as map[string][]string, but
   that type is less appropriate for many other uses.

4. Allow specific API errors to return more granular failure status
   for specific operations.  An example might be a minion proxy,
   where the operation that failed may be both proxying OR the
   minion itself.  In this case a reason may be defined "proxy_failed"
   corresponding to 502, where the Details field may be extended
   to contain a nested error object.

At this time only ID and Kind are exposed
2014-08-05 16:17:53 -04:00
Brendan Burns c27ab18481 Don't use zone for regional load balancers. 2014-08-05 11:38:33 -07:00
Clayton Coleman 325f9ef005 Make create atomic on etcd for Services/ReplControllers 2014-08-05 01:12:27 -04:00
Tim Hockin 7f0d470979 Merge pull request #776 from nyaxt/respectzone
ServiceRegistryStorage.Delete should respect zone.
2014-08-04 14:29:46 -07:00
Tim Hockin 471955d310 Merge pull request #775 from nyaxt/misc_cleanup
Minor clean ups for readability
2014-08-04 14:29:07 -07:00
Kouhei Ueno d7fc4637e9 ServiceRegistryStorage.Delete should respect zone. 2014-08-05 06:11:00 +09:00
Kouhei Ueno c6ebc4859e Reduce nesting on ServiceRegistryStorage.Create 2014-08-05 05:38:31 +09:00
Brendan Burns ab4918464e Switched Set to Create 2014-08-04 12:10:16 -07:00
brendandburns 27426db827 Merge pull request #756 from smarterclayton/expose_encoding_versioning_interfaces
Expose an Encoding/Versioning interface for use with etcd
2014-08-04 10:10:54 -07:00
Clayton Coleman ef1329b6c8 Remove expectNoError from pkg/registry 2014-08-04 09:36:47 -04:00
Clayton Coleman 4448be2d95 Expose an Encoding/Versioning interface for use with etcd
etcd_tools.go is not dependent on the specific implementation
(which is provided by pkg/api).  All EtcdHelpers are created
with an encoding object which handles Encode/Decode/DecodeInto.
Additional tests added to verify simple atomic flows.

Begins to break up api singleton pattern.
2014-08-03 21:35:33 -04:00
Daniel Smith 7dbb6f02fe Begin systemizing files in pkg/registry
Files that have RESTStorage implementations now end in "storage", and
files that have registries now end in "registry". I removed some
underscores in file names, since it seems to be go style not to have
them. I split minion_registry.go into two files.

We should consider splitting this package into two, to make more clear
the separation between the layers.
2014-07-31 17:24:15 -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
brendandburns b0d18b2af0 Merge pull request #571 from lavalamp/master
Decode/Encode everywhere
2014-07-29 17:19:33 -07:00
Daniel Smith e10d85efce Merge pull request #685 from smarterclayton/error_on_empty_service
Cleanly delete service without endpoints key
2014-07-29 09:45:31 -07:00
Daniel Smith 4a1660be7c Merge pull request #679 from dchen1107/minionlogs
Fix #663
2014-07-29 09:37:55 -07:00
Clayton Coleman a49b331794 Cleanly delete service without endpoints key
If a service is deleted before the etcd key corresponding to its
endpoints has been created, a 500 error is returned (etcd key
not found).  Instead, key not found should be ignored silently.

There is a potential race condition with the controller creating
endpoints after the service has been deleted which a cleanup task
should handle in the future.

Closes #684
2014-07-29 11:44:46 -04:00
Dawn Chen 58008510a0 Fix #663
Return all healthy minions instead of only returning the first several
healthy minions. Without the PR, if the first minion failed with health
check, the machine list is empty, thus GET /api/v1beta1/pods failed
with code 500
2014-07-29 00:24:53 -07:00
Daniel Smith f87bd6b8f9 Merge pull request #628 from jdef/master
named container ports should have sane env var names
2014-07-28 23:05:48 -07:00
Daniel Smith cd0b25f1e5 Merge pull request #639 from rafael/validate_pods
Validate pod on create and update.
2014-07-28 18:49:51 -07:00
Rafael Chacón c9a3ab168d Validate pod on create and update.
* This commit adds pod validations on when creating and updating a pod.
2014-07-28 18:02:30 -07:00
Daniel Smith 811d710385 Merge pull request #674 from brendandburns/service
Don't hard code load balancer zone.
2014-07-28 17:15:22 -07:00
Brendan Burns c717b872a3 Don't hard code load balancer zone. 2014-07-28 15:54:16 -07:00
Daniel Smith 31a78c3e2b Merge pull request #619 from brendandburns/controller
Make individual controller actions asynchronous.
2014-07-28 15:35:19 -07:00
Brendan Burns 1a3e4f8baf Add some more synchronization. 2014-07-28 15:05:39 -07:00
Daniel Smith b3cc696486 All types stored in etcd are now API objects.
This means I made an api.ContainerManifestList, and added a JSONBase to
endpoints (and changed Name -> JSONBase.ID).
2014-07-28 11:27:36 -07:00
Clayton Coleman 5bc19584a5 Update Service and ReplControllers to validate
Validations are performed on update and on create.
2014-07-27 19:55:03 -04:00
James DeFelice 8e3e65e0f3 named container ports should have sane env var names 2014-07-25 17:55:52 -04:00
Brendan Burns bf5ae4bb9d Fork API types. 2014-07-24 21:47:08 -07:00
Jonathan Boulle c43035088b assorted formatting and typo fixes 2014-07-24 15:10:36 -07:00
Kelsey Hightower fce90dc761 Improve test coverage for the health package and remove mocks
The current tests for the health package utilize a fake HTTP client
for testing health checks and only cover a limited set of test cases.

This patch removes the need for mocks by using the httptest package
from the standard library. After removing the fake HTTP client a bug
was found in the health.Check function; it incorrectly assumes that
a http.Response is always non-nil. Fix the issue by moving the defer
that closes the http.Response.Body after error handling.

Related tests in the registry package have be refactored to work with
the changes made to the health.Check function. All methods that implement
the health.HTTPGetInterface interface now return a http.Response with
with a noop http.Response.Body.

This patch does not introduce any changes in behavior.
2014-07-21 15:30:29 -07:00
Daniel Smith 05f01a3654 Revert "assorted formatting and typo fixes" 2014-07-18 17:16:30 -07:00
Daniel Smith 211f6b312f Merge pull request #520 from jonboulle/master
assorted formatting and typo fixes
2014-07-18 17:15:30 -07:00
Daniel Smith 60b6f5b6bd Merge pull request #524 from brendandburns/service
Make the service reconciller use the API, not a PodRegistry
2014-07-18 15:01:09 -07:00
Brendan Burns c6255afe37 Make the service reconciller use the API, not a PodRegistry 2014-07-18 13:54:33 -07:00
Daniel Smith d8faca9e81 Merge pull request #512 from smarterclayton/communicate_missing_pod_info
PodInfo should indicate when a pod is not found
2014-07-18 13:03:16 -07:00
Jonathan Boulle 9e63c3a633 assorted formatting and typo fixes 2014-07-18 13:02:59 -07:00
Clayton Coleman a17f0d04d4 PodInfo should indicate when a pod is not found
Client should react.  Also, dial down the chattiness of errors for
pods which do not exist and stop processing NotFound earlier in
the podinfo chain
2014-07-18 13:32:10 -04:00
Brendan Burns fa69781b41 Add some more logging to service updates. 2014-07-18 09:29:49 -07:00
Yuki Yugui Sonoda 2aa3de12d4 Make RESTful operations return 404 Not Found when the target resource
does not exist.

In the original implementation, GET, DELETE and PUT operations on
non-existent resources used to return 500 but not 404.
2014-07-18 14:16:56 +09:00
Brendan Burns dceafbadab Add a caching minion registry. 2014-07-16 14:52:32 -07:00
Daniel Smith 3d63d733e3 Merge pull request #456 from brendandburns/health
Move health checking logic out to a utility. Add a minion registry that health checks.
2014-07-15 15:39:21 -07:00
Brendan Burns c5db874090 Addressed comments. 2014-07-15 15:16:36 -07:00
Kouhei Ueno bba23e28c2 Define EtcdErrorCode as constant and reuse EtcdError instances 2014-07-15 20:48:06 +09:00
Brendan Burns 62dfc74606 Move health checking logic out to a utility.
Add a minion registry that health checks.
2014-07-14 22:38:28 -07:00
Brendan Burns 3cc5ff15cf Update services to use the internal IP and port, now that its available. 2014-07-14 20:24:58 -07:00
Brendan Burns 0e798bcc3c Add link env vars. 2014-07-14 16:37:17 -07:00
Kouhei Ueno 12c9a73205 Add comments on registry/etcd_registry.go 2014-07-12 14:44:13 +09:00
brendandburns cdf75c57df Merge pull request #411 from nyaxt/lint_registry
Fixes go lint errors on pkg/registry/controller_registry.go
2014-07-11 21:41:58 -07:00
Kouhei Ueno f932891428 removes a comment on New and a typo fix 2014-07-12 13:21:52 +09:00
Tim Hockin 779cb84625 Merge pull request #397 from brendandburns/service
Add initial validation of Service objects
2014-07-11 14:43:47 -07:00
Brendan Burns b59dcbbb80 Fix tests. 2014-07-11 14:24:54 -07:00
Brendan Burns e9edfc754e Add initial validation of Service objects 2014-07-11 14:24:54 -07:00
Tim Hockin 1e05d1ac4e Merge pull request #394 from brendandburns/poddata
Try to grab live data if the cache has errors.
2014-07-11 11:55:54 -07:00
Kouhei Ueno bcbdbf6558 use New instead of Make and add comments to make golint happy 2014-07-11 22:46:22 +09:00
Kouhei Ueno e53658a3ed s/controllerId/controllerID/ to make golint happy. 2014-07-11 22:16:51 +09:00
Clayton Coleman 5896ac14da Ensure pod and manifest always have a UUID
* Fixes implication #2 in docs/identifiers.md
* Replication controller lets the apiserver set the pod ID
2014-07-10 18:03:48 -04:00
Brendan Burns 5a4621f451 Try to grab live data if the cache has errors. 2014-07-10 10:26:40 -07:00
Brendan Burns b4811abbd6 Address Clayton's comment. 2014-07-10 09:24:49 -07:00
Brendan Burns d5b7c4eb6d Fix integration tests with a check for nil
Add a unit test to validate behavior
2014-07-09 22:31:17 -07:00
Brendan Burns 7b11cbd622 Add PodIP to the info returned for a pod. 2014-07-09 22:13:07 -07:00
Daniel Smith a6144f656c Move etcd helpers to tools package so they can depend on api package. Add ResourceVersion, hook it up to etcd index to get atomic PUTs. 2014-07-02 15:42:05 -07:00
Daniel Smith 11d6451d2a Change kublet to serve podInfo instead of containerInfo. Plumb through system. 2014-07-01 16:41:10 -07:00
Daniel Smith 049bc6b6d4 Fix interface{} in api/types.go; plumb through system. 2014-07-01 16:41:09 -07:00
Brendan Burns 13d7a5959a Add sync behavior to the pod registry. Expand tests. 2014-07-01 11:31:21 -07:00
Clayton Coleman 15c96508a9 Use ID instead of Id (go style) everywhere
Fixes #278
2014-07-01 13:16:47 -04:00
brendandburns 65a62278b1 Merge pull request #286 from lavalamp/exampleEtcd
Separate scheduler from registry
2014-06-30 20:17:07 -07:00
Nan Deng f99a50ba69 use mutex instead of rwmutex 2014-06-30 11:13:42 -07:00
Nan Deng 3083a33e5f pkg/registry now passed race detector. 2014-06-30 11:04:57 -07:00
Daniel Smith 0760e9bc2c Fix up usage and tests, split into multiple files.
Doing this in multiple commits in an attempt to preserve the file movement history.
2014-06-29 12:35:43 -07:00
Daniel Smith 21e63cf75a Move scheduler to own package. 2014-06-29 12:30:49 -07:00
Daniel Smith 3d1e8a92d3 Move stringSet to util.StringSet 2014-06-28 11:46:51 -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
Daniel Smith 999ea50c2a Cleanup to use AtomicUpdate. 2014-06-27 15:14:57 -07:00
Daniel Smith 529870d121 Generic atomic update code 2014-06-27 15:14:57 -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
Brendan Burns a391b2ff03 Implement sync behavior for controllers. 2014-06-26 19:44:28 -07:00
Daniel Smith 001b07b292 Use net.JoinHostPort 2014-06-26 16:20:37 -07:00
Daniel Smith de06869d30 Merge pull request #244 from brendandburns/minion
Add a minion registry that is backed by a cloud provider.
2014-06-26 13:13:59 -07:00
Brendan Burns 93019b8563 Add a minion registry that is backed by a cloud provider. 2014-06-26 13:00:07 -07:00
Daniel Smith c9246dc130 Implement required sync changes everywhere.
Make requests sync by default, so that usage of them doesn't have to
change.
2014-06-26 10:33:21 -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 2cc038298b Make minion printing prettier; standardize on MinionList.Items like the other list types. 2014-06-24 15:29:17 -07:00
Daniel Smith c12a3773f5 Add minion types, address other comments 2014-06-23 13:27:52 -07:00
Daniel Smith 79ee5aa250 Implement minion registry. Minions now a first-class object. 2014-06-23 13:27:52 -07:00
Daniel Smith d460c01ade Add minion registry 2014-06-23 13:27:52 -07:00
brendandburns 49c25a4e28 Merge pull request #196 from lavalamp/marshal
Make api able to marshal its types correctly
2014-06-23 13:22:52 -07:00
Daniel Smith b850d36166 Fix boilerplate everywhere 2014-06-23 11:32:11 -07:00
Daniel Smith 41534c1cc5 Encode/decode working everywhere now. 2014-06-23 09:54:17 -07:00
Daniel Smith 2bcb44b6bd make Registry use Encode 2014-06-23 09:54:17 -07:00
Daniel Smith fb991fb84e Change type to []byte 2014-06-23 09:54:17 -07:00
Daniel Smith a718f6fdb8 minor fixes to scheduler_test 2014-06-22 11:17:23 -07:00
Daniel Smith 466be48c74 Merge pull request #166 from brendandburns/sync
Part #1 of synchronous requests: Add channels and a mechanism for waiting
2014-06-19 16:40:25 -07:00
Brendan Burns 2640de5c02 Part #1 of synchronous requests: Add channels and a mechanism for waiting on them 2014-06-19 16:13:13 -07:00
brendandburns e031c193a3 Merge pull request #164 from lavalamp/master
Standardize terminology on "selector"
2014-06-19 13:55:27 -07:00
Daniel Smith 5a1a793784 fix after rebase 2014-06-19 13:33:36 -07:00
Daniel Smith cfce408266 Rename ReplicasInSet to ReplicaSelector 2014-06-19 13:31:42 -07:00
Daniel Smith bc02b3c21a Rename [label] query to selector 2014-06-19 13:31:42 -07:00
Daniel Smith c4649d539b Separate labels and selector in services for clarity 2014-06-19 13:30:04 -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 4f549aae54 Add a PodCache that is responsible for caching pod information.
Not wired in yet.
2014-06-18 20:04:52 -07:00
Brendan Burns 420b2fdd57 Add support for populating host ip address. 2014-06-18 14:57:50 -07:00
Brendan Burns 57869958bc Add IP look up if the Cloud Provider is not null
Add Instance info to the Cloud Provider interface
2014-06-18 14:27:43 -07:00
Brendan Burns 31427d2d6f Add a fake cloud impl.
Update the service registry with unit tests.
2014-06-18 14:22:41 -07:00
Daniel Smith 7e464aa55c Test controller's synchronize method. Requires fake etcd client to be relocated. 2014-06-18 13:10:39 -07:00
Daniel Smith 65d6280936 Move etcd helper to util so it can be used elsewhere, too 2014-06-18 13:10:39 -07:00
Daniel Smith a24116c7bd Move controller to it's own package, it's not part of the registry. 2014-06-18 13:10:39 -07:00
Brendan Burns 77dd0afc26 Fix a bug in pod listing introduced in a recent refactor.
Add a test to catch a regression in the future.
2014-06-18 10:39:14 -07:00
Brendan Burns 5f66d33880 Add load balancing support to services. 2014-06-17 21:28:20 -07:00
brendandburns 1b1662d22d Merge pull request #145 from lavalamp/test_fix
Ensure that MockPodRegistry verifies the query it's passed.
2014-06-17 21:00:59 -07:00
Daniel Smith 246db91cb5 Merge pull request #135 from brendandburns/lb
Add load balancing support to services.
2014-06-17 18:40:42 -07:00
Daniel Smith 372e7b7727 Ensure that MockPodRegistry verifies the query it's passed. 2014-06-17 18:33:51 -07:00
brendandburns 1fd954b1d3 Merge pull request #138 from lavalamp/master
Normalize etcd_registry's storage & error handling
2014-06-17 17:34:42 -07:00
Justin Huff 1bef7fdd04 FirstFitScheduler was triggering a panic by passing nil as the query to
EtcdRegistry.ListPods. I think this was just missed during the recent
label refactor.
2014-06-17 15:48:37 -07:00
Daniel Smith 500ef4c46c Extract yet more redundancy 2014-06-17 13:53:47 -07:00
Daniel Smith 77556a5eb0 Extract more redundancy 2014-06-17 13:53:47 -07:00
Daniel Smith 25ab3b695e Move duplicated logic into single function. 2014-06-17 13:53:47 -07:00
Brendan Burns 2759b2367f Add load balancing support to services. 2014-06-17 12:37:39 -07:00
Daniel Smith c534d070e5 Rename LabelSet labels.Set 2014-06-16 22:05:12 -07:00
Daniel Smith 7d05ba4dc4 Implement new label system 2014-06-16 22:05:12 -07:00
Daniel Smith ad2ec27e91 Implement label queries for controller registry 2014-06-16 22:05:12 -07:00
Daniel Smith 50b9c34cf1 Fix error recovery. 2014-06-13 18:11:32 -07:00
Daniel Smith 2324dc1510 Merge pull request #102 from brendandburns/errors
Make all error strings lower case, for readability.
2014-06-13 15:56:40 -07:00
Brendan Burns 482a360f9e Make all error strings lower case, for readability. 2014-06-13 15:45:19 -07:00
Daniel Smith b95eef522b Add nice(r) error message on api server panic. Fix nil ptr derefs. 2014-06-13 14:59:36 -07:00
Daniel Smith 9cd9754693 Merge pull request #92 from brendandburns/container_info
Add status message population.
2014-06-13 10:49:32 -07:00
Brendan Burns c2c6055d70 Add status message population. 2014-06-13 09:42:04 -07:00
Daniel Smith f9a5fadf45 Merge pull request #86 from brendandburns/dot
Remove dot import syntax from registry package.
2014-06-12 20:58:13 -07:00
Brendan Burns 164160adef Address package level comments for readability. 2014-06-12 20:26:12 -07:00
Brendan Burns 0c3b9f2b69 fix dot import. 2014-06-12 20:14:41 -07:00
Joe Beda 353698558d gofmt -s -w cmd/ pkg/ 2014-06-12 18:34:47 -07:00
Brendan Burns b05bc22a62 Refactor the kubelet for testability.
Add unit tests.  Test coverage to 56.9%
2014-06-12 14:44:46 -07:00
Johan Euphrosine 4f6bed03ae gofmt -s pkg/ cmd/ 2014-06-12 14:16:19 -07:00
Brendan Burns 5563459178 Fix the first fit scheduler to randomize. 2014-06-11 17:11:48 -07:00
Brendan Burns c96b14aba0 Fixes for task->pod changes & a TODO 2014-06-08 23:29:04 -07:00
Brendan Burns fdcf273d50 Add pretty printing. 2014-06-08 23:07:29 -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
Brendan Burns 79b7976cbf Add pod registry. 2014-06-08 21:43:17 -07:00
Brendan Burns 66e2575f2b More Task -> Pod 2014-06-08 21:43:17 -07:00
Brendan Burns c8d493f532 Part one of the grand rename: Task -> Pod 2014-06-08 21:17:53 -07:00
Brendan Burns 0181953242 Add kind in all cases for list. 2014-06-07 21:57:36 -07:00
Brendan Burns ef7cce5dad Populate 'Kind' field in all API types being returned. 2014-06-07 21:07:20 -07:00
Joe Beda 2c4b3a562c First commit 2014-06-06 16:40:48 -07:00