Commit Graph

845 Commits (dddad888b5e01c9f397484477cef9a391ea4b681)

Author SHA1 Message Date
brendandburns 30b6ab5278 Merge pull request #728 from smarterclayton/improve_apiserver_tests
Expand apiserver test cases
2014-08-01 09:32:19 -07:00
Clayton Coleman 8b2b325103 Merge pull request #730 from lavalamp/rename
Begin systemizing files in pkg/registry
2014-08-01 10:57:31 -04:00
Yuki Yugui Sonoda 331fd0d986 Extract "pkg/version".PrintAndExitIfRequested() to its own package
because it causes a runtime panic if a binary which has its own implementation
of "-version" flag tries to reuse a package library which indirectly depend on
"pkg/version".

e.g. If such an user-defined binary tires to link "pkg/api" or "pkg/client",
the binary fails with a runtime panic "flag redefined: version".
2014-08-01 15:05:27 +09:00
Meir Fischer 9076e78654 change strValues's type to util.StringSet; rename Comparator to Operator; small syntax fix 2014-07-31 23:56:37 -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
Clayton Coleman af4d57b39a Expand apiserver tests 2014-07-31 18:59:54 -04:00
Clayton Coleman 8986a0fc4b Remove debugging statement 2014-07-31 18:52:15 -04: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
Daniel Smith aa454fea93 Merge pull request #711 from smarterclayton/more_info_about_format_conversion_error
More verbose error on missing field
2014-07-31 14:34:09 -07:00
Clayton Coleman e1b0000404 Merge pull request #717 from nyaxt/atomicupdate_test
Add test for AtomicUpdate
2014-07-31 16:44:24 -04:00
Clayton Coleman 7ce23e43e7 More verbose error on missing field 2014-07-31 14:38:38 -04:00
Clayton Coleman 28d42a79a4 Merge pull request #719 from csrwng/list_replication_controllers
Add a method to list replication controllers
2014-07-31 14:34:58 -04:00
csrwng 19ddfe72df Fixed FakeKubeClient in kubecfg_test 2014-07-31 13:59:58 -04:00
Kouhei Ueno d4a5ba863d Add test for AtomicUpdate 2014-08-01 02:35:38 +09:00
Kouhei Ueno 648b80e5d7 Implement FakeEtcdClient.ExpectNotFoundGet 2014-08-01 02:35:38 +09:00
Kouhei Ueno a3771c9042 AtomicUpdate should use api.Encode 2014-08-01 02:35:38 +09:00
Kouhei Ueno 6dd1e9cbb5 Implement FakeEtcdClient.CompareAndSwap 2014-08-01 02:35:38 +09:00
Kouhei Ueno ccb7e8793b return EtcdErrorNodeExist when Create is called for existing node 2014-08-01 02:35:37 +09:00
Kouhei Ueno d46bfcb132 Fail immediately if f.Err is set 2014-08-01 02:35:37 +09:00
Kouhei Ueno e40cdd50ed Generate modification index only if f.TestIndex is specified.
This is for compatibility with existing tests.
2014-08-01 02:34:08 +09:00
Kouhei Ueno b82bb37c89 FakeEtcdClient: Maintain change index 2014-08-01 02:34:08 +09:00
Dawn Chen 2e8020be8c Update the entire cAdvisor package. There is a version mismatch issue
which cause #707
2014-07-31 10:11:25 -07:00
csrwng a3476fcbca Add a method to list replication controllers 2014-07-31 12:37:02 -04:00
Dawn Chen 76ec7acf91 bump(github.com/google/cadvisor): bdd574b728e8a1e5eb08649d631197620dd09650 2014-07-31 09:14:04 -07:00
Meir Fischer 80b1fa000e structured message for selector; matching functionality 2014-07-31 00:29:42 -04:00
Filipe Brandenburger de405ac126 Improve generation of version information from the git tree
Detect whether the tree is dirty and append a "-dirty" indication to the
git commit (common practice with other repos, e.g. kernel, docker.)

Properly handle the case where a git tree is not found (e.g. building
from archive.)

In the sed expression, look for the variable to be updated
(commitFromGit) instead of hardcoding a line number.

Tested:

- Built from a dirty tree:
    $ output/go/bin/kubelet -version
    Kubernetes version 0.1, build 2d784c684c75-dirty

- Built from a clean tree:
    $ output/go/bin/kubelet -version
    Kubernetes version 0.1, build 505f23a31172

