Skip to content

Commit

Permalink
initial kubernetes configuration files
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelberston committed Nov 19, 2024
1 parent 8d68c3f commit 33356d8
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 0 deletions.
54 changes: 54 additions & 0 deletions kubernetes/backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: backend
namespace: secure-auth
spec:
replicas: 1
selector:
matchLabels:
app: backend
template:
metadata:
labels:
app: backend
spec:
containers:
- name: backend
image: sberston/backend:latest
ports:
- containerPort: 3000
env:
- name: PORT
value: "3000"
- name: DB_HOST
value: "host.docker.internal" # Note: You might need to adjust this for k8s
- name: SESSION_SECRET
valueFrom:
secretKeyRef:
name: backend-secrets
key: SESSION_SECRET
- name: JWT_SECRET
valueFrom:
secretKeyRef:
name: backend-secrets
key: JWT_SECRET
livenessProbe:
httpGet:
path: /health
port: 3000
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 5
---
apiVersion: v1
kind: Service
metadata:
name: backend
namespace: secure-auth
spec:
selector:
app: backend
ports:
- port: 3000
targetPort: 3000
42 changes: 42 additions & 0 deletions kubernetes/frontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
namespace: secure-auth
spec:
replicas: 1
selector:
matchLabels:
app: frontend
template:
metadata:
labels:
app: frontend
spec:
containers:
- name: frontend
image: sberston/frontend:latest
ports:
- containerPort: 80
env:
- name: BACKEND_URL
value: "http://backend:3000"
livenessProbe:
httpGet:
path: /health
port: 80
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 5
---
apiVersion: v1
kind: Service
metadata:
name: frontend
namespace: secure-auth
spec:
selector:
app: frontend
ports:
- port: 80
targetPort: 80
17 changes: 17 additions & 0 deletions kubernetes/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: secure-auth-ingress
namespace: secure-auth
spec:
rules:
- host: your-domain.com # Replace with your domain
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: frontend
port:
number: 80

0 comments on commit 33356d8

Please sign in to comment.