Git Product home page Git Product logo

k8s-self-hosted-runners's Introduction

k8s-self-hosted-runners

Kubernetes Community Days Guatemala - Self-hosted GitHub Actions runners using Kubernetes.

  1. Create GitHub organization - kcd-guatemala.

  2. Create repo in org as k8s-self-hosted-runners into new organization.

  3. Push code to new repo adding new remote.

        git remote set-url origin [email protected]:kcd-guatemala/k8s-self-hosted-runners.git
        git remote set-url --push origin [email protected]:kcd-guatemala/k8s-self-hosted-runners.git
        git branch -M main
        git push -u origin main
  4. Launch hello-world GitHub Action on GitHub cloud manually.

  5. Create GitHub Personal Access Token with following permissions:

    • repo (full access)
    • workflow (full control)
    • admin:org (full access)
    • admin:public_key (read: public_key)
    • admin:repo_hook (read:repo_hook)
    • admin:org_hook (full control)
    • notifications (full control)
  6. Clone new repository and open it in VS Code.

  7. Create a local kind cluster in your laptop.

        kind create cluster
  8. Install the cert-manager Helm chart.

        helm repo add jetstack https://charts.jetstack.io
    
        helm upgrade --install \
        cert-manager jetstack/cert-manager \
        --namespace cert-manager \
        --create-namespace \
        --version v1.6.1 \
        --set installCRDs=true
  9. Install the actions-runner-controller Helm chart.

        helm repo add actions-runner-controller \
        https://actions-runner-controller.github.io/actions-runner-controller
    
        helm upgrade --install \
        actions-runner-controller \
        actions-runner-controller/actions-runner-controller \
        --namespace actions-runner-system \
        --create-namespace \
        --set authSecret.create=true \
        --set authSecret.github_token=<TOKEN>
  10. Create the repository runner.

        kubectl apply -f runners/repo-runner.yaml
  11. Modify the runs-on field of the hello-world GitHub Action to self-hosted.

  12. Launch hello-world GitHub Action which runs inside kind cluster.

  13. Delete the repository runner.

  14. Trigger the hello-world GitHub Action. Will be enqueued and waiting for a runner.

  15. Create the runner to use in the existing repository again and show how the action is running in the runner again.

  16. Create another repository with a README and create and trigger the hello-world GitHub Action. Will be enqueued and waiting for a runner.

  17. Delete the repository runner and create the organization runner.

        kubectl apply -f runners/org-runner.yaml
  18. Both actions will be running in the organization runner.

  19. Comment enterprise runner.

  20. Delete organization runner and create the deployment runner for the organization.

        kubectl apply -f runners/deployment-runner.yaml
  21. Create the HRA - more available options in the docs. Remove replicas from the deployment runner.

        kubectl apply -f runners/hra.yaml
  22. Comment runner labels.

  23. Comment runner groups for enterprise plan.

  24. Stateful Runners.

  25. Usage limits.

  26. Billing minutes.

References

k8s-self-hosted-runners's People

Contributors

guillermotti avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.