* 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.
* 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.
The build needs bash in order to process build tags correctly. Alpine
doesn't come with bash... Debian comes with all the things we need out
of the box, so let's just use that.
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.
* 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>
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.
* 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.
* 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.
* 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