Skip to content

Commit

Permalink
Reduce k8s deployment replica and add metrics endpoints (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
MonkeyCanCode authored Aug 9, 2024
1 parent be5c29a commit 887bb8f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@ Running in Docker
- `docker compose up --build --exit-code-from regtest` - To run regression tests in a Docker environment.

Running in Kubernetes
- `./run.sh` - To run Polaris as a mini-deployment locally. This will create two pods that bind themselves to port `8181`.
- `kubectl port-forward svc/polaris-service -n polaris 8181:8181` - To create a secure connection between a local machine and a pod within the cluster.
- `./run.sh` - To run Polaris as a mini-deployment locally. This will create one pod that bind itself to ports `8181` and `8182`.
- `kubectl port-forward svc/polaris-service -n polaris 8181:8181 8182:8182` - To create secure connections between a local machine and a pod within the cluster for both service and metrics endpoints.
- Currrently supported metrics endpoints:
- localhost:8182/metrics
- localhost:8182/healthcheck
- `kubectl get pods -n polaris` - To check the status of the pods.
- `kubectl get deployment -n polaris` - To check the status of the deployment.
- `kubectl describe deployment polaris-deployment -n polaris` - To troubleshoot if things aren't working as expected.
Expand Down
9 changes: 7 additions & 2 deletions k8/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
name: polaris-deployment
namespace: polaris
spec:
replicas: 2
replicas: 1
selector:
matchLabels:
app: polaris
Expand All @@ -23,6 +23,7 @@ spec:
image: localhost:5001/polaris:latest
ports:
- containerPort: 8181
- containerPort: 8182
---
apiVersion: v1
kind: Service
Expand All @@ -33,5 +34,9 @@ spec:
selector:
app: polaris
ports:
- port: 8181
- name: service
port: 8181
targetPort: 8181
- name: metrics
port: 8182
targetPort: 8182

0 comments on commit 887bb8f

Please sign in to comment.