- Built from an archive:
    $ hack/build-go.sh
    WARNING: unable to find git commit, falling back to commitFromGit = `(none)`
    $ output/go/bin/kubelet -version
    Kubernetes version 0.1, build (none)

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
2014-07-30 18:48:57 -07:00
Filipe Brandenburger 7e56609139 Handle -version flag on all commands
Tested: Passed -version argument to kubelet (and all other binaries):
  $ output/go/bin/kubecfg -version
  Kubernetes version 0.1, build 6454a541fd56

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
2014-07-30 18:48:56 -07:00
brendandburns 76e2cd70f7 Merge pull request #683 from smarterclayton/slightly_pause_on_return
Slightly pause on requests to allow most to finish
2014-07-30 16:05:15 -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 c5ca032287 Merge pull request #706 from brendandburns/proxy
Revert the revert and fix tests.
2014-07-30 15:19:12 -07:00
brendandburns 59c5fb11c0 Merge pull request #672 from lavalamp/customConversionFuncs
Custom conversion funcs
2014-07-30 15:09:01 -07:00
Brendan Burns 2cbe2c18d4 Add a comment to tickle travis. 2014-07-30 15:06:56 -07:00
Daniel Smith ce586c1448 Test both directions of the conversion. 2014-07-30 15:04:01 -07:00
Brendan Burns 9519a8049b Fixed tests. 2014-07-30 15:02:36 -07:00
Clayton Coleman 1bdeb058e1 Slightly pause on requests to allow most to finish
Currently, every write will result in a 202 (etcd adding a few
ms of latency to each request).  This forces clients to go into
a poll loop and pick a reasonable server poll frequency, which
results in 1 + N queries to the server for the single operation
and adds unavoidable latency to each request which affects their
perception of the service.

Add a very slight (25ms by default) delay to wait for requests
to finish.  For clients doing normal writes this reduces the
requests made against the server to 1.  For clients on long requests
this has no effect.  The downside is that http connections are held
on to for a longer period in high write loads.  The decrease in
perceived latency from the kubecfg is significant.
2014-07-30 17:49:47 -04:00
brendandburns 2486414c16 Merge pull request #690 from smarterclayton/refactor_apiserver_changes
Clean up pkg/apiserver
2014-07-30 14:41:00 -07:00
brendandburns 5443929b84 Merge pull request #702 from fsouza/update-go-dockerclient
third_party: update go-dockerclient
2014-07-30 14:25:37 -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
Clayton Coleman e64a393e1a Move handle* methods to their respective locations
Fix names
2014-07-30 17:15:09 -04:00
Clayton Coleman fe7f611d88 Split operations code and add comments 2014-07-30 17:15:09 -04:00
Clayton Coleman 9069696514 Rename write -> writeJSON 2014-07-30 17:15:09 -04:00
Clayton Coleman b84c9f7a1c Rename methods and move parseTimeout 2014-07-30 17:15:09 -04:00
Clayton Coleman 82b78912fc Move prefix methods 2014-07-30 17:15:09 -04:00
Clayton Coleman a2c86e4c97 Simplify helpers 2014-07-30 17:15:09 -04:00
Clayton Coleman c7d311896e Shorten variable name 2014-07-30 17:15:09 -04:00
Clayton Coleman 8b511832ff Split minion 2014-07-30 17:15:09 -04:00
Clayton Coleman a46f6313bc Split interfaces 2014-07-30 17:15:09 -04:00
Clayton Coleman d5e22bfe2a Split index 2014-07-30 17:14:07 -04:00
Clayton Coleman b70a145161 Split operations test 2014-07-30 17:14:06 -04:00
Clayton Coleman db51ea2a17 Split async 2014-07-30 17:14:06 -04:00
Clayton Coleman b911d9265a Split watch 2014-07-30 17:14:06 -04:00
erictune a41aeeca67 Merge pull request #701 from SebastianM/misspelling
fix misspelling
2014-07-30 13:36:14 -07:00
Francisco Souza 2a345ffa9e third_party: update go-dockerclient
math.MaxInt64 represents 8 exabytes, which is a good limit for memory.
Also, this is the type used by Docker, so it's not possible to get any
value bigger than math.MaxInt64 as memory limit (both ram and swap) on a
Docker container.

