feat(gitops): add nxtgauge backend k8s manifests and argocd app

This commit is contained in:
Ashwin Kumar 2026-03-05 16:02:35 +01:00
commit 2c26f52cc9
10 changed files with 149 additions and 0 deletions

View file

@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: nxtgauge-backend-config
namespace: nxtgauge
data:
NODE_ENV: "production"
PORT: "2002"

View file

@ -0,0 +1,52 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nxtgauge-backend
namespace: nxtgauge
labels:
app: nxtgauge-backend
spec:
replicas: 2
selector:
matchLabels:
app: nxtgauge-backend
template:
metadata:
labels:
app: nxtgauge-backend
spec:
containers:
- name: backend
image: ghcr.io/traceworks2023/nxtgauge-backend:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 2002
name: http
envFrom:
- configMapRef:
name: nxtgauge-backend-config
- secretRef:
name: nxtgauge-backend-secrets
readinessProbe:
httpGet:
path: /health
port: 2002
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 2
failureThreshold: 3
livenessProbe:
httpGet:
path: /health
port: 2002
initialDelaySeconds: 15
periodSeconds: 20
timeoutSeconds: 2
failureThreshold: 3
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi

View file

@ -0,0 +1,18 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nxtgauge-backend
namespace: nxtgauge
spec:
ingressClassName: traefik
rules:
- host: api.nxtgauge.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: nxtgauge-backend
port:
number: 80

View file

@ -0,0 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- configmap.yaml
- secret.yaml
- deployment.yaml
- service.yaml
- ingress.yaml

View file

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: nxtgauge

View file

@ -0,0 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: nxtgauge-backend-secrets
namespace: nxtgauge
type: Opaque
stringData:
DATABASE_URL: "REPLACE_ME"
JWT_SECRET: "REPLACE_ME"

View file

@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: nxtgauge-backend
namespace: nxtgauge
labels:
app: nxtgauge-backend
spec:
type: ClusterIP
selector:
app: nxtgauge-backend
ports:
- name: http
port: 80
targetPort: 2002
protocol: TCP

View file

@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
patchesStrategicMerge:
- replicas-patch.yaml

View file

@ -0,0 +1,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nxtgauge-backend
namespace: nxtgauge
spec:
replicas: 2

View file

@ -0,0 +1,20 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: nxtgauge-backend
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/Traceworks2023/nxtgauge-gitops.git
targetRevision: main
path: apps/nxtgauge-backend/overlays/prod
destination:
server: https://kubernetes.default.svc
namespace: nxtgauge
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true