Commit Graph

471 Commits (6f312f145de627e635c43daacc1d16033ec250e6)

Author SHA1 Message Date
Eric Paris 7cbb52ce04 Use the pflag StringSlice instead of implementing it ourselves
Saves code and makes our code easier to read because we just use normal
[]string instead of custom type.
2015-08-06 19:16:13 -04:00
Wojciech Tyczynski 20e84d2eb1 Remove unused members 2015-08-06 09:00:42 +02:00
Mike Danese 17defc7383 run gofmt on everything we touched 2015-08-05 17:52:56 -07:00
Mike Danese 8e33cbfa28 rewrite go imports 2015-08-05 17:30:03 -07:00
Mike Danese a23ee556ad Merge pull request #11999 from brendandburns/attach2
Add support for attach to kubectl
2015-07-31 12:51:08 -07:00
Muhammed Uluyol 58a875ac2c Add (stopgap) support for an experimental API prefix. 2015-07-30 18:14:29 -07:00
Brendan Burns e8e756a719 Add pod/attach to the APIServer. 2015-07-30 10:55:53 -07:00
Wojciech Tyczynski 3cbbe72f9f Move etcd storage to pkg/storage/etcd 2015-07-30 15:42:06 +02:00
Wojciech Tyczynski 99d6b0e9f4 Rename storage interfaces 2015-07-30 10:34:57 +02:00
Wojciech Tyczynski d17985f1ad Move StorageInterface to pkg/storage. 2015-07-30 09:32:04 +02:00
Chi Vinh Le d91932f0b7 SSH tunnels fallback to LegacyHostIP 2015-07-28 10:10:48 +02:00
Wojciech Tyczynski 9d943df397 Private EtcdHelper 2015-07-27 09:20:13 +02:00
Tim Hockin 1c3233a1d4 Remove v1beta3 2015-07-23 17:21:27 -07:00
Vish Kannan 136d53466a Merge pull request #10892 from nikhiljindal/beta1
Removing references to pre v1beta3 apis in code
2015-07-23 17:05:43 -07:00
Wojciech Tyczynski ee92aa3897 Prepare for extracting EtcdHelper interface 2015-07-23 09:37:39 +02:00
Brendan Burns 25d3834b74 Add monitoring and healthz based on tunnel health. 2015-07-14 14:37:38 -07:00
nikhiljindal c465a50891 Stop exposing v1beta3 by default 2015-07-08 15:27:41 -07:00
nikhiljindal fc4da6844e removing references to pre v1beta3 apis 2015-07-08 13:51:43 -07:00
Eric Paris 7a29af4d2c Add Subject Alt Names to self signed apiserver certs
A cert from GCE shows:
- IP Address:23.236.49.122
- IP Address:10.0.0.1
- DNS:kubernetes,
- DNS:kubernetes.default
- DNS:kubernetes.default.svc
- DNS:kubernetes.default.svc.cluster.local
- DNS:e2e-test-zml-master

A similarly configured self signed cert shows:
- IP Address:23.236.49.122
- IP Address:10.0.0.1
- DNS:kubernetes
- DNS:kubernetes.default
- DNS:kubernetes.default.svc

So we are missing the fqdn kubernetes.default.svc.cluster.local. The
apiserver does not even know the fqdn! it's defined entirely by the
kubelet! We also do not have the cluster name certificate. This may be
--cluster-name= argument to the apiserver but will take a bit more
research.
2015-07-01 17:05:17 -04:00
CJ Cullen ea2d617944 Don't hold lock while opening new sshTunnels. 2015-06-29 16:16:25 -07:00
Brendan Burns f4e97be78e Switch to using the official etcd health check. 2015-06-24 10:18:39 -07:00
Wojciech Tyczynski 23d405ad86 Expose /resetMetrics handle in apiserver 2015-06-23 11:12:45 +02:00
Satnam Singh d8e5225144 Merge pull request #10069 from lavalamp/sshLockingFix
fix locking around ssh tunnels
2015-06-18 17:50:06 -07:00
Daniel Smith 4126622388 fix locking around ssh tunnels 2015-06-18 16:52:10 -07:00
Satnam Singh 28197e07d6 Merge pull request #9841 from smarterclayton/fix_apiserver_abstractions
Cleaning up apiserver method signatures
2015-06-18 15:36:52 -07:00
Clayton Coleman debd42a07d Cleaning up apiserver method signatures
A lot of the changes in apiserver could have been represented more
cleanly - this returns the signatures to their older behavior (and
unbreaks OpenShift).
2015-06-18 15:13:41 -04:00
Satnam Singh 798739f013 Merge pull request #10006 from brendandburns/ssh
Truncate SSH usernames to 32 chars.
2015-06-18 11:44:26 -07:00
Brendan Burns 075c075b9e Truncate SSH usernames to 32 chars. 2015-06-17 23:10:32 -07:00
CJ Cullen 15596ede41 Make AddSSHKeys a controller loop. Make sure master's always initializes m.tunnels. 2015-06-17 17:46:27 -07:00
CJ Cullen 48f672af92 Change SSHTunnelList to struct to make Open() semantics better. 2015-06-16 10:36:38 -07:00
CJ Cullen 66fb8ccb02 Add ssh tunnel-open metrics 2015-06-15 17:28:54 -07:00
CJ Cullen faa9313eea Fix several potential crashes in sshtunnel open/close code. 2015-06-15 14:38:37 -07:00
Justin Santa Barbara 6f3879e3bb Actually pass down ServiceNodePortRange so it is used
Also fix default range to match what we've documented (off-by-one)

