sgoudham 975a094896 | 1 year ago | |
---|---|---|
assets | 2 years ago | |
cluster | 1 year ago | |
templates | 2 years ago | |
.gitignore | 2 years ago | |
LICENSE | 2 years ago | |
README.md | 2 years ago |
README.md
Server Configuration
At the time of writing, I have a single 6 core VDS from NetCup 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
Example Request
Useful Commands
-
Get the Bearer Token
kubectl -n <namespace> create token <user>
-
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
-
Perform PVC Storage Expansion
kubectl patch pvc <name> -p '{"spec":{"resources":{"requests":{"storage":"<amount>"}}}}'
-
Annotation to Allow Secret to be Managed by Sealed Secrets
annotations: sealedsecrets.bitnami.com/managed: "true"
Tools Used
Liked Resources
- Phippy goes to the zoo
- https://blog.zachinachshon.com/k8s-dashboard/
- https://medium.com/codex/sealed-secrets-for-kubernetes-722d643eb658
- https://release.com/blog/kubernetes-secrets-management-a-practical-guide
- https://faun.pub/free-ha-multi-architecture-kubernetes-cluster-from-oracle-c66b8ce7cc37
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!