Relevant discussion at #589 (more precisely,
https://github.com/GoogleCloudPlatform/kubernetes/pull/589#issuecomment-50640605).
2014-07-30 15:18:42 -03:00
Sebastian Müller e1172fc78c fix misspelling 2014-07-30 20:10:12 +02:00
Clayton Coleman dc6fdc423d Merge pull request #627 from lavalamp/fix
Add /version to server and check it in client.
2014-07-30 12:52:15 -04:00
Dan McPherson d94f5c3360 Fixing typo 2014-07-30 16:45:53 +02:00
Brendan Burns 448a4b7d69 Revert "Revert "Add support for stopping a proxier.""
This reverts commit 19beaf71b5.
2014-07-30 06:52:03 -07:00
brendandburns 0ad9221f5c Merge pull request #695 from danmcp/fix_golint_warnings
Fixing golint warnings
2014-07-30 06:49:27 -07:00
Dan McPherson d5fcaa1f03 Fixing golint warnings 2014-07-30 13:41:09 +02:00
Daniel Smith 19beaf71b5 Revert "Add support for stopping a proxier." 2014-07-29 23:24:57 -07:00
Daniel Smith 00bdeecb63 Merge pull request #682 from brendandburns/proxy
Add support for stopping a proxier.
2014-07-29 23:20:55 -07:00
brendandburns b0d18b2af0 Merge pull request #571 from lavalamp/master
Decode/Encode everywhere
2014-07-29 17:19:33 -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
Brendan Burns 99f0d2e807 Add support for stopping a proxier. 2014-07-29 15:40:47 -07:00
Rohit Jnagal fbd3e85e9c Fix handling of default cpu shares. 2014-07-29 18:34:16 +00: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
Daniel Smith 2a0b82a4ed Merge pull request #681 from brendandburns/noisy
Make file error logging edge triggered to reduce log spam.
2014-07-29 09:27:25 -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
Brendan Burns aa703a4e72 Make file error logging edge triggered to reduce log spam. 2014-07-29 05:38:07 -07: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 1d044e5912 Merge pull request #649 from kelseyhightower/improve_volume_test_coverage
volume: improve test coverage and minor refactoring
2014-07-28 17:46:23 -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
Dawn Chen 3627bb5190 Merge pull request #675 from dchen1107/minionlogs
Instead of apiserver panic when proxy a request to a dead minion,
2014-07-28 17:03:02 -07:00
Dawn Chen 8e9864e8fc Instead of apiserver panic when proxy a request to a dead minion,
print out proper message through http.Response
2014-07-28 16:40:29 -07:00
Brendan Burns c717b872a3 Don't hard code load balancer zone. 2014-07-28 15:54:16 -07:00
Daniel Smith 3b8488028d Add /version to server and check it in client.
Will help detect client/version skew and prevent e2e test from passing
while running a version other than the one you think it's running.
2014-07-28 15:45:25 -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
brendandburns 71b14b464a Merge pull request #623 from smarterclayton/validate_replication_controllers
Add validation to ReplicationControllers
2014-07-28 14:46:47 -07:00
Clayton Coleman 46bb48cf13 Merge pull request #648 from kelseyhightower/improve_health_test_coverage
health: Improve test coverage
2014-07-28 17:08:33 -04:00
Daniel Smith c92e8d38b6 Merge pull request #642 from kelseyhightower/cleanup_master_configs
Add master.Config type and cleanup master configuration
2014-07-28 12:53:31 -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 f1d6069b01 Use Decode/Encode in etcd_tools 2014-07-28 11:27:36 -07:00
brendandburns b34a3c8c21 Merge pull request #630 from lavalamp/fuzz
Add go fuzzer in preparation for testing.
2014-07-28 10:44:59 -07:00
brendandburns f073cee13b Merge pull request #636 from kelseyhightower/load_auth_info_tests
kubecfg: improve tests around authentication
2014-07-28 10:44:27 -07:00
Clayton Coleman 4ee3deaaf7 Merge pull request #647 from kelseyhightower/fix_extra_test_flags
Remove extra test flags from all commands
2014-07-28 12:58:57 -04:00
Dan McPherson c4f4f69b93 Fixing Typos 2014-07-28 15:56:20 +02:00
Dan McPherson 7bbc5e2a19 Fixing typos 2014-07-28 15:15:50 +02:00
Daniel Smith d09b164e67 Add TODOs, clean up, clarify comments, and add one more test. 2014-07-27 19:32:37 -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
Daniel Smith aa92dd7fb2 Add go fuzzer in preparation for testing. Also gofmt a few files that needed it. 2014-07-27 14:54:48 -07:00
Kelsey Hightower 87fa19cdfe Remove extra test flags from all commands
Currently all commands are being build with extra flags. The extra
flags appear because of a direct import of the testing package from
the fake_etcd_client.go source file.

Remove the direct import of the testing package. Add a tools.T
interface to support existing behavior. Also clean up two TODO items
by remove using of the expectError and expectNoError functions.

Fixes #579
2014-07-27 14:19:18 -07:00
Kelsey Hightower 7b59845843 volume: improve test coverage and minor refactoring
The volume package does not test enough use-cases.

Improve test coverage by adding additional tests and refactoring
current tests to use table testing.

This change introduces a new error var to make testing unsupported
volume type errors easier.