Fix #9318
2015-06-08 18:03:42 -04:00
CJ Cullen 9ab329827a Change sshproxy to poll registry for nodes every 10 seconds (reduces window where closed tunnels from scaling down may exist). 2015-06-05 15:24:17 -07:00
CJ Cullen cb317604ab Some refactoring. Only selectively use ssh proxy.
Add NetworkName to gce.Config.
Add locking to uses of master.tunnels.
2015-06-05 14:55:16 -07:00
CJ Cullen 1ae8801387 Fix transport creation logic.
Refactor loadTunnels to allow one path for load, another for refresh.
Make SSHTunnelList.Close sleep for a minute before actually closing each tunnel.
2015-06-05 14:55:16 -07:00
Brendan Burns 7ea533d871 Add the SSHTunnel transport to the kubelet client. 2015-06-05 14:55:15 -07:00
CJ Cullen de9a5f43bc Specify sshUser, sshKeyfile in kube-apiserver manifest.
Trim space on ssh key so GCE doesn't treat it as 2 lines.
A couple other minor fixes.
2015-06-05 14:55:15 -07:00
Brendan Burns 5115fd5703 Add key generation. 2015-06-05 14:55:15 -07:00
Brendan Burns 30a89968a4 Initial proxy tunnelling. 2015-06-05 14:54:20 -07:00
Quinton Hoole 521446503a Merge pull request #9269 from caesarxuchao/make-v1-enabled-by-default
Make v1 enabled by default
2015-06-04 13:29:48 -07:00
Chao Xu ef61b031f5 make v1 enabled by default 2015-06-04 11:37:44 -07:00
Chao Xu c2e21fe5d7 use c.EtcdHelper in master.go 2015-06-04 09:39:05 -07:00
Daniel Smith 1690617ee6 remove ro service 2015-06-03 16:45:54 -07:00
Prashanth Balasubramanian 0162529ea5 Default minRequestTimeout to 1800s 2015-06-03 08:47:45 -07:00
Prashanth Balasubramanian 448867073d Pipe minRequestTimeout as an arg to the apiserver 2015-06-03 08:44:14 -07:00
CJ Cullen 934c553c04 Clarify description/usage of --advertise-address, Master.PublicAddress 2015-06-02 15:23:32 -07:00
CJ Cullen 085a48a70e Add an advertise-address flag. This allows the address that the apiserver binds
to (possibly 0.0.0.0) to be different than the address on which members of the cluster
can reach the apiserver (possibly not a local interface).
2015-06-02 14:33:15 -07:00
Kris f4e2c738f6 Delete deprecated API versions
pkg/service:

There were a couple of references here just as a reminder to change the
behavior of findPort. As of v1beta3, TargetPort was always defaulted, so
we could remove findDefaultPort and related tests.

pkg/apiserver:

The tests were using versioned API codecs for some of their encoding
tests. Necessary API types had to be written and registered with the
fake versioned codecs.

pkg/kubectl:

Some tests were converted to current versions where it made sense.
2015-05-29 17:17:35 -07:00
Tim Hockin 4318ca5a8b Rename 'portal IP' to 'cluster IP' most everywhere
This covers obvious transforms, but not --portal_net, $PORTAL_NET and
similar.
2015-05-28 16:10:44 -07:00
CJ Cullen 36d54b2094 Remove /Validate endpoint 2015-05-26 10:49:18 -07:00
Justin Santa Barbara 9255770068 Fix a few occurences of old language (e.g. visibility -> ServiceType) 2015-05-22 19:14:28 -04:00
Justin Santa Barbara 3bb2fe2425 Create port allocator, based on IP allocator mechanism
Including some refactoring of IP allocator
2015-05-22 19:14:28 -04:00
nikhiljindal fa9f864782 Adding a script to update etcd objects 2015-05-15 16:20:35 -07:00
Nikhil Jindal d75bd8bf2a Merge pull request #7101 from liggitt/service_account
ServiceAccounts
2015-05-12 10:23:41 -07:00
Derek Carr c1158fa696 Merge pull request #7969 from smarterclayton/rest_fixes
Fixes to apiserver for subresources and naming
2015-05-12 10:57:34 -04:00
Nikhil Jindal 3d31883829 Merge pull request #8083 from brendandburns/kubectl
Add a flag to disable legacy APIs
2015-05-11 17:35:28 -07:00
Clayton Coleman 0617951ead Public read only port is incorrect in master 2015-05-11 19:20:38 -04:00
Brendan Burns d8f48290e9 Add a flag to disable legacy APIs 2015-05-11 16:09:25 -07:00
Jordan Liggitt 53d55f4192 Add ServiceAccount API type, client 2015-05-11 17:18:05 -04:00
Clayton Coleman 84d1f19016 Subresources should be in their parent rest scope
A subresource like "Binding" does not necessarily have
to have a namespace.  The RESTScope of a subresource
should always be its parent resource.
2015-05-11 15:51:05 -04:00
Clayton Coleman 5bcb96dae1 Separate out the master's control loops
These are "Bootstrap Controllers" as distinct from
the controllers in the controller-manager binary - they
are necessary for the cluster to start running.
2015-05-08 16:04:03 -04:00
Clayton Coleman e200d5a317 Make PortalIP alloc HA
* Add an allocator which saves state in etcd
* Perform PortalIP allocation check on startup and periodically afterwards

