How to k8s deploy to a minikube that runs in github codespaces?

475 Views Asked by At

Context

I've installed minikube in github codespaces, and that works fantastic! With this setup I'm able to port forward any application running in minikube and reach it with the url generated by github codespaces.

Problem

I'd like to use github actions to deploy an app into the minikube cluster that runs in github codespaces.

Question

Is it possible, if so the how to do it?

1

There are 1 best solutions below

0
On

It toured out that it is possible. There are 2 ways that you could solve this problem.

Push based

  1. Start GitHub codespace with minikube installed in it
  2. Install and configure GitHub's self hosted runner in GitHub Codespaces
  3. Configure and start GitHub's self hosted runner in GitHub Codespace
  4. Run your GitHub's Actions on self hosted runners
    jobs:
      build:
        runs-on:
          labels:
          - self-hosted
          - self-hosted-runner-label
    

I've successful implement above flow in this repository.

Pull based

  1. Start GitHub Codespace with minikube installed in it
  2. Install ArgoCD in minikube
  3. Point ArgoCD towards your GitHub repository
  4. Use GitHub Actions to generate new k8s manifests files