This change does not introduce any changes in behavior.
2014-07-27 14:11:19 -07:00
Clayton Coleman 1047c57c6d Use http.StatusInternalServerError instead of 500 2014-07-27 15:37:03 -04:00
Kelsey Hightower c860ac3afc health: Improve test coverage 2014-07-27 08:44:59 -07:00
Kelsey Hightower 1ca199379f kubecfg: improve tests around authentication
This change adds additional test coverage for the kubecfg
command. There is now a test for the case when the auth info
file does not exist. LoadAuthInfo tests have been refactored
to use table testing.
2014-07-26 22:21:17 -07: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
Kelsey Hightower 200b2c0ba7 httplog: Improve test coverage 2014-07-26 21:17:10 -07:00
James DeFelice 8e3e65e0f3 named container ports should have sane env var names 2014-07-25 17:55:52 -04:00
Clayton Coleman d32024870a Extend validation for ReplicationController
Provide type safe checks for empty sets of selectors.
2014-07-25 12:15:17 -04:00
Jeromy Carriere 9cad657b4c Fix internalize for ReplicationControllerList. items were created
in a new var hiding the function-scoped var.
2014-07-25 10:44:45 -04:00
Clayton Coleman fbd71c9c02 Merge pull request #535 from lavalamp/etcdWatcher
Etcd watcher
2014-07-25 08:40:05 -04:00
Daniel Smith e3927b428d Merge pull request #618 from brendandburns/async
Make replication controller synchronizations independent.
2014-07-24 22:58:45 -07:00
Brendan Burns 51c5907c55 Make individual controller actions asynchronous. 2014-07-24 22:57:56 -07:00
Brendan Burns ae0baf3fab Make replication controller synchronizations independent. 2014-07-24 22:46:04 -07:00
Daniel Smith 321ce0e1ce Merge pull request #565 from brendandburns/api2
Fork API types.
2014-07-24 22:29:57 -07:00
Brendan Burns bf5ae4bb9d Fork API types. 2014-07-24 21:47:08 -07:00
Daniel Smith f3b6090a38 Make kubecfg work for minions. 2014-07-24 18:04:55 -07:00
Daniel Smith 9e9d9b8913 Merge pull request #607 from smarterclayton/return_correct_content_type
Write the json content type for API responses
2014-07-24 15:27:31 -07:00
Daniel Smith 8881adc905 Merge pull request #606 from jonboulle/master
assorted formatting and typo fixes
2014-07-24 15:25:08 -07:00
Jonathan Boulle c43035088b assorted formatting and typo fixes 2014-07-24 15:10:36 -07:00
Clayton Coleman 30e881c3f9 Write JSON content type for API responses 2014-07-24 17:45:02 -04:00
Daniel Smith 5ae20f9edb Merge pull request #605 from Sarsate/setup-error
SetUp now returns an error.
2014-07-24 14:13:22 -07:00
Danny Jones 1117da4a55 SetUp now returns an error.
SetUp returns an error, kubelet now skips pod if error occurs.
2014-07-24 13:53:44 -07:00
Victor Marmol b131da1cf5 Sync pods asynchronously in the Kubelet.
This makes two main changes:
- Runs syncPod in a separate Go routine (and enforces only one of those
  runs at a time).
- Uses the pod list to determine if a container should be running or
  should be killed (used to use the output of syncPod).

Since Docker pulls are synchronized by the Docker daemon we still block
on that, but pods can now be removed and prepared for starting without
blocking on long pulls.
2014-07-24 13:47:51 -07:00
Daniel Smith 41eb15bcff Merge pull request #527 from Sarsate/rootdir-flag
Adds a flag to specify root working directory.
2014-07-24 13:12:55 -07:00
Danny Jones bfa4642055 Adds a flag to specify root working directory.
--root_dir specifies the directory kubelet will use for it's
procedures. Currently used for volume mounts.
2014-07-24 13:04:05 -07:00
Daniel Smith 65575953c0 Merge pull request #589 from monnand/update-docker-client
update github.com/fsouza/go-dockerclient
2014-07-23 18:00:24 -07:00
Nan Deng ea4224cbe7 update github.com/fsouza/go-dockerclient 2014-07-23 17:42:03 -07:00
Daniel Smith b630c7bcb4 Implement watch.Interface via etcd. 2014-07-23 15:04:08 -07:00
Daniel Smith e2e2ce44c1 Merge pull request #587 from VojtechVitek/data_race
Fix data race in kubelet fake_docker_client
2014-07-23 13:00:55 -07:00
Vojtech Vitek (V-Teq) 1f78b0fc6f Fix reslice and data races in kubelet fake_docker_client
- Fix reslice in Pull() to remove the just returned error
- Fix data races found during the integration testing
- Remove one-liner helper method for better readability
2014-07-23 20:44:42 +02:00
Daniel Smith 7a8e268c0e Merge pull request #548 from kelseyhightower/improve_kubecfg_tests
Use table testing for makePort tests
2014-07-23 09:50:21 -07:00
Kelsey Hightower 609050da39 Use table testing for makePort tests 2014-07-23 00:18:09 -07:00
Brendan Burns c3f313784d Actually fix kubecfg. 2014-07-22 23:40:55 -07:00
Brendan Burns fcb9201c3b Add a name to containers created by RunController so that validation works. 2014-07-22 22:58:41 -07:00
Daniel Smith ec0f639a21 Merge pull request #551 from erictune/private_kubelet
Private kubelet
2014-07-22 18:58:43 -07:00
Daniel Smith 0ef600c8cd Merge pull request #569 from smarterclayton/fix_bad_watch_in_etcd
Kubelet etcd watch skipping indices
2014-07-22 18:23:00 -07:00
Clayton Coleman fbd7bc375f kubecfg doesn't allow updates because of path checks
Check for 1 path segment on create/list, 2 on update/delete, and
allow any number of path segments on get (for now).