Also expose methods in master for downstream components to handle IP allocation
/ master registration themselves.
2015-05-08 13:34:16 -04:00
Fabio Yeon 1709cf0dbb Remove node status from "componentstatuses" call.
The legacy "/validate" behavior remains unchanged.
2015-05-04 14:34:20 -07:00
Eric Paris 6b3a6e6b98 Make copyright ownership statement generic
Instead of saying "Google Inc." (which is not always correct) say "The
Kubernetes Authors", which is generic.
2015-05-01 17:49:56 -04:00
Paul Morie 8fa21ebd62 Merge pull request #7419 from liggitt/secrets_etcd
Convert Secret registry to use update/create strategy, allow filtering by Type
2015-04-29 09:59:22 -04:00
Brian Grant a4316aa638 Merge pull request #7454 from nikhiljindal/v1
Cloning v1beta3 as v1 and exposing it in the apiserver
2015-04-28 18:06:57 -07:00
nikhiljindal c4d7e19c8c Cloning v1beta3 as v1 and exposing it in the apiserver 2015-04-28 16:06:03 -07:00
Jordan Liggitt ac67fff1cf Convert Secret registry to use update/create strategy, allow filtering by Type 2015-04-28 15:00:20 -04:00
Robert Bailey 4304b1d24a Set the 'WWW-Authenticate' header on 401 responses when basic
auth is enabled. This is required for basic auth to work with
web browsers.
2015-04-28 11:00:05 -07:00
Daniel Smith 83093af8b0 Merge pull request #5707 from endocode/kbeecher/etcd_prefix
Adds ability to define a prefix for etcd paths
2015-04-27 13:37:43 -07:00
Karl Beecher a7623ca6cc Adds ability to define a prefix for etcd paths
The API server can be supplied (via a command line flag) with a custom
prefix that is prepended to etcd resources paths.

Refs: #3476
2015-04-24 12:12:39 +02:00
nikhiljindal 120904df5f Fixing serviceErrorHandler to use apiVersion specific codec 2015-04-23 14:32:05 -07:00
Clayton Coleman 10c2ace6bf Pod Templates 2015-04-22 12:54:25 -04:00
Fabio Yeon 951a125751 Add "componentstatus" to API for easier cluster health check. 2015-04-17 11:58:23 -07:00
Clayton Coleman b3f03b934d Merge pull request #6869 from csrwng/pod_connect
Pod proxy, portforward and exec subresources
2015-04-17 09:49:12 -04:00
nikhiljindal f9132dc572 Registering serviceErrorHandler with go-restful 2015-04-16 14:59:44 -07:00
Cesar Wong d672363387 Pod proxy, exec and portforward subresources
Makes it possible to access the following subresources:

