This is an example application and guide for deploying a Rails application with Kubernetes. The instructions below use minikube, but they should apply to any Kubernetes cluster.
$ brew install minikube
$ minikube start
And (optionally) start the dashboard with:
$ minikube dashboard
Create the volume, service, and deployment with:
$ kubectl apply -f kube/postgres
View logs with:
$ kubectl logs -f deployments/postgres
First, we need to build our app image. One of nice things about minikube is that it allows you to build docker images without needing to push to an external registry.
$ eval $(minikube docker-env)
$ docker build -t quotes:latest .
DB Setup:
$ kubectl apply -f kube/setup.yml
$ kubectl logs -f jobs/setup
Create the service and deployment with:
$ kubectl apply -f kube/app
Open the service with:
$ minikube service quotes
$ minikube stop
Delete deployments, jobs, and services with:
kubectl delete deployments --all
kubectl delete jobs --all
kubectl delete services --all
Guides
Documentation
Courses
Tools
- https://www.docker.com/products/docker-desktop
- https://www.docker.com/products/kubernetes
- https://k3s.io
Misc