Also pretty prints the list of actual types that are supported for
create/update, which today corresponds to the list of types that
are supported period.
2014-07-22 20:25:06 -04:00
Clayton Coleman bc0ac1e81b Kubelet etcd watch skipping indices
The next index to watch should always be current+1 if we got a
response from etcd, but otherwise it should always be current.
Moved the increment into fetchNextState which returns the next
index to watch for (or the same if an error occurs)
2014-07-22 20:24:18 -04:00
Eric Tune ded67ead1e Make Kubelet type members private and provide New functions. 2014-07-22 14:40:59 -07:00
Dawn Chen 47ad71f92d HandleIndex when URL.Path == "/" 2014-07-22 14:12:16 -07:00
Clayton Coleman 2a2fdb4773 Merge pull request #505 from lavalamp/clientWatch
Add client watch capability
2014-07-21 22:11:02 -04:00
Brendan Burns 6c734b1c55 integrate minion health checking and caching. 2014-07-21 21:52:33 -04:00
Clayton Coleman 7767c2a2ac Switch the Kubelet to use kubelet/config
Also transfer the Kubelet from using ContainerManifest.ID to source specific
identifiers with namespacing.  Move goroutine behavior out of kubelet/ and
into integration.go and cmd/kubelet/kubelet.go for better isolation.
2014-07-21 21:27:26 -04:00
Clayton Coleman 09294b90ce Refactor Kubelet config sources for clarity
Create a new "Pod" concept which can identify pods from
many config sources.
2014-07-21 21:18:36 -04:00
Daniel Smith 91375f4c04 Split httpWatcher into watch.StreamWatcher and tools.APIEventDecoder. 2014-07-21 16:07:58 -07:00
Daniel Smith dbd0d419df Add watch capability to our client.
Next steps: Make an etcd watcher... decide on a state field for pods...
move the scheduler to its own binary.
2014-07-21 16:07:58 -07:00
Daniel Smith f672edd1cf Merge pull request #457 from dchen1107/minionlogs
Add support to query kubelet's logs and cadvisor's stats through apiserver by passing rawquery
2014-07-21 16:02:44 -07:00
Daniel Smith 5f13c4b048 Merge pull request #545 from kelseyhightower/heath_tests
Improve test coverage for the health package and remove mocks
2014-07-21 15:49:10 -07:00
Daniel Smith 3f33bf78c5 Merge pull request #539 from vmarmol/pause
Add a pause image for the net container.
2014-07-21 15:47:39 -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
Dawn Chen dc921b8c65 comment changes 2014-07-21 14:46:59 -07:00
Dawn Chen 064237a5b8 Add support to query kubelet's logs and cadvisor's stats through
apiserver by passing rawquery.

minor changes

Fixed a minor rebase issues.

Using ioutil.ReadAll instead of httputil.DumpResponse
2014-07-21 11:52:32 -07:00
Victor Marmol 88317efb42 Add a pause image for the net container.
The pause image is a 240KB image that simply pauses waiting on a signal.
Use this for the net container which only needs to act as a placeholder.
Current net image is ~2.5MB. From my tests, this reduces startup time
for the net container from ~14s to ~6s.
2014-07-21 10:28:49 -07:00
Daniel Smith 7910ae8159 Merge pull request #538 from kelseyhightower/replication_controller_test
remove unnecessary expectNoError helper function
2014-07-20 23:02:56 -07:00
Daniel Smith d11b6246a1 Merge pull request #547 from kelseyhightower/kubelet_tests
Add test cases for Docker image name parsing and cleanup
2014-07-20 20:55:33 -07:00
Kelsey Hightower 67efa0a53a Add test cases for Docker image name parsing and cleanup
The tests for Docker image name parsing are repetitive and do not
cover enough test cases.