/namespaces/<ns>/pods/<pod-name>[:port]/proxy
/namespaces/<ns>/pods/<pod-name>/exec?container=<container>&command=<cmd>
/namespaces/<ns>/pods/<pod-name>/portforward
2015-04-16 10:20:17 -04:00
Alex Robinson 2b14fc1d14 Remove the cloud provider field from the services REST handler and the master
now that load balancers are handled by the ServiceController.
2015-04-14 18:56:47 +00:00
Daniel Smith 629d94657e Merge pull request #6624 from gmarek/status_to_subresource
Update NodeStatus use subresources.
2015-04-09 16:00:15 -07:00
Wojciech Tyczynski 0e5b478b4d ListMinions support for selectors 2015-04-09 14:22:09 +02:00
gmarek ccc56d3c3c Update NodeStatus use subresources. 2015-04-09 14:07:40 +02:00
Tim Hockin f2c8decffe Clarify network-related flags in the master
Rename and rejigger flags to make it more obvious what is happening.  Change
the default listen from ChooseHostInterface() to 0.0.0.0.
2015-04-07 15:55:51 -07:00
Derek Carr 27c12d5160 Merge pull request #6473 from markturansky/yoko_pv_client
Added PVClaim status subresource
2015-04-07 11:39:58 -04:00
Cesar Wong 8df4758ee9 Pod log subresource
Adds a Log subresource to Pod storage. The Log subresource implements
rest.GetterWithOptions and produces a ResourceStreamer resource that
will stream the log output from the pod's host node.
2015-04-07 07:56:24 -04:00
Cesar Wong 58a1b308c1 Refactor storage return for pod etcd storage
Convert the return value of pods rest.NewStorage to a struct.
This will allow returning more storage objects for a pod (sub resources)
without awkwardly adding more return values.
2015-04-07 07:46:30 -04:00
markturansky 4e528a847a added PVClaim status subresource 2015-04-06 14:42:22 -04:00
markturansky 95bd170ca2 PV & PVC Client implementation 2015-04-06 08:46:43 -04:00
Robert Bailey f15e34a1bf Revert "Merge pull request #6309 from GoogleCloudPlatform/revert-6243-kubelet-ssl"
This reverts commit 96a0a0d618, reversing
changes made to 2af9b54147.
2015-04-02 10:44:37 -07:00
Robert Bailey 32a1c052dc Revert "Configure the kubelet to use HTTPS" 2015-04-01 13:59:31 -07:00
Robert Bailey 58bc792e68 Configure the master to connect to the kubelet using HTTPS. 2015-04-01 09:09:29 -07:00
Brian Grant af858c99e2 Merge pull request #6098 from nikhiljindal/enableInMaster
Enabling v1beta3 api version by default in master
2015-03-31 15:31:18 -07:00
nikhiljindal 478b7d5edf Repurposing enableV1beta3 to disableV1beta3 in master config to enable v1beta3 by default 2015-03-30 11:50:10 -07:00
Clayton Coleman 1618c39a46 Convert List query parameters via object conversion
Convert url.Values -> an object, with appropriate versioning. ListOptions
should also expose parameter names to swagger.
2015-03-27 15:03:57 -04:00
Brendan Burns 7c684e4331 Pipe through the ability to set the external hostname for swagger URLs. 2015-03-25 21:08:05 -07:00
Masahiro Sano c49af0b7cb port minion registry to generic etcd 2015-03-26 02:44:35 +09:00
Saad Ali 1f50bd226b Merge pull request #5854 from fgrzadkowski/delete_pod_cache
Delete pod_cache and rely on updating pod status by kublet.
2015-03-25 09:17:09 -07:00
Filip Grzadkowski 74da3b14b0 Delete pod_cache and rely on updating pod status by kublet. 2015-03-25 15:08:09 +01:00
Masahiro Sano 410e11c305 port endpoints to generic etcd 2015-03-25 22:15:19 +09:00
Clayton Coleman aee9bdd69a Merge pull request #5805 from liggitt/node_proxy
Improve ResourceLocation API, allow proxy to use authenticated transport
2015-03-24 13:01:54 -04:00
Clayton Coleman 97560c409f Merge pull request #5554 from derekwaynecarr/namespace_controller
Namespace Controller to support Namespace Termination
2015-03-24 12:59:00 -04:00
Jordan Liggitt a75b501821 Improve ResourceLocation API, allow proxy to use authenticated transport 2015-03-24 11:11:34 -04:00
derekwaynecarr 29c491ef2e Namespace.Spec.Finalizer support 2015-03-24 10:36:06 -04:00
Prashanth Balasubramanian ef6601646d Migrate replication controllers to generic etcd 2015-03-23 17:59:25 -07:00
Clayton Coleman 9bb797fe93 Rename NewREST -> NewStorage to align on terminology 2015-03-23 16:52:21 -04:00
Clayton Coleman d46087db50 Move REST* interfaces into pkg/api/rest
Dependency chain is now api -> api/rest -> apiserver.  Makes the
interfaces much cleaner to read, and cleans up some inconsistenties
that crept in along the way.
2015-03-23 16:52:21 -04:00
CJ Cullen 2e7356bca7 Merge pull request #5534 from bprashanth/generic_storage_interface
Add a GenericRESTStorage interface
2015-03-19 09:35:06 -07:00
Prashanth Balasubramanian 960e16c397 Embed etcdgeneric in RESTStorage for pods 2015-03-18 16:31:33 -07:00
Brian Grant 11f9733599 Merge pull request #5587 from nikhiljindal/enable3
Updating integration tests to test both API versions - v1beta1 and 3
2015-03-18 16:14:20 -07:00
nikhiljindal 7e36bbab3c Updating integration tests to test both API versions - v1beta1 and 3 2015-03-18 15:24:11 -07:00
Filip Grzadkowski 1a352b74ba Periodically update pod status from kubelet. 2015-03-18 12:11:39 +01:00
Filip Grzadkowski 18b728ff44 Revert "Periodically update pod status from kubelet." 2015-03-17 13:51:45 +01:00
Filip Grzadkowski 336525a27d Periodically update pod status from kubelet. 2015-03-16 23:03:03 +01:00
Tim Hockin 9eebaa8168 Merge pull request #4115 from sub-mod/master_changes
Use discovery heuristics in ChooseHostInterface method to fetch PublicAddress
2015-03-16 14:31:15 -07:00
Clayton Coleman bddef32193 Prepare EtcdHelper to extract more data from Node
In order to support graceful deletion, the resource object will
need access to the TTL value in etcd.  Also, in the future we
may want to get the creation index (distinct from modifiedindex)
and expose it to clients.  Change EtcdResourceVersioner to be
more type specific (objects vs lists) and provide a default
implementation that relies on the internal API convention.

