Skip to content

FOSS4G 2023 Workshop Spatial Temporal Database using Postgres, PostGIS, timescaleDB and H3 on kubernetes using PGO by CrunchyData

Notifications You must be signed in to change notification settings

jashanbhullar/foss4g-2023-spaital-temporal-database

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Setting up the cluster

Install virtualbox (needed for minikube) https://www.virtualbox.org/wiki/Downloads

Install minikube https://minikube.sigs.k8s.io/docs/start/

minikube start --kubernetes-version=v1.27.0
minikube addons enable metrics-server
minikube dashboard

# If need to start over you can
minikube delete
# and try the above commands again

Install kubectl cli https://kubernetes.io/docs/tasks/tools/

kubectl version --short

Install psql client https://www.postgresql.org/download/

psql --version

Setting up PGO

PGO Quick Start https://access.crunchydata.com/documentation/postgres-operator/latest/quickstart/

cd postgres-operator-examples
kubectl apply -k kustomize/install/namespace
kubectl apply --server-side -k kustomize/install/default
kubectl -n postgres-operator get pods

Change the default namespace

kubectl config set-context --current --namespace=postgres-operator

Connect to the database

# Expose the 6432 port
PG_CLUSTER_PRIMARY_POD=$(kubectl get pod -n postgres-operator -o name \
  -l postgres-operator.crunchydata.com/cluster=hippo,postgres-operator.crunchydata.com/role=master)
kubectl -n postgres-operator port-forward "${PG_CLUSTER_PRIMARY_POD}" 6432:5432

# Get the connection string
kubectl -n postgres-operator get secrets hippo-pguser-hippo -o go-template='{{.data.uri | base64decode}}'

# Connect using psql. Change the host to `localhost` and port to `6432`
psql postgresql://hippo:ClW0%7B3%28%3Ff.%7DUuT4%28GXnJW0cz@localhost:6432/hippo

Check some SQL commands

-- look at all relations
\d
-- look at all available extensions
\dx

About

FOSS4G 2023 Workshop Spatial Temporal Database using Postgres, PostGIS, timescaleDB and H3 on kubernetes using PGO by CrunchyData

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published