diff --git a/ci/cluster/akamai/README.md b/ci/cluster/akamai/README.md new file mode 100644 index 0000000..41f7c57 --- /dev/null +++ b/ci/cluster/akamai/README.md @@ -0,0 +1,62 @@ +# Akamai Provider for CNCF Self-Hosted Runners (PoC) + +This directory contains automation tools and configurations for deploying and managing CNCF GitHub self-hosted runners on Akamai infrastructure. + +> **Note:** This implementation is currently in Proof of Concept (PoC) stage. + +## Overview + +The Akamai provider enables CNCF projects to leverage Akamai's cloud infrastructure for running CI/CD workflows with GitHub Actions. These self-hosted runners offer enhanced performance, customized environments, and dedicated resources tailored to CNCF project needs. + +This automation specifically provisions and manages **Linode managed Kubernetes clusters** and deploys **Actions Runner Controller (ARC)** to handle GitHub Actions workloads efficiently. + +## Features + +- Automated provisioning of managed Kubernetes clusters on Linode +- Deployment and configuration of Actions Runner Controller (ARC) +- Runner configuration and registration with GitHub +- Auto-scaling capabilities based on workflow demand +- Monitoring and maintenance utilities +- Support for multiple GitHub organizations and repositories + +## Prerequisites + +- Akamai cloud account with appropriate permissions +- Linode API credentials for Kubernetes cluster management +- Service account credentials configured for automation +- GitHub Personal Access Token (PAT) with appropriate permissions + +## Configuration + +Configuration is managed through environment variables and config files: + +- `AKAMAI_API_KEY`: API key for accessing Akamai services +- `AKAMAI_API_SECRET`: API secret for authentication +- `LINODE_API_TOKEN`: API token for Linode Kubernetes service +- `GITHUB_PAT`: GitHub Personal Access Token for runner registration + +See the sample configuration file in `config-example.yaml` for detailed settings. + +## Usage + +Detailed usage instructions for provisioning and managing runners are coming soon. + +### Proof of Concept Deployment + +This PoC uses an intentionally cost-effective setup with spot instances to demonstrate the functionality at minimal expense. The configuration is not intended for production use without appropriate adjustments. + +## Kubernetes Deployment + +This provider automatically: +1. Creates a Kubernetes cluster in Linode +2. Installs and configures Actions Runner Controller using Helm +3. Sets up runner scale sets for GitHub repositories/organizations +4. Configures auto-scaling based on workflow demand + +## Troubleshooting + +Common issues and their solutions will be documented as they are encountered. + +## Contributing + +Contributions to improve the Akamai provider are welcome! Please follow the contributing guidelines in the root of this repository. diff --git a/ci/cluster/akamai/SETUP.md b/ci/cluster/akamai/SETUP.md new file mode 100644 index 0000000..106a11e --- /dev/null +++ b/ci/cluster/akamai/SETUP.md @@ -0,0 +1,134 @@ +# Setting Up Linode Kubernetes Engine with OpenTofu + +This guide walks you through deploying a Linode Kubernetes Engine (LKE) cluster using OpenTofu. + +## Prerequisites + +- [OpenTofu](https://opentofu.org/docs/intro/install/) installed +- Linode account with API token +- GitHub Personal Access Token with appropriate permissions + +## Installation Steps + +### 1. Install OpenTofu + +If you haven't already installed OpenTofu, follow these instructions: + +```bash +# For Linux/macOS +brew install opentofu/tap/opentofu + +# Alternatively, you can download directly from the releases +# https://github.com/opentofu/opentofu/releases +``` + +### 2. Configure Environment Variables + +Create a `.env` file (which is ignored by git) to store your sensitive credentials: + +```bash +# Create and edit .env file +touch .env +``` + +Add the following content to the `.env` file: + +``` +export TF_VAR_linode_api_token="your-linode-api-token" +export TF_VAR_github_token="your-github-pat" +``` + +Source the environment variables: + +```bash +source .env +``` + +### 3. Initialize OpenTofu + +```bash +cd ci/cluster/akamai +tofu init +``` + +This will download the necessary providers defined in the configuration. + +### 4. Review the Execution Plan + +```bash +tofu plan +``` + +This will show you what resources will be created without actually creating them. + +### 5. Apply the Configuration + +When you're ready to create the cluster: + +```bash +tofu apply +``` + +Review the planned changes and type `yes` to confirm. + +### 6. Access Your Kubernetes Cluster + +After successful deployment, OpenTofu will generate a `kubeconfig.yaml` file in the current directory: + +```bash +export KUBECONFIG=$(pwd)/kubeconfig.yaml +kubectl get nodes +``` + +### 7. Verify Actions Runner Controller Installation + +Check that ARC is running in the cluster: + +```bash +kubectl -n arc-system get pods +``` + +### 8. Create Runner Scale Sets + +After ARC is installed, you can create runner scale sets for your GitHub organizations or repositories: + +```bash +kubectl apply -f - <