Commit Graph

49 Commits

Author SHA1 Message Date
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
Brian Goff
449eb3bb7d Fix exec parameter parsing (#580)
Exec seems to be broken by ad6fbba806
This change basically copies what's in remotecommand.NewOptions, just
without the logging.
2019-04-25 15:51:53 -07:00
Brian Goff
8d0b843ae4 Refactor CLI initialization (#562)
This cleans up the CLI code significantly.
Also makes some of this re-usable for providers who want to do so.

This also removes the main.go from the top of the tree of the repro,
instead moving it into cmd/virtual-kubelet.
This allows us to better utilize the package namespace (and e.g. mv the
`vkubelet` package to the top of the tree).
2019-04-19 17:02:39 -07:00
Yash Desai
de32752395 Set container env var using services. (#573)
* Introduce service env vars.
2019-04-17 11:30:39 -07:00
Yash Desai
85292ef4ef Patch the node status instead of updating it. (#557)
* Patch the node status instead of updating it.

Virtual-kubelet updates the node status periodically.
This change proposes we use the `Patch` API instead of `Update`,
to update the node status.
This avoids overwriting any node updates made by other controllers
in the system, for example a attach-detach controller.
Patch API does a strategic merge instead of overwriting
the entire object, which ensures parallel updates don't overwrite
each other.

Note: `PatchNodeStatus` reduces the time precision to the seconds-level
and therefore I corrected the test for this.

consider two controllers:
CONTROLLER 1 (virtual kubelet)                       | CONTROLLER 2
oldNode := nodes.Get(nodename)                       |
                                                     | node := nodes.Get(nodename)
                                                     | // update status with attached volumes info
                                                     | updateNode := Nodes.UpdateStatus(node)
// update vkubelet info on node status               |
latestNode := Nodes.UpdateStatus(oldNode)            |
<-- latestNode does not contain the volume info added by second controller.

with my patch change:

CONTROLLER 1 (virtual kubelet)                       | CONTROLLER 2
oldNode := Nodes.Get(nodename)                       |
                                                     | node := Nodes.Get(nodename)
                                                     | // update status with attached volumes info
                                                     | updateNode := Nodes.UpdateStatus(node)
node := oldNode.DeepCopy()                           |
// update vkubelet info on node status               |
latestNode := util.PatchNodeStatus(oldNode, node)    |
<-- latestNode contains the volume info added by second controller.

Testing Done: make test

* Introduce PatchNodeStatus into vkubelet.

* Pass only the node interface.
2019-04-03 10:40:57 -07:00
Vipin Duleb
bab9c59ac8 GPU support in ACI provider (#563)
* GPU support in ACI provider
2019-04-02 18:11:35 -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
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
Vineeth Reddy
5cea3e7ea8 FieldRef feature for DownwardAPI (#534)
* FieldRef feature for DownwardAPI

Signed-off-by: VineethReddy02 <vineethpothulapati@outlook.com>

* Unit tests for FieldRef

Signed-off-by: VineethReddy02 <vineethpothulapati@outlook.com>
2019-03-08 11:15:08 -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
d3b1401fef Fix azure-aci vendor commit (#532)
The tag was re-created since I force-pushed to fix up some issues with
moving git history over (b/c I originally did not move with git
history).
2019-02-25 20:35:57 -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
d8736e23f5 Bump crypto package. (#492)
This fixes master build for certain CPU's.
See https://github.com/golang/crypto/commit/ae8bce0
2019-01-08 12:30:18 -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
Paulo Pires
5a0093ce31 vkubelet: set kubelet version to build version (#446)
* deps: bump to Kubernetes 1.13.1

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* version: new VK version

Signed-off-by: Paulo Pires <pjpires@gmail.com>
2018-12-18 17:08:23 -08:00
Paulo Pires
6f04b3102c deps: update dependencies
Signed-off-by: Paulo Pires <pjpires@gmail.com>
2018-12-15 11:01:41 +00:00
Paulo Pires
28a757f4da use shared informers and workqueue (#425)
* vendor: add vendored code

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* controller: use shared informers and a work queue

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* errors: use cpuguy83/strongerrors

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* aci: fix test that uses resource manager

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* readme: clarify skaffold run before e2e

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* cmd: use root context everywhere

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* sync: refactor pod lifecycle management

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* e2e: fix race in test when observing deletions

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* e2e: test pod forced deletion

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* cmd: fix root context potential leak

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* sync: rename metaKey

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* sync: remove calls to HandleError

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* Revert "errors: use cpuguy83/strongerrors"

This reverts commit f031fc6d.

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* manager: remove redundant lister constraint

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* sync: rename the pod event recorder

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* sync: amend misleading comment

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* mock: add tracing

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* sync: add tracing

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* test: observe timeouts

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* trace: remove unnecessary comments

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* sync: limit concurrency in deleteDanglingPods

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* sync: never store context, always pass in calls

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* sync: remove HandleCrash and just panic

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* sync: don't sync succeeded pods

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* sync: ensure pod deletion from kubernetes

Signed-off-by: Paulo Pires <pjpires@gmail.com>
2018-11-30 15:53:58 -08:00
Paulo Pires
579823e6a5 tests: introduce e2e suite (#422)
* mock: implement GetStatsSummary

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* make: use skaffold to deploy vk

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* test: add an e2e test suite

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* test: add vendored code

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* docs: update README.md

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* ci: run e2e on circleci

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* make: improve the skaffold target

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* e2e: fix defer pod deletion

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* e2e: improve instructions

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* makefile: default shell is bash

Signed-off-by: Paulo Pires <pjpires@gmail.com>
2018-11-28 09:01:36 -08:00
tariqibrahim
bf61f7f2e0 Replace dep validation with dep check and resyncing Gopkg.lock 2018-11-14 14:12:29 -08:00
Brian Goff
143d9f71cc Add ocagent exporter
ocagent allows users to send traces out of VK to a "standard"  external forwarder
(standard as in this is a format/protocol defined in the opencensus project).

This allows uers to implement metrics for whatever backend they want
without having to add it into VK directly.
2018-10-31 14:31:13 -07:00
Robbie Zhang
4a7b74ed42 [VK] Use Cache controller and Make create/delete pod Concurrently (#373)
* Add k8s.io/client-go/tools/cache package

* Add cache controller

* Add pod creator and terminator

* Pod Synchronizer

* Clean up

* Add back reconcile

* Remove unnecessary space in log

* Incorprate feedbacks

* dep ensure

* Fix the syntax error

* Fix the merge errors

* Minor Refactor

* Set status

* Pass context together with the pod to the pod channel

* Change to use flag to specify the number of pod sync workers

* Remove the unused const

* Use Stable PROD Region WestUS in Test

EastUS2EUAP is not reliable
2018-10-16 17:20:02 -07:00
robbiezhang
eb77d5686f Update the network sdk and add more validations 2018-10-13 00:16:19 +00:00
robbiezhang
5a00c27b9c Update kubernetes projects version in vendor to 1.12.1 2018-10-06 00:53:39 +00:00
Brian Goff
8e29415bf7 Convert errors to OC status 2018-09-26 13:48:40 -07:00
Brian Goff
682b2bccf8 Add support for tracing via OpenCencus
This adds a few flags for configuring the tracer.
Includes support for jaeger tracing (built into OC).
2018-09-26 13:48:40 -07:00
Robbie Zhang
87acc00457 Merge branch 'master' into alicloud-eci 2018-09-24 12:33:19 -07:00
shidao-ytt
101baecc86 Add Alibaba Cloud ECI SDK
Alibaba Cloud ECI(Elastic Container Instance) is a service that allow you
run containers without having to manage servers or clusters.

This commit add ECI sdk for virtual kubelet.

Signed-off-by: xianwei.zw <xianwei.zw@alibaba-inc.com>
Signed-off-by: shidao.ytt <shidao.ytt@alibaba-inc.com>
2018-09-23 23:29:06 +08:00
Brian Goff
74f76c75d5 Instrustment handlers for logging/error handling
This refactors a bit of the http handler code.
Moves error handling for handler functions to a generic handler.
This also has a side-effect of being able to propagate errors from the
provider to send the correct status code, provided the error type
matches a pre-defined interface.
2018-09-17 16:54:24 -07:00
Brian Goff
25e454d18f Add API client for Azure custom vnet (#271)
* Update vendor for azure vent support

* Add support for Azure custom vnets.

Use pointers intead of values. This allows the client to pass back
returned data from Azure.
2018-09-07 18:46:49 -07:00
Brian Goff
e8abca0ac9 Add supports for stats in ACI provider
This adds a new, optional, interface for providers that want to provide
stats.
2018-08-17 17:03:25 -07:00
Brian Goff
6284757aa1 Add errgroup dep which will be used for ACI stats 2018-08-17 16:55:18 -07:00
Brian Goff
17cc3033ba Update kubelet vendor to pull in stats API 2018-08-17 16:55:18 -07:00
Jeremy Rickard
a163bde2af Updated with a new version of dep 2018-08-03 18:02:57 -06:00
Jeremy Rickard
636b4120f1 Update dependencies to add service fabric mesh via new azure-sdk-go 2018-08-03 11:57:00 -06:00
Lawrence Gripper
d6e8b3daf7 Create a provider to use Azure Batch (#133)
* Started work on provider

* WIP Adding batch provider

* Working basic call into pool client. Need to parameterize the baseurl

* Fixed job creation by manipulating the content-type

* WIP Kicking off containers. Dirty

* [wip] More meat around scheduling simple containers.

* Working on basic task wrapper to co-schedule pods

* WIP on task wrapper

* WIP

* Working pod minimal wrapper for batch

* Integrate pod template code into provider

* Cleaning up

* Move to docker without gpu

* WIP batch integration

* partially working

* Working logs

* Tidy code

* WIP: Testing and readme

* Added readme and terraform deployment for GPU Azure Batch pool.

* Update to enable low priority nodes for gpu

* Fix log formatting bug. Return node logs when container not yet started

* Moved to golang v1.10

* Fix cri test

* Fix up minor docs Issue. Add provider to readme. Add var for vk image.
2018-06-22 16:33:49 -07:00
Robbie Zhang
6ec1098bb8 Fix the dependency issue (#231) 2018-06-21 12:09:42 -07:00
Loc Nguyen
513cebe7b7 VMware vSphere Integrated Containers provider (#206)
* Add Virtual Kubelet provider for VIC

Initial virtual kubelet provider for VMware VIC.  This provider currently
handles creating and starting of a pod VM via the VIC portlayer and persona
server.  Image store handling via the VIC persona server.  This provider
currently requires the feature/wolfpack branch of VIC.

* Added pod stop and delete.  Also added node capacity.

Added the ability to stop and delete pod VMs via VIC.  Also retrieve
node capacity information from the VCH.

* Cleanup and readme file

Some file clean up and added a Readme.md markdown file for the VIC
provider.

* Cleaned up errors, added function comments, moved operation code

1. Cleaned up error handling.  Set standard for creating errors.
2. Added method prototype comments for all interface functions.
3. Moved PodCreator, PodStarter, PodStopper, and PodDeleter to a new folder.

* Add mocking code and unit tests for podcache, podcreator, and podstarter

Used the unit test framework used in VIC to handle assertions in the provider's
unit test.  Mocking code generated using OSS project mockery, which is compatible
with the testify assertion framework.

* Vendored packages for the VIC provider

Requires feature/wolfpack branch of VIC and a few specific commit sha of
projects used within VIC.

* Implementation of POD Stopper and Deleter unit tests (#4)

* Updated files for initial PR
2018-06-04 15:41:32 -07:00
Kit Ewbank
b4cb809968 dep ensure -update k8s.io/client-go (#197) 2018-05-18 16:24:19 -07:00
Ben Corrie
c6c89f062f CRI Provider implementation (#195)
* First commit of CRI provider. Vendor deps not included

* First commit of CRI provider. Vendor deps not included

* Tidy up comments and format code

* vendor grpc, CRI APIs, update protobuf and tidy logging

* First commit of CRI provider. Vendor deps not included

* Tidy up comments and format code

* vendor grpc, CRI APIs, update protobuf and tidy logging

* Add README

* Fix errors in make test
2018-05-15 08:50:52 -07:00
Onur Filiz
8d67098d06 Vendor aws-sdk-go (dep ensure) (#178) 2018-04-27 18:18:36 -07:00
Jimmy Xu
38ed39448a [fix-hypercli-vendor] update hypercli dependency to github.com/Azure/go-ansiterm (#134) 2018-04-20 10:18:08 -07:00
Robbie Zhang
2b85b0d1df Fill in Default Values for CPU/Memory (#130)
Update k8s client and the dependencies
ACI client change for Mocking
Add ACI Provider Mock Tests
Add the Windows development environment
Add UT for Default Resource Requests
Enable the make test in Docker file
Update the vendors
2018-04-16 10:31:16 -07:00
robbiezhang
d27616776c Fix the dep on cenkalti 2018-01-20 02:31:58 +00:00
Robbie Zhang
77d0687688 Update the vendor folder (#53)
* Update the vendor folder

* Update the Gopkg.lock by running dep ensure
2018-01-05 11:22:17 -08:00
Rita Zhang
43137d09f7 Use mux to handle req; get tail from req 2017-12-21 21:42:05 -08:00
Ria Bhatia
0075e5b0f3 Initial commit 2017-12-05 17:53:58 -06:00