Planning Overlays ¶
Load data ¶
-
Connect to Kubernetes cluster:
export KUBECONFIG=~/.kube/jarvus-live-kubeconfig.yaml kubectl get nodes
-
Capture name of current database pod:
DB_POD=$(kubectl -n letsplan get pod -l component=database -o jsonpath='{.items[0].metadata.name}')
-
Backup existing database:
kubectl -n letsplan exec $DB_POD \ -- bash -c 'pg_dumpall --clean -U${POSTGRES_USER}' \ > /tmp/letsplan.sql
-
Capture name of current application pod:
APP_POD=$(kubectl -n letsplan get pod -l component=app -o jsonpath='{.items[0].metadata.name}')
-
Copy new planning overlay CSV into application pod:
kubectl -n letsplan cp \ ~/Downloads/LetsPlanParcelData/planningOverlays.csv \ $APP_POD:/srv/app/storage/app
-
Truncate existing planning overlay data:
echo 'TRUNCATE TABLE planning_overlays' | kubectl -n letsplan exec -i $DB_POD -- psql -U admin laravel
-
Load planning overlay CSV into database:
kubectl -n letsplan exec -it $APP_POD -- php artisan lp:import-planning_overlays planningOverlays.csv