Commit Graph

191 Commits

Author SHA1 Message Date
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