Experience seamless CI/CD integration with AbsaOSS/k3d-action. Create lightweight, ephemeral Kubernetes clusters tailored to your project's needs. Customize your k3s environment, utilize private registries, and run multiple clusters. Ensure reliability and performance of your applications under any load—make testing easier and more efficient.
k3d-action is a powerful GitHub Action designed to effortlessly manage lightweight, ephemeral Kubernetes clusters within your CI/CD workflows. This action empowers developers and DevOps teams to run fully customizable embedded k3s clusters, complete with support for private image registries and the capability to create multiple clusters simultaneously.
Key Features
- Customizable Clusters: Tailor your embedded k3s clusters according to your project’s specific requirements, ensuring optimal testing and development environments.
- Multi-Cluster Support: Easily set up and manage several clusters at once, making your testing processes more efficient and comprehensive.
- Private Image Registry: Avoid the hassle of pushing images to a remote registry by importing your built images directly into your clusters.
Introduction
Testing applications built on Kubernetes can be complex, particularly for end-to-end testing of microservices and controllers. k3d-action simplifies this process by allowing you to verify the functionality of your applications under various scenarios, including high loads and resource failures. For example, this action is perfect for performing operator tests on projects like AbsaOSS/k8gb.
Learn how to utilize k3d-action in your CI/CD pipeline in this comprehensive tutorial by Viktor Farcic.
Quick Start
To get started, include k3d-action in your workflow. Here's a minimal configuration example for creating a single cluster:
- uses: AbsaOSS/k3d-action@v2
name: "Create Single Cluster"
with:
cluster-name: "test-cluster-1"
args: --agents 1
This setup will create a cluster with One worker node and a default load balancer. For advanced configurations or multi-cluster setups, simply modify the args
parameter as per your requirements.
Config File Support
From version 1.2.0, you can configure the action using external config files, allowing for a more flexible and shareable setup for both local and k3d-action testing environments. Example config usage:
- uses: ./
name: "Create single k3d Cluster"
with:
cluster-name: "test-cluster-1"
args: >-
--agents 1
--config=<path to config yaml>
Efficient Testing with Image Import
For integrated testing, there's no need for continuous remote pushes. You can build your application and import images directly into your created cluster:
docker build . -t <repository>:<semver>
k3d image import <repository>:<semver> -c <cluster-name>
This method enhances testing efficiency as it circumvents the need for remote image uploads and enables faster development cycles.
Elevate your Kubernetes development and testing experience with k3d-action! For comprehensive details and advanced configurations, refer to the repository's documentation.