Also, rename etcd_tools.go to etcd_helper.go and split a few
things up.
2015-03-16 15:33:50 -04:00
Subin M 1138045185 use ChooseHostInterface to get IP 2015-03-16 23:37:00 +05:30
Jeff Lowdermilk f3cb9949a7 Merge pull request #5484 from smarterclayton/dont_warn_on_existing
Don't log when auto-published services and namespace exist already
2015-03-16 09:54:19 -07:00
derekwaynecarr 2d13dfaf13 Improvements to namespace registry to align with pod model 2015-03-16 10:16:28 -04:00
Clayton Coleman 893a64f2ed Don't log when auto-published services and namespace exist already
Also, be a bit less chatty w.r.t. master setDefaults
2015-03-14 13:07:56 -04:00
derekwaynecarr 799e3fa9cc Eliminate ResourceQuotaUsage in favor of ResourceQuota status 2015-03-13 16:52:09 -04:00
Timothy St. Clair 7eebf674d4 Update to option enable profiling on the master daemon processes.
--profiling=true , default is false
2015-03-13 10:45:01 -05:00
Jerzy Szczepkowski ba9d02c0c7 Cleanup: removed BoundPodFactory.
Removed unused code: BoundPodFactory. Fixes #5384.
2015-03-13 10:44:25 +01:00
nikhiljindal 8c3f728aa6 Adding http:// prefix to the swagger WebServicesURL to prevent basePath validation errors 2015-03-11 16:52:45 -07:00
Clayton Coleman dfc19185f5 Add a subbindings resource as /pods/{name}/binding
Allows POST to create a binding as a child. Also refactors internal
and v1beta3 Binding to be more generic (so that other resources can
support Bindings).
2015-03-09 15:37:19 -04:00
Clayton Coleman 4b16a87096 Simplify api_installer and setup methods 2015-03-09 14:39:31 -04:00
Brian Grant fca9fd68c7 Merge pull request #4779 from smarterclayton/status_endpoints
Minimal status mutation change
2015-03-03 11:00:02 -08:00
Filip Grzadkowski 86b1c90097 Add flag to control probing pods statuses from kubelets. 2015-03-02 16:06:14 +01:00
Clayton Coleman 3d290089ae Minimal status mutation change
PUT /api/v1beta3/namespaces/default/pods/foo/status
    {
      "metadata": {...}, // allowed for valid values
      "spec": {}, // ignored
      "status": {...}, // allowed, except for Host
    }

Exposes the simplest possibly change. Needs a slight refactoring
to RESTUpdateStrategy to split merging which can be done in a
follow up.
2015-03-01 22:35:17 -05:00
Eric Tune e77745672c Merge pull request #4577 from satnam6502/cluster-name
Qualify the name of forwarding rules with INSTANCE_PREFIX
2015-02-26 13:17:49 -08:00
nikhiljindal b771a56435 Stop importing expvar 2015-02-26 10:47:58 -08:00
Satnam Singh 19b927ea57 Name a cluster and use it to make forwarding rules for GCE 2015-02-23 17:04:33 -08:00
Paul Morie fb001ada21 Secret API resource 2015-02-18 11:54:56 -05:00
Clayton Coleman 7a93af57c0 Remove pods from pkg/registry/etcd/etcd.go since they are in their own type
Altered the master initialization code
2015-02-16 10:09:27 -05:00
Clayton Coleman 247e467217 Collapse pod REST+Registry to a single object using generic/etcd 2015-02-16 10:09:27 -05:00
Jordan Liggitt 083ce268e0 Put user in context, map requests to context above resthandler layer 2015-02-12 20:58:04 -05:00
Eric Tune 5b4569697f Stop putting env vars into BoundPods.
They will still show up in etcd.  They never were available
through the API.

A subsequent PR(s) will rip out all BoundPods code.
Working in small increments.

This PR will cause users on lagging cloud providers
to not get env vars in their pods if they update to this code.
They have already been warned via email.

Removed unit tests of BasicBoundPodFactory.
There is adequate coverage in pkg/kubelet/kubelet_test.go.
2015-02-12 08:37:23 -08:00
derekwaynecarr 0bd0e12bbc Add support for Namespace as Kind
Add example for using namespaces
2015-02-10 09:50:50 -05:00
Tim Hockin 2707bcf10e Fix wrong port on kubernetes service
* Rename a field to make it more obvious.
* Fix some comments and other minor artifacts.

Verified by hitting the service on 443, and by hitting the master on 8080,
6443, and 7080.
2015-02-06 20:23:17 -08:00
deads2k 1c9216a45e clarify api request information 2015-02-04 13:36:01 -05:00
nikhiljindal 18609e1706 Moving /watch, /proxy and /redirect registration to go-restful 2015-02-03 15:47:48 -08:00
Deyuan Deng 31991f82c6 Remove ip cache, use node status cache instead. 2015-02-02 17:08:36 -05:00
Alex Robinson 9992abdfcf Merge pull request #3997 from smarterclayton/make_master_index_optional
Make master index optional when master is used in other contexts
2015-02-02 12:45:18 -08:00
Clayton Coleman 7f39a37eee Fix integration tests to not depend on setting pod.Status on create
Allow the master to have pod/node cache timeouts controlled via a config
flag for integration tests.

Move integration test to '127.0.0.1' so that it correctly returns a health
check, and enable health check testing on the integration test.
2015-02-02 14:46:23 -05:00
Alex Robinson 7868fe468e Merge pull request #3618 from saad-ali/fix2410
Make master service IP static (no longer randomly assigned)
2015-02-02 11:05:58 -08:00
derekwaynecarr 4c33e36a88 Plumb restmapper properly through apiserver and tests 2015-02-02 10:26:19 -05:00
Clayton Coleman 42175b433a Make master index optional when master is used in other contexts
OpenShift provides a default URL at the root that shows the UI. The
provided flag makes loading the index handler optional for now.
2015-01-30 22:19:55 -05:00
saadali e83fd7b8e7 Make master service IP static (no longer randomly assigned) 2015-01-30 16:07:19 -08:00
Satnam Singh 9a8d20a2fc Merge pull request #3969 from GoogleCloudPlatform/alex-mohr-patch-1
Update master.go's UpdateAllContainers to every 5 seconds instead of 30.
2015-01-30 07:58:43 -08:00
Deyuan Deng c793c4f0ab Sync node status from node controller to master. 2015-01-29 23:17:15 -05:00
Alex Mohr 3ac5b611b1 Update master.go
Make pod status update every 5 seconds instead of every 30 to mask the issue #3952.  I suspect (but haven't confirmed) that #3927 doesn't completely address the issue since it will still happily cache a Pending status for up to 30 seconds even though the pod may have transitioned to Running already.
2015-01-29 18:54:35 -08:00
Brendan Burns 3624b65f1c Transform the podCache into a write-through cache.
Don't always clear podInfo, instead occasionally garbage collect.
2015-01-28 22:15:23 -08:00
derekwaynecarr 829fa69527 Introduce a ResourceQuota object 2015-01-28 15:03:19 -05:00
derekwaynecarr 091cbe5fa2 Add a limit range resource 2015-01-27 16:41:27 -05:00
Brian Grant 3ae67f8153 Merge pull request #3548 from nikhiljindal/listHandlers
Updating handleIndex in master to list all valid paths.
2015-01-21 15:42:50 -08:00
nikhiljindal 51007cc798 Updating handleIndex in master to list all valid paths.
The list of valid paths is computed from http.ServeMux and
restful.WebService.
Adding a mux helper - wrapper over mux, that keeps track of the paths
handled by mux.
2015-01-21 13:40:01 -08:00
Andrew Seidl 6dee1d7fa4 Fix typos in user-facing strings 2015-01-18 01:32:34 -06:00
nikhiljindal 1ccae67b6e master.go cleanup: Deleting unused public methods and converting rest to private 2015-01-15 16:22:43 -08:00
Clayton Coleman 90c835af47 The API server setup logging is debug specific, bump above V(4)
Reduces some chatter in test suites where we are confident this code
already works.  Also removed any logging which is obvious from swagger.

Finally, rolls up InstallREST related errors all the way back to master,
which will glog.Fatalf (coding errors).
2015-01-15 14:25:58 -05:00
Paul Morie fd834ae84d Pods should see services only from their own ns 2015-01-14 17:06:36 -05:00
Dawn Chen 26a6628d8a Merge pull request #3374 from lavalamp/fix
Fix minion listing
2015-01-12 16:36:46 -08:00
Daniel Smith 3e75195ff3 make minion registry not intolerably slow 2015-01-12 16:20:52 -08:00
nikhiljindal 6ddfb10728 Setting WebServicesUrl in swagger config, so that the api docs contain correct basepath 2015-01-12 13:48:39 -08:00
nikhiljindal 7e909ed743 Changes to improve swagger ui.
- Separating out index, version and api handlers into independent web
  services. Moved the index handler to /welcome, version handler to
  /version and the api handler to /api,
2015-01-09 10:56:24 -08:00
Clayton Coleman 7fd887df61 Enable v1beta3 API via --runtime_config=api/v1beta3 flag
This exposes the proper v1beta3 API endpoint when the user specifies
the --runtime_config=api/v1beta3 argument to the apiserver. v1beta3
is still considered experimental and subject to change.

--runtime_config is a map of string keys and values, that can be
specified by providing

    --runtime_config=a=b,b=c,d,e

Only the key must be specified, the value can be omitted.

