Skip to content

Commit

Permalink
Add mini k8s deployment (apache#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
MonkeyCanCode committed Aug 7, 2024
1 parent 46dfeb1 commit 7ce0945
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ Running in Docker

Running in Kubernetes
- `./setup.sh` - To run Polaris as a mini-deployment locally. This will create two pods that bind themselves to port `8181`.
- `kubectl get pods` - To check the status of the pods.
- `kubectl get deployment` - To check the status of the deployment.
- `kubectl describe deployment polaris-deployment` - To troubleshoot if things aren't working as expected.
- `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.
- `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.

Building docs
- Docs are generated using [Redocly](https://redocly.com/docs/cli/installation). To regenerate them, run the following
Expand Down
37 changes: 37 additions & 0 deletions k8/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: v1
kind: Namespace
metadata:
name: polaris
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: polaris-deployment
namespace: polaris
spec:
replicas: 2
selector:
matchLabels:
app: polaris
template:
metadata:
labels:
app: polaris
spec:
containers:
- name: polaris
image: localhost:5001/polaris:latest
ports:
- containerPort: 8181
---
apiVersion: v1
kind: Service
metadata:
name: polaris-service
namespace: polaris
spec:
selector:
app: polaris
ports:
- port: 8181
targetPort: 8181

0 comments on commit 7ce0945

Please sign in to comment.