Commit Graph

7 Commits

Author SHA1 Message Date
Sargun Dhillon
59d021f644 Fix being able to set the VK's listening port 2019-05-08 17:18:42 -07:00
Sargun Dhillon
2497028659 Add the ability to configure klog from VK (#595)
All of Kubernetes logging is based on klog. Klog currently does
not output any logging information to logrus, so you're flying
somewhat blind to Kubernetes internals.

This exposes the full set of configurables that klog offers,
but decorates (prefixes) the klog configuration with "klog".
2019-05-08 11:37:04 +01:00
Sargun Dhillon
6d49bb981c Do not swallow errors from the zpages server silently
If the zpages server exits for any reason, or is unable to bind,
rather than exiting silently, throw an error.
2019-05-06 11:10:17 -07:00
Sargun Dhillon
764cb5a76e Add the concept of startup timeout (#597)
This adds two concepts, where one encompasses the other.

Startup timeout
Startup timeout is how long to wait for the entire kubelet
to get into a functional state. Right now, this only waits
for the pod informer cache for the pod controllerto become
in-sync with API server, but this could be extended to other
informers (like secrets informer).

Wait For Startup
This changes the behaviour of the virtual kubelet to wait
for the pod controller to start before registering the node.

It is to avoid the race condition where the node is registered,
but we cannot actually do any pod operations.
2019-05-06 09:25:00 -07:00
Sargun Dhillon
4b0c6815eb Stop using deprecated method Clientset.Coordination (#581)
Clientset.Coordination is deprecated. We are meant to use the specific
version of the client: CoordinationV1beta1. Clientset.Coordination is
going to be removed in future versions of the client API.
2019-04-23 14:17:15 -07:00
Brian Goff
ed5f478b9b Don't set cancel function to nil on error (#579)
When setting up the http server we return a cancel function to close all
the listeners down.
The issue here is we set the cancel function to nil and thereby cause a
panic when there is an error and the `defer` attempts to call cancel.

This fix just don't set a named return value for the cancel function to
make sure we don't overwrite it with a `return nil, err`.
This ensures that the `defer` can still call `cancel()`.
2019-04-22 10:31:06 -07:00
Brian Goff
57e8ee4b51 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