Basic Kubernetes setup for https://quepid.com/
Setting up Kubectl
This setup assumes that external dependencies (Redis and MySQL) are provided as a service by AWS/GCP or set up in the Kubernetes cloud separately.
How to create Redis instance in AWS ElastiCache How to create Mysql in AWS RDS
kubectl create namespace quepid
Edit k8s/00-credentials.yml
and enter proper credentials to access external dependencies.
kubectl apply -f k8s/00-configmap.yml
kubectl apply -f k8s/00-credentials.yml
kubectl apply -f k8s/01-deployment.yml
kubectl apply -f k8s/02-service.yml
go inside pod
➜ kubectl get pods -n quepid
NAME READY STATUS RESTARTS AGE
quepid-5569f5fbcc-gbc9w 1/1 Running 0 6d19h
➜ kubectl exec -n quepid --stdin --tty quepid-5569f5fbcc-gbc9w -- /bin/bash
root@quepid-5569f5fbcc-gbc9w:/srv/app#
Inside running pod
rake db:setup
rake db:migrate
You should understand all the risks of loading db schema into an existing not empty database. So, inside the running pod
rake db:schema:load
rake db:migrate
kubectl port-forward service/quepid 8080:80 -n quepid
Now you can open http://127.0.0.1:8080/ in your browser.
Edit k8s/03-ingress.yml
and enter proper values.
Create ingress
kubectl apply -f k8s/03-ingress.yml
NOT READY YET
nano my_values.yml
As described previously
helm template frutik-quepid charts/quepid --values my_values.yml | kubectl apply -n quepid -f -
Replace frutik-quepid
with some identifier for this instance of quepid.
For example 'x-y-z-quepid-dev'.