Refactor the tests to use table testing and add additional test cases.
2014-07-20 19:22:54 -07:00
Kelsey Hightower 682efb7ca5 Remove unnecessary expectNoError helper function
This patch completes a TODO item for the kubecfg package test suite by
removing the expectNoError helper function, which does not reduce enough
typing to justify its usage.
2014-07-20 18:28:55 -07:00
Daniel Smith b577f36492 Merge pull request #541 from kelseyhightower/httplog_test
add tests for the httplog package
2014-07-20 13:42:15 -07:00
Kelsey Hightower 713cadac52 add tests for the healthz package
Currently there are no tests for the healthz package. This patch adds
an initial set of tests and improves test coverage.
2014-07-20 12:28:02 -07:00
Kelsey Hightower a9e0b0d1a3 use %v instead of %#v when logging failures 2014-07-20 11:58:22 -07:00
Kelsey Hightower 34c80bb976 add tests for the httplog package
Currently there are no tests for the httplog package. This patch adds
an initial set of tests and improves test coverage.
2014-07-20 11:26:13 -07:00
Clayton Coleman 28b7b53c72 Merge pull request #529 from lavalamp/recursiveApiObj
Add APIObject for generic inclusion of API objects
2014-07-20 14:25:35 -04:00
Victor Marmol 0a2b1bf644 If no tag was specified, pull "latest" explicitly.
When no tag is given to Docker pull, it downloads all tags. This could be a
significantly large number of images and in the end we only ever run
:latest.
2014-07-20 10:51:31 -07:00
Kelsey Hightower 3b9029ee94 remove unnecessary expectNoError helper function
This patch completes a TODO item for the replication_controller test
suite by removing the expectNoError helper function, which does not
reduce enough typing to justify its usage.
2014-07-20 09:13:11 -07:00
Kelsey Hightower dc7ee7c333 normalize -etcd_servers flag across all commands
The -etcd_servers flag is used inconsistently by the Kubernetes commands,
both externally and internally.

This patch fixes the issue by using the same type to represent a list of
etcd servers internally, and declares the -etcd_servers flag consistently
across all commands.

This patch should be 100% backwards compatible with no changes in behavior.
2014-07-20 07:48:47 -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
Clayton Coleman d1de579070 Merge pull request #493 from lavalamp/scheduler
Add websocket dep & watch api support
2014-07-18 22:18:03 -04: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 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
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
Tim Hockin 94c9c96cb7 Merge pull request #525 from Sarsate/superset-hasall
Renames HasAll to IsSuperset; HasAll uses slice.
2014-07-18 13:59:18 -07:00
Danny Jones 136c9e112c Renames HasAll to IsSuperset; HasAll uses slice.
For the pedants. HasAll is now called IsSuperset and
the new HasAll method takes a slice instead of a set.
2014-07-18 13:58:43 -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 dd36c45bfe Merge pull request #522 from Sarsate/has-all
Added HasAll utility method for string set.
2014-07-18 13:38:11 -07:00
Danny Jones 2d9bad95f8 Added HasAll utility method for string set.
Added HasAll method which detects if one set contains all
of the memebers of another set.

A.HasAll(B) returns true if A is a superset of B.
2014-07-18 13:19:55 -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
Tim Hockin fda69bcca2 Merge pull request #452 from Sarsate/extvol-hostdir
Initial framework for external volumes.
2014-07-18 12:44:38 -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
Daniel Smith e9dbc4e8ad Merge pull request #509 from xiangli-cmu/kubelet
kubelet: cleanup
2014-07-18 10:24:11 -07:00
Daniel Smith 64d4e55624 Merge pull request #515 from brendandburns/fix
Add some more logging to service updates.
2014-07-18 10:18:04 -07:00
Xiang Li 86288ca82a kubelet: cleanup 2014-07-18 10:12:59 -07:00
Clayton Coleman 0ccf1b7812 Operation server was not returning in error cases 2014-07-18 12:36:27 -04:00
Brendan Burns fa69781b41 Add some more logging to service updates. 2014-07-18 09:29:49 -07:00
Clayton Coleman 7d0b8e0c1c Merge pull request #514 from brendandburns/fix
Insert a couple of sleeps to slow things down.
2014-07-18 12:25:12 -04:00
Brendan Burns 744072a71e Insert a couple of sleeps to slow things down. 2014-07-18 09:24:01 -07:00
Daniel Smith 2188907022 Merge pull request #486 from yugui/fix/404-if-notfound
Make RESTful operations return 404 Not Found when the target resource does not exist.
2014-07-18 09:03:17 -07:00
Clayton Coleman 1831cf1711 Remove some verbose logging 2014-07-18 10:48:21 -04:00
Tim Hockin 2f593c92fa Merge pull request #487 from yugui/fix/golint
Fixes Go lint errors and a style fix
2014-07-17 22:44:31 -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
Yuki Yugui Sonoda e0d749f952 fix typo 2014-07-18 14:13:55 +09: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
Nan Deng 564a58722c Retrieve machine spec from cAdvisor 2014-07-17 15:21:47 -07:00
Clayton Coleman 15e791fc5b Rename kubelet_server*.go to server*.go 2014-07-17 13:42:24 -04:00
Danny Jones f1a7850454 Adds EmptyDirectory volume struct
Adds EmptyDirectory to volumes. This represents a directory
on the host, given to a pod that should not persist beyond.

