Commit Graph

251 Commits (f061f74f563010990c32bd9aa958200d78636b04)

Author SHA1 Message Date
Abhishek Gupta b0c23c1046 Headless Services: Adding option to specify None for PortalIP 2015-03-20 12:10:03 -07:00
Brendan Burns cf68593fc2 Merge pull request #5228 from justinsb/aws_lb_string
Change cloud provider CreateTCPLoadBalancer to return endpoint as string
2015-03-13 12:16:26 -07:00
Salvatore Dario Minonne 925fa6baf8 Adding fields selector 2015-03-10 22:13:10 +01:00
Justin Santa Barbara 5d36d3cdbe Change cloud provider CreateTCPLoadBalancer to return endpoint as string
Some load balancers (particularly AWS ELB) define the public endpoint
as a hostname (instead of using IP addresses).

This is a partial fix for #5224; there will also be some proxy work.
2015-03-09 20:35:13 -07:00
Brendan Burns 5b6a78fc77 Place external load balancers in a namespace, and add a test to validate the behavior. 2015-03-06 17:16:27 +01:00
Mike Danese 5cbf89c060 plumb through changes on ReplicationController and Service 2015-03-04 10:38:42 -08:00
Lénaïc Huard cd719d97df Fix `kubernetes` and `kubernetes-ro` services creation
If `kube-apiserver` is started before `etcd` is reachable, `kube-apiserver`
fails to create those services.
However, in the `Create` function, an IP has already been reserved for them.
When `etcd` comes back, the `Create` function fails because it considers that
the IP is already used.

