feat(gitops): add nxtgauge backend k8s manifests and argocd app
This commit is contained in:
commit
2c26f52cc9
10 changed files with 149 additions and 0 deletions
8
apps/nxtgauge-backend/base/configmap.yaml
Normal file
8
apps/nxtgauge-backend/base/configmap.yaml
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: nxtgauge-backend-config
|
||||||
|
namespace: nxtgauge
|
||||||
|
data:
|
||||||
|
NODE_ENV: "production"
|
||||||
|
PORT: "2002"
|
||||||
52
apps/nxtgauge-backend/base/deployment.yaml
Normal file
52
apps/nxtgauge-backend/base/deployment.yaml
Normal 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
|
||||||
18
apps/nxtgauge-backend/base/ingress.yaml
Normal file
18
apps/nxtgauge-backend/base/ingress.yaml
Normal 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
|
||||||
9
apps/nxtgauge-backend/base/kustomization.yaml
Normal file
9
apps/nxtgauge-backend/base/kustomization.yaml
Normal 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
|
||||||
4
apps/nxtgauge-backend/base/namespace.yaml
Normal file
4
apps/nxtgauge-backend/base/namespace.yaml
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: nxtgauge
|
||||||
9
apps/nxtgauge-backend/base/secret.yaml
Normal file
9
apps/nxtgauge-backend/base/secret.yaml
Normal 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"
|
||||||
16
apps/nxtgauge-backend/base/service.yaml
Normal file
16
apps/nxtgauge-backend/base/service.yaml
Normal 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
|
||||||
6
apps/nxtgauge-backend/overlays/prod/kustomization.yaml
Normal file
6
apps/nxtgauge-backend/overlays/prod/kustomization.yaml
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ../../base
|
||||||
|
patchesStrategicMerge:
|
||||||
|
- replicas-patch.yaml
|
||||||
7
apps/nxtgauge-backend/overlays/prod/replicas-patch.yaml
Normal file
7
apps/nxtgauge-backend/overlays/prod/replicas-patch.yaml
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nxtgauge-backend
|
||||||
|
namespace: nxtgauge
|
||||||
|
spec:
|
||||||
|
replicas: 2
|
||||||
20
argocd/nxtgauge-backend-application.yaml
Normal file
20
argocd/nxtgauge-backend-application.yaml
Normal 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
|
||||||
Loading…
Add table
Reference in a new issue