The current draft does not cleanup after itself.
2014-07-17 10:09:14 -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
Yuki Yugui Sonoda 5e31ca3b27 Correct godoc messages according to review comments 2014-07-17 12:27:58 +09:00
Clayton Coleman 831ab28759 Merge pull request #483 from brendandburns/health
Add a caching minion registry.
2014-07-16 20:51:27 -04:00
Clayton Coleman 17053f5950 Merge pull request #465 from smarterclayton/simplify_config_for_reuse
Extract proxy/config common functions for reuse
2014-07-16 18:28:07 -04:00
Brendan Burns dceafbadab Add a caching minion registry. 2014-07-16 14:52:32 -07:00
Daniel Smith 7127eefd36 Merge pull request #469 from smarterclayton/unify_container_lookup
Make container lookup in the Kubelet cleaner
2014-07-16 12:15:52 -07:00
Clayton Coleman 021cf64808 Change proxy config to reuse util/config
Splits endpoint and service configuration into their own objects.  Also makes
the endpoint and service configuration tests correct - there was a race condition
previously that meant tests were passing but not checking correct code.
2014-07-16 14:13:25 -04:00
Clayton Coleman 38ec4ff8c0 Create a configuration update utility
Extracted from proxy/config
2014-07-16 14:13:25 -04:00
Clayton Coleman 185a97b037 Make container lookup in the Kubelet cleaner
Reduce duplicate calls to list lookups for parallel go routines.
2014-07-16 14:12:13 -04:00
brendandburns 02b06a2f2f Merge pull request #482 from monnand/cadvisor-update-2
Add code in client package to use kubelet's API to retrieve data from cAdvisor
2014-07-16 10:39:31 -07:00
brendandburns 8ddc33998c Merge pull request #464 from yugui/fix/golint2
Fixes Go lint errors
2014-07-16 09:55:30 -07:00
Yuki Sonoda (Yugui) df9da65939 Rename a function according to go convention 2014-07-16 22:05:06 +09:00
Yuki Sonoda (Yugui) 1395b0fbf0 Fixes golint errors in pkg/healthz 2014-07-16 21:59:23 +09:00
Yuki Sonoda (Yugui) f368e4be68 Fixes golint errors in pkg/health 2014-07-16 21:59:21 +09:00
Yuki Sonoda (Yugui) d2db5cdffc Fix a build failure of a test 2014-07-16 21:33:26 +09:00
Yuki Sonoda (Yugui) c1eee00a57 Correct an error message 2014-07-16 21:33:26 +09:00
Yuki Sonoda (Yugui) a702be8e63 Fixes new golint errors in pkg/kubelet after merge 2014-07-16 21:33:26 +09:00
Yuki Sonoda (Yugui) 07b8be4d4c Merge branch 'master' into fix/golint2
Conflicts:
	pkg/api/types.go
	pkg/health/health_check.go
	pkg/kubelet/kubelet.go
	pkg/kubelet/kubelet_server.go
	pkg/kubelet/kubelet_server_test.go
	pkg/kubelet/kubelet_test.go