If the service couldn't be created, the reserved IP should be released.
2015-02-27 18:01:03 +01:00
Satnam Singh 19b927ea57 Name a cluster and use it to make forwarding rules for GCE 2015-02-23 17:04:33 -08:00
Daniel Smith 650f6cb826 Revert "Multi-port Endpoints" 2015-02-23 13:53:21 -08:00
Tim Hockin 160f288832 Implement multi-port Endpoints
This is a part of multi-port services.
2015-02-22 09:35:12 -08:00
Tim Hockin ae0062d001 Part 2 of plural ports: make endpoints a struct
Includes conversions for v1b[12] and tests and fixups for call sites.
2015-02-18 19:54:15 -08:00
Tim Hockin 876b0c4619 Merge pull request #4484 from jszczepkowski/load-balancer
Update for external load balancer.
2015-02-17 17:04:08 -08:00
Paul Weil 8d7d03a2f8 service NewList should return ServiceList 2015-02-17 16:30:29 -05:00
Jerzy Szczepkowski 397c1fc69a Update for external load balancer.
Implementation of updating external load balancer on service update. This partially fixes #4411.
2015-02-17 21:49:36 +01:00
Yu-Ju Hong 9e72ec023b Remove obsolete defaulting in service/rest.go 2015-02-17 10:34:50 -08:00
Clayton Coleman 26f08b7807 RESTStorage should not need to know about async behavior
Also make sure all POST operations return 201 by default.
Removes the remainder of the asych logic in RESTStorage and
leaves it up to the API server to expose that behavior.
2015-02-11 16:26:08 -05:00
Brian Grant 50b1034b6c Merge pull request #4122 from pmorie/comment
Clarify commenting in endpoints_controller
2015-02-05 07:09:56 -08:00
Paul Morie 3229a634a0 Clarify commenting in endpoints_controller 2015-02-04 15:14:05 -05:00
Brian Grant 3f28badae3 Merge pull request #3854 from yujuhong/defaults
Migrate API defaulting to a centralized location
2015-02-04 11:41:23 -08:00
Tim Hockin 411666decb Get rid of ServiceSpec.ProxyPort
As far as I know, nobody uses it.  It was replaced by PublicIPs.  If I were
being very polite I would leave it in internal, but since I am 99.99% sure
nobody uses it, I am cutting it.  Let's argue about it.
2015-02-03 22:45:00 -08:00
Yu-Ju Hong 4a72addaeb Factor out API defaulting from validation logic
Currently, the validation logic validates fields in an object and supply default
values wherever applies. This change factors out defaulting to a set of
defaulting callback functions for decoding (see #1502 for more discussion).

 * This change is based on pull request 2587.

 * Most defaulting has been migrated to defaults.go where the defaulting
   functions are added.

 * validation_test.go and converter_test.go have been adapted to not testing the
   default values.

 * Fixed all tests with that create invalid objects with the absence of
   defaulting logic.
2015-02-03 00:55:42 -08:00
Clayton Coleman 1588970ec4 Turn 409 into 500 Try Again Later when using generateName
If a client says they want the name to be generated, a 409 is
not appropriate (since they didn't specify a name). Instead, we
should return the next most appropriate error, which is a 5xx
error indicating the request failed but the client *should* try
again.  Since there is no 5xx error that exactly fits this purpose,
use 500 with StatusReasonTryAgainLater set.

This commit does not implement client retry on TryAgainLater, but
clients should retry up to a certain number of times.
2015-02-02 14:46:25 -05:00
Clayton Coleman 0a87f0332b Add name generation to services 2015-02-02 14:46:25 -05:00
saadali e83fd7b8e7 Make master service IP static (no longer randomly assigned) 2015-01-30 16:07:19 -08:00
Clayton Coleman a0356bca96 Unify validation logic for create and update paths
Ensure ObjectMeta is consistently validated on both create and update

Make PortalIP uncleareable
2015-01-28 13:10:37 -05:00
Paul Morie fd834ae84d Pods should see services only from their own ns 2015-01-14 17:06:36 -05:00
Clayton Coleman 22c99c98e2 Split RESTStorage into separate interfaces
Omit unimplemented interfaces from Swagger
2015-01-12 12:19:45 -05:00
Tim Hockin ca27fb259c Don't use pointers for session affinity 2014-12-29 14:43:17 -08:00
Mike Foley c4e94efe16 Sticky Session Implementation
- Added process to cleanup stale session affinity records
- Automatically set cloud provided load balancer for sticky session if the service requires it - Note, this only works on GCE right now.
- Changed sessionAffinityMap a map to pointers instead of structs to improve performance
- Commented out cookie and protocol from sessionAffinityDetail to avoid confusion as it is not yet implemented.
2014-12-18 18:46:10 -05:00
Brendan Burns bac915a066 Return an error if a user attempts to create an externalized UDP balancer. 2014-12-10 20:08:03 -08:00
Clayton Coleman 19379b5a38 Internal rename api.Minion -> api.Node 2014-12-10 12:08:18 -05:00
Clayton Coleman 2c27f7d332 Allow an empty service 2014-12-09 12:48:53 -05:00
Tim Hockin 0c03f6e784 Enable public IPs even in not createExternal...
This allows the proxier to portal Public IPs even if the
createExternalLoadBalancer flag is not set.

This also fixes what appears to be a bug in the createExternalLoadBalancer path
wherein multiple PublicIPs would get truncated.
2014-11-26 10:54:28 -08:00
Tim Hockin ff8c5f9415 Add a Detail field to Validation Error 2014-11-24 17:28:42 -08:00
Eric Tune f122fc94bf Move service enviroment vars code.
GetServiceEnvironmentVariables (originally in  pkg/registry/service/rest.go)
is split into two parts: one that lists services, and one that turns
a ServiceList into environment vars.  This will allow a subsequent PR
to add a call to the latter function with an existing ServiceList.
The former part is moved into pkg/registry/pod/bound_pod_factory.go.
The latter part is put in a new package, pkg/kubelet/envvars/envvars.go.
The new package is under kubelet because the container enviroment is more
associated with kubelet than with registry.
Test code moved too.
2014-11-23 05:50:34 -08:00
Tim Hockin ea960711ff Clean up error logs.
Use %v for errors, tidy some messages, make error messages start lowe-case
(as per go guidelines).  Just accumulated nits.
2014-11-21 09:45:26 +08:00
Brendan Burns 88fa703b8e Merge pull request #2417 from thockin/ipalloc
Cleanups of ipv6 changes.
2014-11-17 09:54:16 -08:00
Brendan Burns 271ed1c21e Merge pull request #2394 from ddysher/random-fix
Exclude service itself when checking conflict.
2014-11-17 09:47:58 -08:00
Tim Hockin 9c218f0a19 Cleanups of ipv6 changes.
I was late re-reviewing and some comments did not get resolved.
2014-11-17 09:33:14 -08:00
Deyuan Deng 241f3d702b Exclude service itself when checking conflict. 2014-11-15 10:40:40 -05:00
Brendan Burns 4a8a2b5a9f Address comments. 2014-11-14 17:23:13 -08:00
Brendan Burns 2aa52d043b Add external services v2 support. 2014-11-14 11:32:54 -08:00
Brendan Burns c2485a4056 Merge pull request #2147 from justinsb/ipv6
Initial ipv6 / iptables work
2014-11-14 10:34:37 -08:00
derekwaynecarr 15701ff403 Set uid during object create 2014-11-13 15:25:49 -05:00
Justin SB b19170f335 gofmt 2014-11-07 06:34:18 -08:00
Justin SB 04313ff173 Create ip_allocator that copes with IPv6
It uses a set (via a map) of allocated IPs
2014-11-06 21:26:26 -08:00
bgrant0607 fc0dab630c Merge pull request #2086 from markturansky/v1beta3_refactor
Refactor internal API for Services to match v1beta3
2014-11-04 21:48:02 -08:00
markturansky bd7643c033 refactor services to v1beta3 2014-11-04 14:23:53 -05:00
Brendan Burns f556f2f82f Add some validation for externalized service ports. 2014-11-03 13:36:34 -08:00
Daniel Smith 7146ec9d49 Implement kubernetes & kubernetes-ro services 2014-10-29 11:29:28 -07:00
Daniel Smith 66b43a5e87 fix build 2014-10-28 12:44:24 -07:00
Clayton Coleman 5cb3c10289 Merge pull request #1782 from smarterclayton/allow_put_to_set_create
Allow clients to determine the difference between create or update on PUT
2014-10-28 13:40:41 -04:00
Tim Hockin bb5ca0f91b Respect a requested PortalIP if possible 2014-10-27 14:03:52 -07:00
Clayton Coleman d5ee171410 Allow clients to determine the difference between create or update on PUT
PUT allows an object to be created (http 201).  This allows REST code to
indicate an object has been created and clients to react to it.

APIServer now deals with <-chan RESTResult instead of <-chan runtime.Object,
allowing more data to be passed through.
2014-10-24 14:41:15 -04:00
Clayton Coleman 644eb70085 Refactor tests to split ObjectMeta from TypeMeta 2014-10-24 11:22:21 -04:00
Clayton Coleman 09800643e2 Change validation now that namespace is on ObjectMeta 2014-10-24 11:22:20 -04:00
Clayton Coleman bb77a5d15f Rename ID -> Name 2014-10-22 15:00:26 -04:00
deads2k 34b5861b60 add unit tests for rejection of conflicting namespaces 2014-10-21 15:57:02 -04:00
Daniel Smith f748e2d2c5 Implement redirection & proxying for minions 2014-10-20 11:28:12 -07:00
Tim Hockin 8d37319982 Fix borrow and carry in IPAllocator 2014-10-17 17:13:22 -07:00
Tim Hockin e907011111 Core support for ip-per-service 2014-10-16 08:36:47 -07:00
Eric Tune 800284164a Fix format specifiers in Printf-type functions. 2014-10-09 17:06:32 -07: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
Deyuan Deng 4a35325f29 Use etcd as backend for minion registry. 2014-10-07 16:22:35 -04: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 8131a5ca6a Add an IPAllocator type 2014-10-06 09:02:04 -07:00
Brendan Burns 1551b48347 Add a resource fit scheduler predicate. Set sensible defaults. 2014-10-03 15:09:59 -07:00
derekwaynecarr 6625e58a20 Updates to review comments 2014-10-01 10:57:50 -04:00
derekwaynecarr 0312d80ffa Update test cases to use default context 2014-10-01 10:57:50 -04:00
derekwaynecarr e4ec49ee6b Require namespace on controller, pod, service objects 2014-10-01 10:57:50 -04:00
Tim Hockin 04cdf286a4 Make and use api.Protocol type 2014-09-27 20:31:37 -07:00
derekwaynecarr b7fcc7d3ec Add ctx to registry test cases 2014-09-26 15:19:22 -04:00
derekwaynecarr 09365fed8d Add ctx to registry interfaces 2014-09-26 15:18:42 -04:00
derekwaynecarr ee19ba186d Update to use api.Context 2014-09-26 11:50:34 -04:00
derekwaynecarr be85ad7a3d Add context object in test cases flows 2014-09-26 11:50:34 -04:00
derekwaynecarr 3e685674e7 Add context object to interfaces 2014-09-26 11:50:34 -04:00
Tim Hockin b2472d8bec Fix docker-links-style env vars for services
This includes 3 changes:

1) Use the Service.Protocol field, rather than hardcoding TCP.
2) Use Service.Port rather than ContainerPort - ContainerPort can be a string
   and has absolutely no meaning to consumers.
