Commit Graph

76 Commits (099c8fd36f6028dab2c2571496b80c9688b04e2d)

Author SHA1 Message Date
Daniel Smith 6121e61f99 Split api into api, api/common, api/validation & apitools 2014-09-02 10:40:52 -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
Daniel Smith a2b03ea93b Fix incorrect tag in MinionList 2014-08-28 20:06:17 -07:00
Daniel Smith 2a62d72140 Cleanup: remove deprecated fields the proper way 2014-08-26 17:28:36 -07:00
Clayton Coleman 0a841a49fd Naming of Reason constants is inconsistent
Changed ReasonType to StatusReason (to match the field) and
changed CauseReason to CauseType and renamed StatusCause.Reason to
Type.
2014-08-26 13:39:21 -04:00
Clayton Coleman d326ba2976 Add a Causes array to status details for validation errors
Uses the same constant values as api/errors for each nested
reason.
2014-08-26 13:30:55 -04:00
Dawn Chen 5a2365b323 Fix #926
Make HostPort a real option without being set to ContainerPort if absent.
2014-08-19 15:44:50 -07:00
Brendan Burns 0caae9c1d4 Add a in container exec based health check. 2014-08-18 12:00:11 -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
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 b7752a86d4 Add debugging info printing to etcd fake
And make tests pass again.
2014-08-11 13:09:24 -07:00
Tim Hockin c67c1edfb4 Use IntOrString for TCP health check ports
Clean up code to be more testable.  Add test cases for named and numeric
ports in TCP health checks.  Improve tests.
2014-08-10 23:44:42 -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
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 490bb28bf9 Add TCP socket based health checking. 2014-08-01 14:13:56 -07:00
Dawn Chen 21513b1e08 Merge pull request #691 from dchen1107/restart
Add RestartPolicy to Pod and PodTemplate
2014-07-30 15:32:20 -07:00
Dawn Chen 2740fb0abf Add RestartPolicy to Pod and PodTemplate 2014-07-30 15:31:27 -07:00
Daniel Smith 242c8cdaec Add custom conversion function system.
As an example, demonstrate how Env.Key's deprecation ought to work.
2014-07-30 14:18:23 -07:00
Daniel Smith 2396bdfa1b Incorporate new types into versioned api system.
* Made externalize/internalize generic to prevent boilerplate.
* Add fuzz testing.
* All objects pass fuzz tests now.
* This turned up some things we'll need to fix eventually. Left TODOs.
2014-07-29 15:46:57 -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
Brendan Burns bf5ae4bb9d Fork API types. 2014-07-24 21:47:08 -07:00
Daniel Smith 69c483f620 Add APIObject for generic inclusion of API objects.
Includes test and json/yaml getters and setters.
2014-07-18 22:35:08 -07:00
Daniel Smith eda30d4f20 Add watch mechanism to apiserver
Implemented via HTTP and websocket. A test is present but this isn't
yet wired into anything.

Eventual purpose of this is to allow a scheduler to watch for new pods.
Or allow replication controller to watch for new items it controlls.
Generally, it'll be good to turn everything possible into a push instead
of a poll.
2014-07-18 16:47:17 -07:00
Danny Jones bb2843498d API modified to use source; now supports EmptyDirectory
API is now modified to use a Source struct to handle multiple volumes.

Two volume types are supported now, HostDirectory and EmptyDirectory.
2014-07-17 15:25:50 -07:00
Danny Jones f84ff740f0 Adds initial volumes package; Supports host-dirs
Adds the framework for external volume mounts.

Currently supports bare host directory mounts.

Modifies the API to support host directory mounts from Volumes
instead of VolumeMounts.
2014-07-17 10:08:45 -07:00
Nan Deng 8c573ee727 Update to latest cAdvisor and use data structures directly from cAdvisor 2014-07-15 11:53:00 -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
Tim Hockin f532038281 Merge pull request #345 from smarterclayton/fix_ids
Ensure pod and manifest have a UUID in apiserver
2014-07-11 11:29:00 -07:00
Brendan Burns 6312ffebcf Address some comments from thockin@ 2014-07-11 10:14:45 -07: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
Tim Hockin 06ac51e6e5 Merge pull request #389 from brendandburns/podip
Add PodIP to the info returned for a pod.
2014-07-10 11:18:05 -07:00
Yuki Sonoda (Yugui) 6914681ed0 Fixes golint errors in pkg/api 2014-07-10 20:46:35 +09:00
Brendan Burns 7b11cbd622 Add PodIP to the info returned for a pod. 2014-07-09 22:13:07 -07:00
Tim Hockin b0b9606aea Merge pull request #365 from brendandburns/health
add http health checks.
2014-07-09 16:14:30 -07:00
Brendan Burns 41c6680943 add http health checks. 2014-07-09 12:01:43 -07:00
Brendan Burns 4b22f7a462 Add support for host ip binding to the API (and kubelet) 2014-07-09 11:13:38 -07:00
brendandburns 242627eaf0 Merge pull request #358 from thockin/valid2
Add validation of VolumeMounts
2014-07-08 21:58:32 -07:00
Tim Hockin ad88fa48a5 Add validation of Ports
Also do caseless compares for "enum" strings.
2014-07-08 15:22:44 -07:00
Tim Hockin dd6b209617 Add validation of VolumeMounts 2014-07-08 15:21:27 -07:00
Tim Hockin 8d6e832b8e Simplify DNS validation checks
Move DNS length checks to util/validation.go.  Make the max subdomain be 253,
which is what the RFC actually says.
2014-07-08 15:14:17 -07:00
Yuki Yugui Sonoda 780c441d19 Fixes golint errors in pkg/api 2014-07-08 16:08:58 +09: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 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
Tim Hockin 48074d4ae7 Fix wrong json name for Key field 2014-07-02 10:30:27 -07:00
Tim Hockin 839f2aed7b Add validation for Container.Env
This includes backwards compat with the older "key" field.
2014-07-01 22:16:46 -07:00
Daniel Smith 11d6451d2a Change kublet to serve podInfo instead of containerInfo. Plumb through system. 2014-07-01 16:41:10 -07:00