2014-07-16 21:33:21 +09:00
Kouhei Ueno 938d9e811b don't reuse random 2014-07-16 15:58:16 +09:00
Nan Deng 6878f105c0 add a client to get container info from kubelet 2014-07-16 01:08:56 -04:00
Daniel Smith 90afdb06c1 Move logger to own package; clean up apiserver to use serve mux. 2014-07-15 21:25:33 -07:00
Daniel Smith c7d31fabbc Merge pull request #480 from monnand/cadvisor-update-1
Update kubelet package to use most recent cAdvisor's code
2014-07-15 18:25:54 -07:00
Brendan Burns c331849e69 Add support for CPU limiting to the kubelet. 2014-07-15 16:49:34 -07:00
brendandburns 74e17022e4 Merge pull request #474 from yifan-gu/close_chan
Changed op.notify<-true to close(op.notify).
2014-07-15 16:03:53 -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
Yifan Gu 0e9e2ee7f4 Changed op.notify<-true to close(op.notify). 2014-07-15 15:08:04 -07:00
Nan Deng 30bc2af9f1 gofmt -r "GetContainerStats->GetContainerInfo" 2014-07-15 11:53:00 -07:00
Nan Deng 8c573ee727 Update to latest cAdvisor and use data structures directly from cAdvisor 2014-07-15 11:53:00 -07:00
Daniel Smith 8ef60138e5 Merge pull request #466 from smarterclayton/move_docker_function_out
Move Docker specific function out of the Kubelet
2014-07-15 10:38:28 -07:00
Daniel Smith 61917a0628 Revert "Changed op.notify<-true to close(op.notify)." 2014-07-15 10:34:05 -07:00
Daniel Smith e659688f6d Merge pull request #458 from yifan-gu/close_chan
Changed op.notify<-true to close(op.notify).
2014-07-15 09:29:49 -07:00
Tim Hockin 3a9295add0 Merge pull request #407 from yugui/fix/golint
Fixes Go lint errors.
2014-07-15 08:44:57 -07:00
Clayton Coleman e02ea37d9f Move Docker specific function out of the Kubelet 2014-07-15 11:34:48 -04:00
Yuki Yugui Sonoda edac5ce0b8 Fixes golint errors in pkg/kubelet 2014-07-15 22:56:31 +09:00
Yuki Yugui Sonoda c6b27bb87d Fixes golint errors in pkg/kubecfg 2014-07-15 22:56:17 +09:00
Yuki Yugui Sonoda af38bf1ef7 Fixes golint errors in pkg/api 2014-07-15 22:56:09 +09:00
Clayton Coleman 07fafb1252 Merge pull request #453 from brendandburns/memory
Add support for memory limits in the kubelet.
2014-07-15 09:37:42 -04:00
Yuki Yugui Sonoda 2861955025 Corrects wording of godoc comments. 2014-07-15 22:03:08 +09:00
Yuki Yugui Sonoda 1bd7276aca Correct the style of nested conditionals 2014-07-15 20:58:03 +09:00
Yuki Yugui Sonoda 60dd1f7cc0 Eliminates tautological comments 2014-07-15 20:58:01 +09:00
Yuki Yugui Sonoda 41febcee5e Merge branch 'master' into fix/golint
Conflicts:
	pkg/master/master.go
	pkg/master/pod_cache.go
	pkg/proxy/config/file.go
	pkg/proxy/proxier.go
	pkg/proxy/roundrobbin.go
	pkg/scheduler/randomfit.go
	pkg/scheduler/randomfit_test.go
2014-07-15 20:57:47 +09:00
Kouhei Ueno bba23e28c2 Define EtcdErrorCode as constant and reuse EtcdError instances 2014-07-15 20:48:06 +09:00
Yifan Gu 90cc060699 Changed op.notify<-true to close(op.notify). 2014-07-15 00:29:43 -07: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
Daniel Smith 314eb1ae2d Merge pull request #454 from brendandburns/template
Add a template printer to kubecfg.
2014-07-14 21:46:21 -07:00
Clayton Coleman 0839f454fe Merge pull request #433 from brendandburns/service
Update services to use the internal IP and port, now that its available.
2014-07-15 00:22:34 -04:00
Brendan Burns f7bd5a6f0f Add a template printer to kubecfg. 2014-07-14 21:13:06 -07:00
Brendan Burns 92d83640c0 Add support for memory limits in the kubelet. 2014-07-14 20:57:26 -07:00
Brendan Burns ae179121c6 Address comments. 2014-07-14 20:38:43 -07:00
Brendan Burns 9f99767b6c Add a /healthz handler to the kubelet server, so that the master can validate kubelet health. 2014-07-14 20:38:18 -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
Daniel Smith dcbb309e4f Merge pull request #440 from brendandburns/link
Add Docker link style env vars to link containers to services.
2014-07-14 16:47:49 -07:00
Brendan Burns 0e798bcc3c Add link env vars. 2014-07-14 16:37:17 -07:00
Yifan Gu 3a95572290 Changed the keepChannel to buffered channel.
Since the keepChannel is used to send data, not just for synchronizaiton,
so make it a buffered channel can avoid unnecessary goroutine yields.
2014-07-14 14:22:19 -07:00
Clayton Coleman f474879bad Merge pull request #431 from claire921/controller
pkg/controller: cleanup replication_controller.go
2014-07-13 10:13:12 -04:00
Claire Li ba9c370014 pkg/controller: cleanup replication_controller.go 2014-07-12 14:21:51 -07:00