|
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 | |
|---|
| 1 | apiVersion: apps/v1
|
|---|
| 2 | kind: Deployment
|
|---|
| 3 | metadata:
|
|---|
| 4 | name: frontend
|
|---|
| 5 | namespace: trekr
|
|---|
| 6 | spec:
|
|---|
| 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 | ---
|
|---|
| 28 | apiVersion: v1
|
|---|
| 29 | kind: Service
|
|---|
| 30 | metadata:
|
|---|
| 31 | name: frontend
|
|---|
| 32 | namespace: trekr
|
|---|
| 33 | spec:
|
|---|
| 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.