Commit Graph

866 Commits

Author SHA1 Message Date
Brian Goff
f6f6c46b53 Merge pull request #485 from rbitia/maintainers
updating maintainers
2019-06-18 15:35:17 -07:00
Brian Goff
a54c670dd2 Merge branch 'master' into maintainers 2019-06-18 15:26:21 -07:00
Brian Goff
a00c2f4b8b Remove providers (#670)
* Move all but mock provider out of tree

These have all been moved to repos under github.com/virtual-kubelet.

* Introduce a providers.Store

This essentially moves the the old register/ handling into a first class
object that can be controlled from the CLI rather than through build
tags deep in the code.

This actually would have made it a bit easier to build the provider
repos and makes the cmd/ code more re-usable.
2019-06-18 11:11:11 +01:00
Brian Goff
9bcc381ca3 Use object informers instead of listers (#669)
We'll need these informers for
https://github.com/virtual-kubelet/virtual-kubelet/pull/586

Changing this now means we don't need to make API changes later.
2019-06-17 18:00:02 +01:00
Brian Goff
c6fdae931a Remove version package (#667)
This moves version declaration into cmd/virtual-kubelet/main.go
From here values are passed down into the things that need it.
2019-06-14 20:19:39 +01:00
Brian Goff
cacce3b288 Merge pull request #666 from cpuguy83/remove_azure_provider
Remove azure provider
2019-06-14 10:17:40 -07:00
Brian Goff
18e07b67ce Remove azure provider
This was moved over to github.com/virtual-kubelet/azure-aci
2019-06-13 12:55:18 -07:00
Brian Goff
bd742d5d99 Add license details on file heads. (#665)
Realized as I was starting to copy some stuff to other repos that we
should go ahead and add this.
v0.10.0
2019-06-13 10:13:14 -07:00
Brian Goff
3346e9e28c Remove resourcemanager from conroller public API (#664)
We still use it internally, but this does not need to be part of the
public API. Instead just have callers pass us the relevent listers and
we create our own resource manager.
2019-06-12 13:42:03 -07:00
Brian Goff
665b23d273 Fix typo (#663)
I blame the MBP keyboard...
2019-06-12 13:23:31 -07:00
Brian Goff
6cae24e03a Only run e2e after validate/test is successful (#662) 2019-06-12 21:00:41 +01:00
Brian Goff
c55bc21873 Increase timeouts on test watch (#661)
This test is flakey on CI, likely because the timings are too tight, so
give a bit more time for things to complete.
2019-06-12 20:55:33 +01:00
Sasha Yakovtseva
c06a778abc Add idea files in gitignore (#660) 2019-06-12 13:39:04 +01:00
Brian Goff
a54753cb82 Move around some packages (#658)
* Move tracing exporter registration

This doesn't belong in the library and should be configured by the
consumer of the opencensus package.

* Rename `vkublet` package to `node`

`vkubelet` does not convey any information to the consumers of the
package.
Really it would be nice to move this package to the root of the repo,
but then you wind up with... interesting... import semantics due to the
repo name... and after thinking about it some, a subpackage is really
not so bad as long as it has a name that convey's some information.

`node` was chosen since this package deals with all the semantics of
operating a node in Kubernetes.
2019-06-12 13:11:49 +01:00
Brian Goff
65b32a0fef Merge pull request #659 from cpuguy83/move_e2e_to_internal
Move test/* to internal/test/*
2019-06-10 13:48:29 -07:00
Brian Goff
0a360f54c0 Move test/* to internal/test/*
This ensures this code cannot be imported by other repositories as this
is only intended for internal testing packages.
2019-06-10 12:07:47 -07:00
Brian Goff
c71ee814fe Merge pull request #654 from cpuguy83/node_defaults
Update node defaults
2019-06-10 11:32:14 -07:00
Brian Goff
b1236477f5 Update node defaults
Do not enable leases by default in the node constructor.
Simplify node constructor to not require a lease client when leases may
not even be enabled.

Updates node status update interval to the kubelet default of 10s (was
5s in vk).
2019-06-10 10:31:37 -07:00
Brian Goff
67fddc4142 Merge pull request #627 from sargun/make-mock-provider-async2
Convert mock provider to async provider
2019-06-05 15:06:35 -07:00
Brian Goff
196e1eda27 Merge branch 'master' into make-mock-provider-async2 2019-06-05 15:01:13 -07:00
Brian Goff
eeab8f9b1b Merge pull request #628 from sargun/use-running-pods
Use Running Pods Endpoint for testing
2019-06-05 14:59:52 -07:00
Brian Goff
9cc9ccea1a Merge branch 'master' into make-mock-provider-async2 2019-06-05 14:42:11 -07:00
Jeremy Rickard
a67b19310f Merge pull request #633 from cpuguy83/pod_status_error_handling
Handle not found case for status update
2019-06-04 17:41:50 -06:00
Brian Goff
73e44ddc68 Merge branch 'master' into pod_status_error_handling 2019-06-04 16:33:53 -07:00
Brian Goff
72de24d3c4 Merge pull request #651 from cpuguy83/fix_causal_lookup
Fix bad recursion in errdefs check
2019-06-04 16:33:19 -07:00
Brian Goff
f414dc8bf2 Fix bad recursion in errdefs check 2019-06-04 15:06:41 -07:00
Brian Goff
98ca5c8398 Handle not found case for status update
If we don't handle the "pod not found" case then we end up with the pod
getting re-queued over and over until the max retries are hit. It also
blocks the queue for other pod status updates for that pod
namespace/name.
2019-06-04 14:39:58 -07:00
Brian Goff
20e710043f Merge pull request #635 from cpuguy83/define_errdefs_package
Define errdefs package
2019-06-04 14:35:54 -07:00
Brian Goff
ece39fde19 Remove strongerrors dep 2019-06-04 14:29:25 -07:00
Brian Goff
d6b5ae3710 Remove usage of ocstatus package
This changes the tracing package to accept an error on SetStatus, which
is really what we always want anyway.
This also decouples the trace package from opencensus.
2019-06-04 14:29:25 -07:00
Brian Goff
02623170cc Use errdefs package 2019-06-04 14:29:23 -07:00
Brian Goff
b9711abff3 Add errdefs package
Providers should use this package so the virtual kubelet core
controllers can understand the errors produced from the provider code.
2019-06-04 14:13:54 -07:00
Brian Goff
8340407f98 Support error handler callback for node status (#648)
This moves the logic for re-creating the a missing node up into the CLI.
We can make this optional, but for now I've just preserved existing
functionality.
2019-06-01 09:46:47 -07:00
Yash Desai
1542c4d2f4 Allow composing env var from existing env vars. (#643)
Example:
env name:  FOO
    value: "foo"
    name:  BAR
    value: "bar"
    name:  FOOBAR
    value: "${FOO}${BAR}" <-- should expand to: "foobar"

Added testcase for the same as well.
Change is based on kubelet_pods.go.
Simplified some of the existing code.
2019-06-01 09:41:10 -07:00
Brian Goff
71546a908f Remove Server object (#629)
This had some weird shared responsibility with the PodController.
Instead just move the functionality to the PodController.
2019-06-01 09:36:38 -07:00
Brian Goff
21d8ba2206 Don't use -a on build (#646)
This lets us utilize the go build cache and significantly speeds up
builds.
2019-05-29 08:15:34 -07:00
pmould
acb36b6342 #622 add support for new regions for aws fargate (#623)
* #622 add support for new regions for aws fargate
2019-05-28 10:16:06 -07:00
Jeremy Rickard
42061ea1bc Merge pull request #634 from cpuguy83/mock_provider_in_vkubelet
Use custom mock in vkubelet tests
2019-05-21 05:38:47 -06:00
Sargun Dhillon
ec8972fef3 Use Running Pods Endpoint for testing
* Use the VKUBELET API for fetching the pods during testing, which
   makes it easier to run testing without wiring up an entire cluster
 * Runningpods does not require each provider to implement the
   optional stats interface for testing.
2019-05-20 15:58:50 -07:00
Brian Goff
2c5952587a Use custom mock in vkubelet tests
Don't use actual "mock" provider in vkubelet to reduce awkward import
cycles.
Really the "mock" provider is for e2e tests. Instead create our own mock
in the vkubelet package specifically for unit tests which can also be
more easily customized to test edge cases.
2019-05-20 11:20:28 -07:00
Sargun Dhillon
d183dbbe17 Upgrade to Go 1.12 (#630) 2019-05-20 11:39:47 +01:00
Sargun Dhillon
42e83ab984 Work around https://github.com/virtual-kubelet/virtual-kubelet/issues/632 2019-05-19 14:36:06 -07:00
Sargun Dhillon
dd71a884b3 Convert mock provider to async provider 2019-05-19 14:36:06 -07:00
Sargun Dhillon
d0c0d90451 Revert caching go builds (#631)
It turns out that using gocache on circleci like this makes it
so that builds are not properly invalidated, and breaks a
whole load of things.
2019-05-17 21:07:51 -07:00
Brian Goff
7dd49516d8 Decouple vkubelet/* packages from providers (#626)
This makes the concept of a `Provider` wholely implemented in the cli
implementation in cmd/virtual-kubelet.

It allows us to slim down the interfaces used in vkubelet (and
vkubelet/api) to what is actually used there rather than a huge
interface that is only there to serve the CLI's needs.
2019-05-17 17:01:05 -07:00
Jeremy Rickard
87e72bf4df Light up UpdatePod (#613)
* Light up UpdatePod

This PR updates the vkublet/pod.go createOrUpdate(..) method to actually handle
updates. It gets the pod from the provider as before, but now if it exists the method
checks the hash of the spec against the spec of the new pod. If they've changed, it
calls UpdatePod(..).

Also makes a small change to the Server struct to swap from kuberentes.Clientset to kubernetes.Interface
to better facilitate testing with fake ClientSet.

Co-Authored-By: Brian Goff <cpuguy83@gmail.com>
2019-05-17 11:14:29 -07:00
Sargun Dhillon
a3f933d998 Fix permission denied warnings during tests (#617)
For some reason the kubelet tries to do things that it gets perm
denied. This changes the base.yml in the skaffold file to have
the permissions. In turn, this broke the node deletion test. So,
instead of looking for the deletion event (imperative), we wait
for the node UID to change (declarative).
2019-05-17 10:53:24 -07:00
Sargun Dhillon
9e659145c1 Find / stash (new) gocache (#620)
- (In)validate cache by branch
2019-05-17 10:50:37 -07:00
Sargun Dhillon
9bf05b525d Remove setting taint during e2e test (#621)
We're in effect testing the K8s scheduler logic in the test
by setting taints, as opposed to the actual VK itself. If we
want to make sure the taint is set, we can just observe the node
object.

Instead, bind to the pod to the VK node explicitly.
2019-05-17 10:49:37 -07:00
Sargun Dhillon
5b3190acb5 Cache go build artifacts (#619) 2019-05-14 16:29:21 -07:00