Skip to content

Custom Kubernetes controller designed to view VMs using kubectl

License

Notifications You must be signed in to change notification settings

paaloeye/uks-controller

Repository files navigation

uks-controller

A custom Kubernetes controller that provides seamless integration with the UpCloud API, allowing you to manage UpCloud Virtual Machines directly through kubectl.

Features

  • View and monitor UpCloud VMs using standard Kubernetes tooling
  • Prometheus metrics integration for monitoring sync status
  • Configurable sync interval
  • Detailed logging with multiple verbosity levels

Quickstart

Pull vendored upcloud-go-api

git submodule update --recursive

Build and run it locally

make install run

Configuration

Syncing interval can be configured by --sync-interval parameter when the controller is started. By default, VMs are being synced every 15 seconds.

Implementation

Number of currently syncing UpCloud VMs are available via Prometheus interface (metric name: virtual_machine_syncing_vms).

Further development

  • Unit testing
  • Kubernetes events
  • Enable metrics protection

Logging

  • V=1 - we want always see it
  • V=2 - a bit more verbosity
  • V=3 - we are debugging the controller, loads of big structures shall we logged

The logging itself is controller by -zap-log-level argument, e.g. -zap-log-level=3 gives you plenty of information on state changes.

Assumptions

UpCloud API credentials are set in os.Environ

Observations

  • Creating Machine API Key isn't straight-forward
  • Creating a sub-user
    • Create subaccount
      • is grayed out without any explanation unless free trial is started (shall indicate what's wrong)
  • Having UpCloudLtd as a github org name makes a path like this /go/pkg/mod/github.com/!up!cloud!ltd. Those ! make life a bit worse. Try to cd to this directory. And do it again.

References

Licence

Licensed under the Mozilla Public License 2.0 (MPL-2.0). See LICENCE for details and legal TL;DR.

About

Custom Kubernetes controller designed to view VMs using kubectl

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published