feat: add Helm chart for GitHub Actions cache server
feat: Add Helm Chart for GitHub Actions Cache Server
This PR introduces a Helm chart for deploying a GitHub Actions cache server on Kubernetes. With this addition, setting up a local or production-ready cache server for GitHub Actions becomes straightforward and easily manageable via Kubernetes.
Key Features
- Helm Chart: Simplifies the deployment process of the GitHub Actions cache server onto any Kubernetes cluster.
-
Namespace Support: The chart installs the cache server into a dedicated namespace (
github-actions) to ensure clean and organized deployments. -
Local Development: Supports easy local Kubernetes cluster setups with
kindfor development and testing.
Quick Start
To quickly get started with a local Kubernetes setup using kind:
-
Install
kind:
brew install kind
- Create a local Kubernetes cluster:
kind create cluster
- Install the cache server with Helm:
helm upgrade --install cache -n github-actions --create-namespace --set fullnameOverride=cache install/kubernetes/github-actions-cache-server
- Access the Cache Server Locally: Run the following commands to forward the cache server port to your local machine:
export POD_NAME=$(kubectl get pods --namespace github-actions -l "app.kubernetes.io/name=github-actions-cache-server,app.kubernetes.io/instance=cache" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace github-actions $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
kubectl --namespace github-actions port-forward $POD_NAME 3000:$CONTAINER_PORT
Releasing a New Helm Chart
To release a new version of the Helm chart, follow these steps:
-
Update the
Chart.yamlVersion: Before packaging the Helm chart, ensure that theversionfield in theChart.yamlfile is updated to the new release version. For example:
apiVersion: v2
name: github-actions-cache-server
version: 0.1.0 # Update this version
Make sure to replace 0.1.0 with the new version number for the release.
-
Package the Helm Chart:
Once the
Chart.yamlis updated, package the Helm chart by navigating to the directory containing your Helm chart and running the following command:
helm package install/kubernetes/github-actions-cache-server
This will create a .tgz package file for your Helm chart.
-
Push the Helm Chart to the OCI Registry:
After packaging, use the
helm pushcommand to upload the packaged Helm chart to the OCI registry. Make sure to use the correct version number that matches the one inChart.yaml:
helm push github-actions-cache-server-0.1.0.tgz oci://ghcr.io/falcondev-oss
Replace 0.1.0 with the actual version number you're releasing.
Ensure you have the appropriate permissions to push to the specified OCI registry.
Notes
- This setup is ideal for local development and testing. For production environments, please adjust the Helm install command and configurations according to your specific needs.
- Feedback and contributions are welcome to enhance this chart further!
Looking forward to your reviews and suggestions!
Thank you! ❤️ What a nice idea. I can look into it this Sunday.
Thank you so much! 😊 I'm thrilled that you liked the idea. Looking forward to your feedback after the weekend. Have a fantastic Sunday, and thanks again for taking the time to check it out! 🌟
FYI, I attempted to use this helm template and I found several issues:
- ENOENT issues with tmp ephemeral volume and "non root” securityContext
- If persistentVolumeClaim was enabled, pods can't scale because they are using the same PVC, and it happens that they do not detach properly. So I would remove all scaling logic with HPA and propose a rollingStrategy like Recreate
@matteovivona I changed it so that you can change the strategy. It is Recreate by default.