Skip to content

chore: add Helm Chart #58

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

Merged
merged 4 commits into from
Dec 14, 2024
Merged

chore: add Helm Chart #58

merged 4 commits into from
Dec 14, 2024

Conversation

kahirokunn
Copy link
Contributor

@kahirokunn kahirokunn commented Aug 29, 2024

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 kind for development and testing.

Quick Start

To quickly get started with a local Kubernetes setup using kind:

  1. Install kind:
brew install kind
  1. Create a local Kubernetes cluster:
kind create cluster
  1. Install the cache server with Helm:
helm upgrade --install cache -n github-actions --create-namespace --set fullnameOverride=cache install/kubernetes/github-actions-cache-server
  1. 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:

  1. Update the Chart.yaml Version:
    Before packaging the Helm chart, ensure that the version field in the Chart.yaml file 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.

  1. Package the Helm Chart:
    Once the Chart.yaml is 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.

  1. Push the Helm Chart to the OCI Registry:
    After packaging, use the helm push command to upload the packaged Helm chart to the OCI registry. Make sure to use the correct version number that matches the one in Chart.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!

@DrJume
Copy link
Collaborator

DrJume commented Aug 29, 2024

Thank you! ❤️ What a nice idea. I can look into it this Sunday.

@kahirokunn
Copy link
Contributor Author

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! 🌟

@matteovivona
Copy link

matteovivona commented Sep 19, 2024

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

@kahirokunn
Copy link
Contributor Author

@matteovivona
I changed it so that you can change the strategy.
It is Recreate by default.

Copy link
Collaborator

@DrJume DrJume left a comment

Choose a reason for hiding this comment

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

@kahirokunn, I'm very sorry for the delay 😔

The last couple of months were very full and I didn't find the time to look into Helm Charts, as I'm quite new to this subject.

In the future, it might be good to include instructions in our docs for installing the Helm Chart via a URL to the GitHub Repo.

Thank you very much for your contribution to making it easier to install github-actions-cache-server on k8s.
Also thanks to @helletheone (who definitely has more experience than me) for reviewing this PR.

@DrJume DrJume changed the title feat: add Helm chart for GitHub Actions cache server chore: add Helm Chart Dec 14, 2024
@DrJume DrJume merged commit 94685f5 into falcondev-oss:dev Dec 14, 2024
12 checks passed
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.

4 participants