Enables v1beta3 in hack/local-up-cluster.sh and hack/test-cmd.sh
2015-01-08 13:01:24 -05:00
derekwaynecarr a56087cdf8 Remove client from attributes, remove admission control interface, fix-up error codes 2015-01-07 14:42:31 -05:00
derekwaynecarr 520ae3ef27 Implement basic admission control framework 2015-01-07 14:42:31 -05:00
nikhiljindal 1db30aeb51 Moving swagger-ui files from www/swagger-ui to third-party/swagger-ui
and adding LICENSE and README files
2015-01-05 16:27:33 -08:00
Daniel Smith dc5383dcf8 add ttl as param to ip cache 2014-12-22 14:14:03 -08:00
Daniel Smith 545d87d554 Move clock to util 2014-12-22 14:14:03 -08:00
Daniel Smith 5b8e91595a Make pod listing costant-time
* move ip cache out of registry/pod
* combine, rationalize, and move pod status logic
* Fix unit and integration tests
2014-12-22 14:14:03 -08:00
Brendan Burns ba25ae49d7 Merge pull request #3070 from nikhiljindal/setApiVersion
Adding skeleton swagger UI
2014-12-19 17:16:04 -08:00
nikhiljindal bf96e95899 ran gofmt 2014-12-19 16:16:54 -08:00
nikhiljindal f12f5ed34b 1. Adding swagger-ui/dist files.
2. Updating datafile.go to include it.
3. Updating master,go to use it.
2014-12-19 14:56:20 -08:00
Daniel Smith a63bd1bdfa Remove an unneeded trip over the network when getting/listing pods. 2014-12-18 17:47:59 -08:00
Deyuan Deng 3f84924095 Use constant for port number 2014-12-16 11:45:27 +08:00
Clayton Coleman cd4135666e Make Swagger API support optional, so that consumers can define their own
OpenShift would like to also enable swagger, but we need to register our
services as swagger services prior to the SwaggerAPI being started. I've
added a bool (default false) to master.Config to enable swagger, and split
the method in master out so that a downstream consumer can call it.
2014-12-15 15:29:55 -05:00
Eric Tune 029a9b6400 Remove whoami handler.
This was a temporary thing.  Not aware of anyone using it.
2014-12-11 21:31:06 -08:00
Brendan Burns 59b5546b28 Turn on node level validation, and make the validation set dynamic. 2014-12-10 22:02:45 -08:00
Clayton Coleman d1d7505272 Rename client Minions->Nodes, select the correct path for v1beta3
Replaces the client public interface but leaves old references to "minions"
for a later refactor.  Selects the path "nodes" for v1beta3 and "minions"
for older versions.
2014-12-10 12:08:19 -05:00
Clayton Coleman 9030759df8 Add 'nodes' everywhere 'minions' can be used in api / cli 2014-12-10 12:08:18 -05:00
Clayton Coleman 156000ef6d Move the internal minion representation to match v1beta3
Moves to 'Spec' and 'Status' internally and removes duplicate
fields.  Moves Capacity into Spec and drops use of NodeResources
2014-11-20 20:53:08 -05:00
Jordan Liggitt c895331277 Make master take authenticator.Request interface instead of tokenfile 2014-11-19 15:07:51 -05:00
Brian Grant 7583e1a643 Automatic API generation by adopting go-restful 2014-11-14 16:49:19 +00:00
Clayton Coleman 21a6e96418 Merge pull request #2126 from brendandburns/validatez
Add etcd to the list of services to validate.
2014-11-10 14:53:41 -05:00
Eric Tune c068b56919 Return InsecureHandler from master.
Subsequent changes will make use of both
m.Handler and m.InsecureHandler for different ports.
2014-11-06 09:11:31 -08:00
Brendan Burns d7dc20fd6a Add etcd to the list of services to validate.
Also add minions.
2014-11-05 21:22:01 -08:00
Daniel Smith c163535563 Allow (delayed) apiserver starting when network interface isn't available immediately. 2014-11-05 12:07:33 -08:00
Eric Tune 1668c6f107 Authorization based on namespace, kind, readonly.
Also, pass Authorizer into master.Config.
2014-11-03 17:45:15 -08:00
Eric Tune 3045035512 Get user from request and put in authz attribs.
Added integration tests for user-based auth.
2014-11-03 16:38:56 -08:00
Eric Tune 795bc7f976 Require a KubeletClient in master.New().
Without this, tests which create a master
will panic with a nil pointer when the periodic
podCache update runs.

Deleted unused FakePodInfoGetter.
Added FakeKubeletClient.
Passed to master.New.
Required a KubeletClient in master.New.
2014-11-03 16:09:41 -08:00
Eric Tune 55c2d6bbbb Add basic Authorization.
Added basic interface for authorizer implementations.
Added default "authorize everything" and "authorize nothing
implementations.
Added authorization check immediately after authentication check.
Added an integration test of authorization at the HTTP level of
abstraction.
2014-10-31 12:04:33 -07:00
Deyuan Deng 019b7fc74c Separate minion controller from master. 2014-10-30 20:24:15 -04:00
Eric Tune 9713b58caa Allocate mux in master.New()
Callsites no longer allocate a mux.
Master now exposes method to install handlers
which use the master's auth code.  Not used
but forks (openshift) are expected to use these
methods.  These methods will later be a point
for additional plug-in functionality.
Integration tests now use the master-provided
handler which has auth, rather than using the mux,
which didn't.  Fix TestWhoAmI now that /_whoami
sits behind auth.
2014-10-29 14:31:07 -07:00
Daniel Smith 070c6c0440 Fix missing portalNets in tests once and for all by adding a default. 2014-10-29 12:27:35 -07:00
Daniel Smith a036ebc1be Switch models. No master election. 2014-10-29 11:38:45 -07:00
Daniel Smith 7146ec9d49 Implement kubernetes & kubernetes-ro services 2014-10-29 11:29:28 -07:00
Daniel Smith 94e736e286 Merge pull request #2009 from smarterclayton/unify_meta
Unify Accessor for ObjectMeta/TypeMeta/ListMeta
2014-10-29 09:58:46 -07:00
Daniel Smith dca7363459 Serve API version list, test with an integration test. 2014-10-28 17:35:56 -07:00
Eric Tune f7ebc7d0d5 Added /_whoami and integration test for auth(z|n)
Added new endpoint /_whoami for debugging authentication.
Added integration test which checks that a user is authenticated
using token authentication.
Rearranged initialization of authenticator to support preceeding.
2014-10-28 09:33:45 -07:00
Clayton Coleman 66ace4c270 Begin to unify ResourceVersioner and SelfLinker
Create a new MetadataAccessor interface that combines both
and use it where previously latest.ResourceVersioner and SelfLinker
were being used.

