prole/README.md
2025-09-29 15:44:36 -07:00

2.1 KiB

prole

prole-db is a PostgreSQL database for Prole

claudnative-pg cluster setup

k3d

k3d cluster create ...

start the docker image build registry

build prole-db Docker image

cd prole-db
docker run -d -p 5000:5000 --name prole-data-registry registry:2
docker network connect k3d-prole-data-cluster prole-data-registry
docker login k3d.localhost:5000
docker build -t prole-db:17.5-025 .
docker tag prole-db:17.5-025 localhost:5000/prole-db:17.5-025
docker push localhost:5000/prole-db:17.5-025

k3d image import prole-db:17.5-025 -c prole-data-cluster
kubectl apply --server-side -f https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-1.27/releases/cnpg-1.27.0.yaml
helm upgrade --install -f https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/main/docs/src/samples/monitoring/kube-stack-config.yaml prometheus-community prometheus-community/kube-prometheus-stack
kubectl apply -f https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/main/docs/src/samples/monitoring/prometheusrule.yaml

helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo add cnpg-grafana https://cloudnative-pg.github.io/grafana-dashboards
helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/
helm upgrade --install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard --create-namespace --namespace kubernetes-dashboard

kubectl apply -f cloudnative-pg-prole-dB.yaml

kubectl port-forward svc/prometheus-community-kube-prometheus 9090 &
kubectl -n kubernetes-dashboard port-forward svc/kubernetes-dashboard-kong-proxy 8443:443 &
kubectl port-forward svc/prole-db-rw 5432:5432 --address 0.0.0.0 &
kubectl port-forward svc/prometheus-community-grafana 3000:80 --address 0.0.0.0 &

kubectl cnpg status prole-db

kubectl cnpg plsql prole-db

brew install krew

kubectl krew install view-secret

re-initialise the database

kubectl delete -f cloudnative-pg-prole-dB.yaml
# cluster.postgresql.cnpg.io "prole-db" deleted
kubectl apply -f cloudnative-pg-prole-dB.yaml 
# cluster.postgresql.cnpg.io/prole-db created