Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new dev/test environment #414

Merged
merged 14 commits into from
Apr 6, 2023
Merged

feat: new dev/test environment #414

merged 14 commits into from
Apr 6, 2023

Conversation

samcday
Copy link
Contributor

@samcday samcday commented Apr 6, 2023

This PR simplifies and unifies the process of bringing up a hcloud k8s environment that is suitable for development/testing purposes. It builds off the work originally started in hetznercloud/csi-driver#226

The central script is hack/dev-up.sh. The script requires a HCLOUD_TOKEN, and will build a 1+ k8s cluster using k3sup + hcloud CLI tools. It's typically quite fast: a cold execution of the script should take less <1min before a fully operational cluster is ready for use.

The dev-down.sh script will delete all resources created by dev-up.sh.

One of the primary objectives in this work was to simplify the e2e testing process. Julian and I decided to remove the matrix of kubeadm clusters, and also remove flannel as an option for CNI. Instead, our test suite now runs on the latest 3 stable releases of k3s. Further, the option to create a cluster with/without hcloud networking support has been removed. Created clusters always have a network and an install of Cilium configured for direct routing mode (traffic bound for pods on other nodes is handed to hcloud network fabric).

Skaffold is plumbed into the e2e test pipelines on GitHub. This way, the process of building and deploying a test build of hccm to a cluster is unified for development and test.

Once this work has landed and stabilized here, we expect to package it up a bit further and use it in csi-driver and anywhere else we operate Kubernetes integrations that need automated testing.

hack/dev-up.sh Show resolved Hide resolved
WaitForHTTPOnServer(t, testCluster.setup.ExtServer, testCluster.setup.privKey, pod.Status.PodIP, false)

nwTest.TearDown()
network, _, err := testCluster.hcloud.Network.Get(context.TODO(), testCluster.scope)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depending on the timing and execution order of the tests the hccm might not have setup the routes yet. To avoid any flaky tests we should poll for this condition.

Might be something for a follow up PR though.

hack/dev-up.sh Outdated Show resolved Hide resolved
hack/dev-up.sh Outdated Show resolved Hide resolved
@samcday samcday marked this pull request as ready for review April 6, 2023 13:25
@samcday samcday requested a review from a team as a code owner April 6, 2023 13:25
@samcday samcday merged commit 8f976b1 into main Apr 6, 2023
@samcday samcday deleted the dev-env branch April 6, 2023 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants