- Kubernetes Cluster; if you are already running Shannon in
Localnet
, you can work with it. - Helm & PostgreSQL; optional if you already have PostgreSQL
NOTE: Before proceeding, ensure that the Kubernetes deployment has access to the Pocketdex image. You can build the image by following the instructions in the main README file.
Then, do one of the following:
- Load it into your Kubernetes cluster using
kind local docker-images <image:tag>
(if you're using it) - Push it to your preferred container registry
NOTE: Skip this step if you already have a PostgreSQL instance running.
Add the Bitnami Helm repository:
helm repo add bitnami https://charts.bitnami.com/bitnami
Replace all the CHANGEME
placeholders in kubernetes/postgresql-values.yaml
.
Install PostgreSQL:
helm install postgresql bitnami/postgresql --version 15.5.23 -f kubernetes/postgresql-values.yaml
Replace all the CHANGEME
placeholders in kubernetes/db-secrets.yaml
.
Deploy them using:
kubectl apply -f kubernetes/db-secrets.yaml
Review/Edit and deploy the ConfigMap found in kubernetes/configmap.yaml
:
kubectl apply -f kubernetes/configmap.yaml
Create the indexer deployment and service:
kubectl apply -f kubernetes/indexer-deployment.yaml
Create the query deployment and service:
kubectl apply -f kubernetes/query-deployment.yaml
To explore the application locally, you can access the query playground using a simple port-forward
:
kubectl port-forward svc/pocketdex-query --address 127.0.0.1 3000:3000
Navigate to http://localhost:3000
, and you should see the GraphQL Playground.
If you need to permanently expose this to the world, you will need an Ingress controller. Any Ingress controller should work, but here are a few popular ones:
Once the ingress controller is set up, you can use the example Ingress configuration located at
kubernetes/ingress.yaml
.
NOTE: This file is just an example. You should review and edit it as needed before deploying it. If you need TLS support, ensure your Ingress Controller is configured to handle it in front of the query service.
kubectl apply -f kubernetes/ingress.yaml
To watch the logs for both the Indexer and Query components:
kubectl logs -f -l app=pocketdex
To watch the logs for the Indexer component only:
kubectl logs -f -l app=pocketdex -l component=indexer
To watch the logs for the Query component only:
kubectl logs -f -l app=pocketdex -l component=query