- Build the bundler image:
docker build ./bundler -t oba/bundler:test
- Build the app image:
docker build ./oba -t oba/app:test
Apply the Kubernetes resources in oba.yaml
kubectl apply -f oba.yaml
The YAML file deploys the OneBusAway application and a MySQL database within a dedicated oba namespace in Kubernetes. It also sets up a secret for sensitive data and a ConfigMap for GTFS data URL, while exposing the database as a service for other pods to access.
You can portforward the oba app to your localhost using:
kubectl port-forward deploy/oba-app-deployment -n oba 8080:8080
You can portforward the service to your localhost using:
kubectl port-forward service/oba-database -n oba 3306:3306
Then you can connect to it programmatically using mysql
:
mysql -u oba_user -p -h localhost:3306
If deployed in Kubernetes environment:
- Use the kubectl set env command to set new environment variables, make sure you replace deployment/oba-app with the actual name of your deployment:
kubectl set env deployment/oba-app GOOGLE_MAPS_API_KEY=<YOUR_KEY_HERE> \
GOOGLE_MAPS_CHANNEL_ID=<YOUR_CHANNEL_ID_HERE> \
GOOGLE_MAPS_CLIENT_ID=<YOUR_CLIENT_ID_HERE>
- Use the following command to rebuild and start the oba app service:
kubectl rollout restart deployment/oba-app