3) Beef up tests for these env vars.
2014-09-24 12:29:06 -07:00
Tim Hockin 089c5602fd Add per-service env vars for *_SERVICE_HOST
As a replacement of a single SERVICE_HOST variable, offer a FOO_SERVICE_HOST
variable.  This will help ease the transition to ip-per-service, where there
is no longer a single service host.

# *** ERROR: *** Some files are missing the required boilerplate
# header from hooks/boilerplate.txt:
#   examples/guestbook/redis-slave/run.sh
#
# Your commit will be aborted unless you fix these.
#   COMMIT_BLOCKED_ON_BOILERPLATE
2014-09-24 09:07:21 -07:00
Daniel Smith 4e9cf2ccb4 Add field selector to List, implement for pods. 2014-09-16 16:17:16 -07:00
Daniel Smith 759c3f9033 Rename all XStorage types to REST for clarity 2014-09-08 15:19:13 -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 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
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
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
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 52923a1348 Return validation errors from storage create/update 2014-08-26 13:30:55 -04: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
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
Tim Hockin 95e0be9a63 Move FakeCloud into its own pkg 2014-08-20 20:16:41 -07: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
Brendan Burns 3eb044b495 Add a better test for service environment variables
Fix bugs.
2014-08-18 16:53:59 -07:00
Daniel Smith 26e2256178 Remove unused and not completely correct code 2014-08-15 18:20:37 -07: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