California Foundation for the Advancement of Electronic Arts cabins reservations system
This is a ruby on rails app providing the cabins reservations system.
-
drop a
.env
file into place that looks something like# MARIA DB CONTAINER MARIADB_USER=cabins MARIADB_PASSWORD=password MARIADB_ROOT_PASSWORD=password MARIADB_DATABASE=cabins # cabins RAILS_ENV=development CABINS_DB_USER=cabins CABINS_DB_PASSWORD=password CABINS_DB_HOST=db CABINS_DB_PORT=3306 CABINS_DB_NAME=cabins DATABASE_URL="mysql2://${CABINS_DB_USER}:${CABINS_DB_PASSWORD}@${CABINS_DB_HOST}:${CABINS_DB_PORT}/${CABINS_DB_NAME}?"
-
Might need to do a
docker compose build
... -
docker compose up -d
-
docker compose run web bundle exec rake db:reset
-
You can then hit the app on
http://localhost:3000
-
for logs,
docker compose logs -f web
-
Seeded admin login is
[email protected]
. Password isnopenope
http://localhost:3000/rails/mailers/user_mailer/ http://localhost:3000/rails/mailers/reservation_mailer/
The deployment/
directory contains the infrastructure to deploy Cabins on Kubernetes.
Follow these steps for the initial configuration.
-
Enable Kubernetes in Docker Desktop.
-
Install Helm for your platform.
-
Add the Bitnami repo to helm:
$ helm repo add bitnami https://charts.bitnami.com/bitnami
-
Update the chart dependencies (pull in MariaDB)
$ helm dependency update deployment/chart
To test a local container build ensure the following settings are present in deployment/values-minikube.yaml
:
image:
repository: cabins
pullPolicy: Never
tag: "latest"
Build the container locally:
$ docker build -t cabins .
Install the helm chart:
$ helm install cabins deployment/chart --values deployment/values-minikube.yaml
Verify it's installed:
$ helm list
$ kubectl get all
Connect to the service. This command proxies local connections into the Kubernetes system:
$ kubectl port-forward service/cabins 3000:80
While it's running the application will be visible on http://localhost:3000
.
The Cabins container STDOUT is visible. You have to find the name of the pod, which will be randomized. For example:
$ kubectl get all
NAME READY STATUS RESTARTS AGE
pod/cabins-865df76dd5-mpxk9 1/1 Running 0 4m25s
pod/cabins-mariadb-0 1/1 Running 0 4m25s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/cabins LoadBalancer 10.106.163.116 <pending> 80:31536/TCP 4m25s
service/cabins-mariadb ClusterIP 10.105.79.80 <none> 3306/TCP 4m25s
service/kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 11h
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/cabins 1/1 1 1 4m25s
NAME DESIRED CURRENT READY AGE
replicaset.apps/cabins-865df76dd5 1 1 1 4m25s
NAME READY AGE
statefulset.apps/cabins-mariadb 1/1 4m25s
The pod name is pod/cabins-865df76dd5-mpxk9
. Look at the logs with:
$ kubectl logs -f pod/cabins-865df76dd5-mpxk9
To uninstall the Cabins chart:
$ helm uninstall cabins
The database will still be intact. You can see the storage with:
$ kubectl get pvc
To delete the database and start over run:
$ kubectl delete pvc/data-cabins-mariadb-0