Skip to content

Commit

Permalink
Refactor services: move definitions to deployment files
Browse files Browse the repository at this point in the history
Removed `service.yaml` and integrated service definitions directly into `indexer-deployment.yaml` and `query-deployment.yaml`. Also updated Docker image reference for indexer component. Updated documentation accordingly to reflect these changes.
  • Loading branch information
jorgecuesta committed Aug 20, 2024
1 parent 7e4c500 commit 9800975
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 46 deletions.
10 changes: 2 additions & 8 deletions docs/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,18 @@ kubectl apply -f kubernetes/configmap.yaml

#### 4. Deploy Indexer and Query Components:

Create the indexer deployment:
Create the indexer deployment and service:

```shell
kubectl apply -f kubernetes/indexer-deployment.yaml
```

Create the query deployment:
Create the query deployment and service:

```shell
kubectl apply -f kubernetes/query-deployment.yaml
```

#### 5. Create Services for Indexer and Query Components:

```shell
kubectl apply -f kubernetes/service.yaml
```

### Explore Locally:

To explore the application locally, you can access the query playground using a simple `port-forward`:
Expand Down
21 changes: 20 additions & 1 deletion kubernetes/indexer-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ spec:
key: port
name: db-credentials
# TODO: Replace with the actual Pocket Network Docker image of PocketDex once it is released.
image: pocket-network/pocketdex:production # Docker image
image: poktscan/pocketdex:latest # Docker image
imagePullPolicy: IfNotPresent # Image pull policy
resources:
limits:
Expand All @@ -86,3 +86,22 @@ spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
terminationGracePeriodSeconds: 20 # Time before the termination signal is sent to the container
---
apiVersion: v1
kind: Service
metadata:
labels:
app: pocketdex
component: indexer
name: pocketdex-indexer
spec:
ports:
- name: indexer
port: 3000
protocol: TCP
targetPort: 3000
selector:
app: pocketdex
component: indexer
sessionAffinity: None
type: ClusterIP
19 changes: 19 additions & 0 deletions kubernetes/query-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,22 @@ spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
terminationGracePeriodSeconds: 20 # Time before the termination signal is sent to the container
---
apiVersion: v1
kind: Service
metadata:
labels:
app: pocketdex
component: query
name: pocketdex-query
spec:
ports:
- name: query
port: 3000
protocol: TCP
targetPort: 3000
selector:
app: pocketdex
component: query
sessionAffinity: None
type: ClusterIP
37 changes: 0 additions & 37 deletions kubernetes/service.yaml

This file was deleted.

0 comments on commit 9800975

Please sign in to comment.