Skip to content

hetznercloud/hcloud-cloud-controller-manager

Repository files navigation

Kubernetes Cloud Controller Manager for Hetzner Cloud

e2e tests Codecov

The Hetzner Cloud cloud-controller-manager integrates your Kubernetes cluster with the Hetzner Cloud & Robot APIs.

Docs

For more information, see the documentation.

Development

Setup a development environment

To set up a development environment, make sure you installed the following tools:

  1. Configure a HCLOUD_TOKEN in your shell session.

Warning

The development environment runs on Hetzner Cloud servers which will induce costs.

  1. Deploy the development cluster:
make -C dev up
  1. Load the generated configuration to access the development cluster:
source dev/files/env.sh
  1. Check that the development cluster is healthy:
kubectl get nodes -o wide
  1. Start developing hcloud-cloud-controller-manager in the development cluster:
skaffold dev

On code change, skaffold will rebuild the image, redeploy it and print all logs.

⚠️ Do not forget to clean up the development cluster once are finished:

make -C dev down

Run the unit tests

To run the unit tests, make sure you installed the following tools:

  1. Run the following command to run the unit tests:
go test ./...

Run the kubernetes e2e tests

Before running the e2e tests, make sure you followed the Setup a development environment steps.

  1. Run the kubernetes e2e tests using the following command:
source dev/files/env.sh
go test ./tests/e2e -tags e2e -v

Development with Robot

If you want to work on the Robot support, you need to make some changes to the above setup.

This requires that you have a Robot Server in the same account you use for the development. The server needs to be setup with the Ansible Playbook dev/robot/install.yml and configured in dev/robot/install.yml.

  1. Set these environment variables:
export ROBOT_ENABLED=true

export ROBOT_USER=<Your Robot User>
export ROBOT_PASSWORD=<Your Robot Password>
  1. Continue with the environment setup until you reach the skaffold step. Run skaffold dev --profile=robot instead.

  2. We have another suite of tests for Robot. You can run these with:

go test ./tests/e2e -tags e2e,robot -v

License

Apache License, Version 2.0

About

Kubernetes cloud-controller-manager for Hetzner Cloud

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages