Commit Graph

233 Commits

Author SHA1 Message Date
Brian Goff
713fe23d03 Add provider method to pass node configuration (#680)
This eliminates all the one-off calls to for specific things like
`Capacity` and other things.
Instead we configure defaults in the CLI and then pass the full node
object to the provider to change as needed.

This makes sure the provider can change whatever they need to without
having to add tons of methods to the provider interface.
2019-06-26 17:51:05 +01:00
Graham Hayes
6b6798865e Allow virtual-kubelet to use cluster domain
This allows `--cluster-domain` to be passed to virtual kubelet like a
traditional kublet, and use this to generate search-domains for
`/etc/resolv.conf`

* Set default `cluster-domain` to `cluster-local` to match current kubelet

Related: #641

Signed-off-by: Graham Hayes <gr@ham.ie>
2019-06-19 17:28:18 +01: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
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
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
9cc9ccea1a Merge branch 'master' into make-mock-provider-async2 2019-06-05 14:42:11 -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
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
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
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
0a6fc26064 Fix formatting logging calls in the mock provider
There were a bunch of logging calls in the mock provider which had
formatting in them, but didn't use the log-with-formatting method.
2019-05-08 17:37:20 -07:00
Brian Goff
3cc051f7c2 Use I/O stream for provider logs interface
Providers must still update the implementaiton to actually gain any
benefit here, but this makes the provider interface a bit more sane.
2019-05-08 09:17:29 -07:00
Sargun Dhillon
740bec9ea0 Remove old github.com/Sirupsen/logrus 2019-05-06 17:26:05 -07:00
sflxn
4feab78b76 Remove VIC provider code.
The VIC provider is stale and there are no developers working on this
anymore.  Removing the provider from the repo.
2019-05-06 16:52:53 -07:00
Kevin亓
cfa37871ab fix: fix a typo in azure/aci_test (#589)
Signed-off-by: KevinBetterQ <1093850932@qq.com>
2019-05-06 09:45:55 -07:00
Sargun Dhillon
ef62defcea Run "make format" (#603)
There was some code that wasn't formatted according to gofmt. This
fixes that.
2019-05-06 09:26:10 -07:00
Stuart Leeks
eb87db8731 typo (#588) 2019-05-01 08:06:30 -07:00
Brian Goff
d809dff289 Refactor exec interface (#578)
This removes the dependence on remotecommand in providers as well as the
need to expose provider ID's for the sake of the ExecInContainer API.
2019-04-26 12:57:56 -07:00
Jeremy Rickard
45d2ef06b2 Update ACI liveness/readiness probe handling to work with named ports (#333)
* Update ACI liveness/readiness probe handling to work with named ports
2019-04-23 11:43:48 -07:00
Hector Fernandez
d3f13cc6ff providers: fix string format (#575) 2019-04-19 08:10:03 -07:00
Hongbin Lu
2521ec1cce Add documentation for OpenStack provider (#570)
* Add documentation for OpenStack provider

Signed-off-by: Hongbin Lu <hongbin034@gmail.com>

* Add maintainer for OpenStack provider

Signed-off-by: Hongbin Lu <hongbin034@gmail.com>
2019-04-08 14:31:39 -07:00
Anubhav Mishra
455b0cc4a6 Adding HashiCorp Nomad homepage links (#567)
* Add nomad link to readme.
2019-04-03 23:08:26 -07:00
Yash Desai
750de3195d Resource manager: add service lister and remove unused lock. (#559)
* Remove unused lock from the resource manager.

* Add service lister to the resource manager.

This change adds a service lister in the
resource manager.
This will be used to set the service env vars.
Also added a List method to the resource manager
and a simple test to confirm it's a pass through.
2019-04-03 11:19:30 -07:00
Vipin Duleb
bab9c59ac8 GPU support in ACI provider (#563)
* GPU support in ACI provider
2019-04-02 18:11:35 -07:00
Brian Goff
1942522cf6 Add async provider pod status updates (#493)
This adds a new interface that a provider can implement which enables
async notifications of pod status changes rather than the existing loop
which goes through every pod in k8s and checks the status in the
provider.
In practice this should be significantly more efficient since we are not
constantly listing all pods and then looking up the status in the
provider.

For providers that do not support this interface, the old method is
still used to sync state from the provider.

This commit does not update any of the providers to support this
interface.
2019-04-01 09:07:26 -07:00
Kevin Zhao
5afb24809d Add OpenStack Zun provider(#22) (#239)
* Add Virtual Kubelet provider for OpenStack Zun

Initial virtual kubelet provider for OpenStack Zun. This provider
currently handles creating, starting and deleting a pod via OpenStack
Zun. Currently the configmap and secret is not support in Zun. Currently
the Volume is supported in Zun and will implementation the support in
virtual kubelet in next several patches.

Will add document to elaborate this development status.

Change-Id: Id80f18d89b22c535214aef95254f5c3c7ae23139
Signed-off-by: Kevin Zhao <kevin.zhao@arm.com>

* trying to fix dependencies

Change-Id: I8e6f2e0234a11591ff2be74e22dca1fb91bf8f47
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

* Add dummy ExecInContainer method

Change-Id: Idece5695bd81b0911538660526484895cdd8832c
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

* better use of fmt.Errorf

Change-Id: Ic402c80bd2302ac4f26b0025f110cbf9977ca862
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

* fix gofmt error

Signed-off-by: Kevin Zhao <kevinzs2048@gmail.com>

* add gophercloud vendor

Signed-off-by: Kevin Zhao <kevinzs2048@gmail.com>

* add provider register for openstack

Signed-off-by: Kevin Zhao <kevinzs2048@gmail.com>

* fix build error

Signed-off-by: Kevin Zhao <kevinzs2048@gmail.com>

* excluded aci test case

Signed-off-by: Kevin Zhao <kevinzs2048@gmail.com>

* Zun: several fixes on openstack provider

* Remove 'zunCapStatusToPodPhase' since it is not used anymore.
* Remove the handling of first container in capsule.
* Remove 'ApiVersion' from CapsuleTemplate

Signed-off-by: Hongbin Lu <hongbin034@gmail.com>

* Update gophercloud to latest

* Zun: use Zun API micro version 1.32

Signed-off-by: Hongbin Lu <hongbin034@gmail.com>

* Zun: wait for capsule to be deleted

Resource deletion in OpenStack Zun is asynchronous which means
the resource is not deleted immediately right after the delete request.
This commit make the provider wait for resource deletion to complete
on DeletePod.

Signed-off-by: Hongbin Lu <hongbin034@gmail.com>

* Change the build tag to openstack_provider

Signed-off-by: Hongbin Lu <hongbin034@gmail.com>
2019-03-28 18:27:57 -07:00
Brian Goff
947b530f1e Replace testify with gotest.tools (#553)
* vendor gotest.tools

* Run gotest.tools migration tools

* Fixup tests that were improperly converted

* Remove unused testify package vendors
2019-03-28 17:08:12 -07:00
Brian Goff
bf420eac41 Remove sfmesh provider (#550)
This is not being supported and as such it was requested (internally) to
be removed.
2019-03-28 09:01:06 -07:00
Sravan Rengarajan
ecc46e6c7d ACI readme updates 2 2019-03-27 12:25:57 -07:00
Sravan Rengarajan
eb040b1b1d ACI readme updates 2019-03-27 12:23:09 -07:00
Brian Goff
10430f0b7f Add node provider interfaace (#526)
This starts the work of having a `NodeProvider` which is responsible for
providing node details.
It splits the responsibilities of node management off to a new
controller.

The primary change here is to add the framework pieces for node
management and move the VK CLI to use this new controller.

It also adds support for node leases where available. This can be
enabled via the command line (disabled by default), but may fall back if
we find that leaess aren't supported on the cluster.
2019-03-25 15:02:40 -07:00
Zhengyi Lai
c898aefdcb Fix typo (#539)
Signed-off-by: Zhengyi Lai <zheng1@yunify.com>
2019-03-19 11:48:41 -07:00
Brian Goff
f8c51004d4 Support building an allow-list of providers (#527)
* Add providers subcommand to verify providers

Allows users to check what providers are available

* Fix version output to add new line

This command was totally broken until we moved around the call to
`initConfig()`, this just fixes the output now that it works.

* Flip boolean of provider include tags

All providers are still included by default and fix tags using the old
format.
2019-03-02 11:25:47 -08:00
Pires
a5d7400232 providers: remove hypersh provider (#524)
Hyper.sh was shutdown on Jan 16, 2019.
https://blog.hyper.sh/close_hyper_sh.html

Signed-off-by: Paulo Pires <pjpires@gmail.com>
2019-02-28 15:04:13 -08:00
Brian Goff
d19e8e5e27 Move aci client (#531)
* Add azure-aci client dep

* Use aci client from new repo
2019-02-25 17:15:25 -08:00
Brian Goff
1bfffa975e Make tracing interface to coalesce logging/tracing (#519)
* Define and use an interface for logging.

This allows alternative implementations to use whatever logging package
they want.

Currently the interface just mimicks what logrus already implements,
with minor modifications to not rely on logrus itself. I think the
interface is pretty solid in terms of logging implementations being able
to do what they need to.

* Make tracing interface to coalesce logging/tracing

Allows us to share data between the tracer and the logger so we can
simplify log/trace handling wher we generally want data to go both
places.
2019-02-22 11:36:03 -08:00
Ria Bhatia
4f3bd20e15 ACI docs & limitations (#502)
* adding limitations

* edits -1

* formatting

* making the docs usable :)
2019-01-15 13:05:30 -08:00
Robbie Zhang
b44d5b9f22 Add the new ACI regions (#487) 2019-01-07 16:22:53 -08:00
Anubhav Mishra
a46e1dd2ce Add HashiCorp Nomad provider (#483)
* provider: adding Nomad provider

* updating CONTRIBUTING.md with Nomad provider

* updated README.md by adding the Nomad provider

* fix typo

* adding nomad/api and nomad/testutil deps

* adding Nomad binary dependency for provider tests

* fixed the nomad binary download command step and added tolerations to the nomad provider.

* adding nomad provider demo gif

* adding my name to authors

* adding two missing go-rootcerts files after dep ensure

* delete pod comment
2019-01-07 11:48:11 -08:00
Robbie Zhang
f7afeba12e Remove the Restriction that No NSG should be set on the Subnet (#478) 2018-12-27 16:35:38 -08:00
Yue Zhang
d456ef816f fix: fix dead link (#480)
Signed-off-by: zhangyue <zy675793960@yeah.net>
2018-12-27 10:40:17 -08:00
muya-zj
e5c3d0104c [AlibabaCloud] Change alicloud to alibabacloud (#470) 2018-12-26 06:42:56 -08:00
shidao-ytt
966f7a807b remove cpu mem limits of container (#429) 2018-12-21 13:38:41 -08:00
Ria Bhatia
a4c73dd03a adding virtual node docs (#454) 2018-12-14 13:40:05 -08:00
Bruno Miguel Custodio
34b356ee5f mock: do not panic on unknown pods
Signed-off-by: Bruno Miguel Custodio <brunomcustodio@gmail.com>
2018-12-12 12:07:45 +00:00