My single-node Kubernetes cluster for all my projects!
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sgoudham 70cc755fde
feat: add k8s config
Co-authored-by: winston <hey@winston.sh>
2 years ago
assets docs: add health files 2 years ago
cluster feat: add k8s config 2 years ago
templates feat: add k8s config 2 years ago
.gitignore docs: add health files 2 years ago
LICENSE docs: add health files 2 years ago
README.md docs: add health files 2 years ago

README.md

Server Configuration

At the time of writing, I have one single VPS that I use to host my personal projects. Initially, I started out with docker and having folders of compose files. I quickly ran into issues re-deploying multiple services at once, shoehorning traefik configuration into docker and various other tidbits here and there.

So I decided to bite the bullet and dive into the fabled/dreaded Kubernetes.

It's important to note that this is mostly for learning, a single node cluster isn't very effective and honestly makes things a lot harder in a lot of places compared to docker config. However, I'm fascinated at the fact that you can interact with a single node cluster the same way you'd do with hundreds of clusters, it's a pretty powerful abstraction!

Also, technically I'm using k3s for this single node cluster.

High-Level Architecture

server-architecture

Example Request

gitea-example-request

Useful Commands

  1. Get the Bearer Token

    kubectl -n <namespace> create token <user>
    
  2. Load in Environment Variables via .env (Although, based on this stackoverflow post, there is some odd behaviour with the command)

    kubectl create secret generic <secret-name> --from-env-file=.env
    
  3. Perform PVC Storage Expansion

    kubectl patch pvc <name> -p '{"spec":{"resources":{"requests":{"storage":"<amount>"}}}}'
    
  4. Annotation to Allow Secret to be Managed by Sealed Secrets

    annotations:
      sealedsecrets.bitnami.com/managed: "true"
    

Tools Used

Liked Resources

TODO

  • Setup keel.sh for automatically retrieving the latest docker hub images and re-deploying my services.
  • Experiment with a two-node cluster using Oracle's Always Free tier.

Acknowledgement

Sincere thanks to one of my best friends winston for helping me set up the cluster, troubleshoot configurations and taking the time to walk me through concepts. I really couldn't have done it this fast without him!

License

MIT