Adds Namespace to the get/set interface. Adds TODO about future
fast path for metadata (as per thockin's comment)
2014-10-27 16:00:55 -04:00
Eric Tune 245585f364 Move handler setup: cmd/apiserver -> pkg/master
Moved CORS handler setup and authorizer setup.
Will allow for integration test of authorization.
2014-10-27 11:43:12 -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 580cb5ea4f Rework client.Interface 2014-10-24 11:47:30 -04:00
Clayton Coleman 7550c146dc Replace struct initializers for TypeMeta with ObjectMeta 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
Daniel Smith 082a9d8af9 fix typo 2014-10-20 10:28:38 -07:00
Clayton Coleman 6ae611aedd Write BoundPods to etcd instead of ContainerManifestList
Rename ManifestFactory -> BoundPodFactory and change the general structure
of the call to focus on BoundPod.
2014-10-16 19:29:08 -04:00
Tim Hockin e907011111 Core support for ip-per-service 2014-10-16 08:36:47 -07:00
Deyuan Deng 2bd88d4544 Remove OnceAndForever util, create a Run() method on MinionController. 2014-10-14 18:47:42 -04:00
Deyuan Deng ec46e94dc2 Create MinionController to sync minions from cloudprovider (pkg cloudprovider/controller). 2014-10-14 18:45:25 -04:00
Daniel Smith 15680731f7 Add event endpoint to apiserver 2014-10-10 15:47:34 -07:00
Daniel Smith 5d24820dd5 Merge pull request #1464 from hmrm/add-etcd-config
Allow etcd config file to be passed to apiserver, kubelet, and proxy
2014-10-08 16:29:46 -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
Haney Maxwell 4d87159eda Allow etcd config file to be passed to apiserver, kubelet, and proxy 2014-10-07 14:25:54 -07:00
Deyuan Deng 4de810efb4 Rebase to master, change JSONBase to TypeMeta. 2014-10-07 16:22:36 -04:00
Deyuan Deng c3d9197a4b Rename InsertMinion to CreateMinion. 2014-10-07 16:22:35 -04:00
Deyuan Deng 4a35325f29 Use etcd as backend for minion registry. 2014-10-07 16:22:35 -04: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
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 1551b48347 Add a resource fit scheduler predicate. Set sensible defaults. 2014-10-03 15:09:59 -07:00
Daniel Smith 37e505601e add self linking to apiserver 2014-09-26 15:08:02 -07:00
Daniel Smith b972f72248 convert multiple return values into a struct, add SelfLinker 2014-09-26 14:52:16 -07:00
Brendan Burns 253bce42fe Extract the minion registry from the etcd implementation into the pod registry where it belongs. 2014-09-23 15:42:59 -07: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 ca5355908f Expose v1beta2 API group 2014-09-18 23:24:05 -04:00
Brendan Burns 99586b4da4 Fix a problem where if a minion went missing, we still thought the pod was running.
Also convert some tests to table driven.
2014-09-17 18:16:52 -07: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
Daniel Smith 759c3f9033 Rename all XStorage types to REST for clarity 2014-09-08 15:19:13 -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 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) 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 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
Brian Waldon 816c4a3c76 Remove unnecessary parameter from NewRegistry 2014-08-28 16:52:45 -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
Daniel Smith 98ef76c164 Remove references to scheduler from pod storage. 2014-08-25 11:59:00 -07:00
Tim Hockin edff541524 Treat async loops the same.
In the name of consistency, treat the PodCache loop the same as the
EndpointController.
2014-08-20 20:17:16 -07:00
Tim Hockin caadf10197 clarity: rename minionRegistryMaker to makeMinionRegistry 2014-08-20 20:17:16 -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
Daniel Smith 26e2256178 Remove unused and not completely correct code 2014-08-15 18:20:37 -07: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
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
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
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
Kouhei Ueno c8e1c6a02f dedupe apiserver.New 2014-08-05 05:11:25 +09:00
Kouhei Ueno afa686ccc8 dedupe registry.MakeEndpointController init 2014-08-05 05:09:49 +09: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