3 ms·
Could you share the resources to get started? I'm in a similar boat, 2 person trying to set up K8S in DO using automation (CI/CD).
by wiradikusuma 6y ago
Could you share the resources to get started? I'm in a similar boat, 2 person trying to set up K8S in DO using automation (CI/CD).
- dvcrn 6y agoSadly I don't have many resources I can refer you to (maybe someone else can add?) but digitaloceans kubernetes guides are excellent so I'd start with that: https://www.digitalocean.com/docs/kubernetes/how-to/ https://www.digitalocean.com/docs/kubernetes/how-to/ k8s has a loooot of stuff it can do and reading too many blog posts that go into too much detail can be intimidating, so my advice would be: 1. Create a dummy cluster on digitalocean (or docker desktop with k8s support / minikube), then setup kubectl to connect to it. 2. Start with the difference between resource types: What are deployments, what are pods? 3. Create a deployment manifest that just tries to pull a container from some registry, apply it with kubectl -f foo.yml 4. Play with kubectl to inspect things: kubectl get pods, kubectl get deployments, kubectl describe pod xxxxxx, kubectl logs xxxx 5. Learn how kubernetes ties things together through labels: Create a ClusterIP/LoadBalancer service and try to get it to balance to your pods from above through labels (https://www.digitalocean.com/docs/kubernetes/how-to/add-load-balancers/ https://www.digitalocean.com/docs/kubernetes/how-to/add-load...) Deployments/services/(pods) are all you need in the beginning for running containers on k8s and exposing them. Of course then there are things like persistent storage but if your app is made to run ephemeral, you likely have storage/db setup externally already. For running through the CI, once you have your manifests you could run kubectl apply directly through the CI if you wanted to. We are using terraform in front of k8s with hashicorps hosted state, then run `terraform plan`. If it passes, on dev we automatically apply to the cluster, on prod there is a manual step through the hashicorp admin UI that needs an apply trigger. Then there are more advanced tools like spinnaker that can be used to setup more complex pipelines on what to do on push.
- snuxoll 6y agoGitlab CI is my weapon of choice here since it’s integrated nicely with Kubernetes. There’s a wealth of tools out there - but the work I do on managing PCGamingWiki is publicly available [1] to give you a starting point. I use Kustomize + kubectl, and when I need to rollback a deployment I can just do it from Gitlab’s environment page. 1: https://gitlab.com/pcgamingwiki/pcgamingwiki https://gitlab.com/pcgamingwiki/pcgamingwiki
- sandGorgon 6y agoTry k3s.io . You will have a much more pleasant experience