source: k8s/frontend.yaml@ a8fe58e

Last change on this file since a8fe58e was c0086c0, checked in by Andrej <asumanovski@…>, 2 weeks ago

Add GitHub Actions CI/CD pipeline with DockerHub and Kubernetes deployment

  • Build job validates both images on every push and PR
  • Push job builds and pushes backend/frontend images to DockerHub on master
  • Deploy job applies k8s manifests and rolls out new images to k3s cluster
  • Added k8s manifests: namespace, postgres StatefulSet, backend and frontend Deployments
  • Added /api/auth/ping health endpoint for k8s readiness/liveness probes
  • Property mode set to 100644
File size: 759 bytes
Line 
1apiVersion: apps/v1
2kind: Deployment
3metadata:
4 name: frontend
5 namespace: trekr
6spec:
7 replicas: 1
8 selector:
9 matchLabels:
10 app: frontend
11 template:
12 metadata:
13 labels:
14 app: frontend
15 spec:
16 containers:
17 - name: frontend
18 image: trekr-frontend:latest # overwritten by pipeline via kubectl set image
19 ports:
20 - containerPort: 80
21 readinessProbe:
22 httpGet:
23 path: /
24 port: 80
25 initialDelaySeconds: 5
26 periodSeconds: 5
27---
28apiVersion: v1
29kind: Service
30metadata:
31 name: frontend
32 namespace: trekr
33spec:
34 type: NodePort
35 selector:
36 app: frontend
37 ports:
38 - port: 80
39 targetPort: 80
40 nodePort: 30080
Note: See TracBrowser for help on using the repository browser.