Local deployment of different vector databases using Minikube.
To install minikube check the docs
The configuration I'm using is the following:
- driver=podman
- rootless true
- container-runtime=containerd docs
Get the status
minikube status
Start Cluster
minikube start
Stop Cluster
minikube stop
Get info about the nodes in your cluster
kubectl get nodes -o wide
minikube tunnel
Create a .env file to store your variables. You will need one per database, run the following to create it automatically
Generate pgvector .env file
cat > pgvector/.env << EOF
# PgVector
POSTGRES_DB=dbname
POSTGRES_USER=postgres
POSTGRES_PASSWORD=password
EOF
Deployment scripts will create a secret per db referenced by the deployment.yml file
Important!!
Before you run any deployment script, check your .env files, if you want to use a different one just pass it to the script, by default it will use .env (Remember that each db has its own env file)
bash deploy_dbs.sh --env ".env_prod"
or
bash deploy_dbs.sh -e ".env_prod"
To deploy pgvector, use --pgvector flag
bash deploy_dbs.sh --pgvector
db_flag: --pgvector
bash deploy_dbs.sh --db_flag1 --db_flag2
To get the external ip
kubectl get services
if you don't see it, run:
minikube tunnel
Check if the db is accepting connections
pg_isready -d ${POSTGRES_DB} -h ${EXTERNAL_IP} -p 5432 -U ${POSTGRES_USER}
Open a connection docs
psql -d ${POSTGRES_DB} -h ${EXTERNAL_IP} -p 5432 -U ${POSTGRES_USER}
kubectl delete service pgvector && \
kubectl delete deployment pgvector && \
kubectl delete pv pgvector-pv && \
kubectl delete pvc pgvector-pvc && \
kubectl delete secret pgvector-secrets