From e3c421235701789b19fbb0368729050c6b25ac83 Mon Sep 17 00:00:00 2001 From: gitea_admin Date: Fri, 6 Feb 2026 17:26:56 +0000 Subject: [PATCH] frontend files --- base/frontend/deployment.yaml | 47 ++++++++++++++++++++++++++++++++ base/frontend/ingress.yaml | 44 ++++++++++++++++++++++++++++++ base/frontend/kustomization.yaml | 10 +++++++ base/frontend/service.yaml | 15 ++++++++++ 4 files changed, 116 insertions(+) create mode 100644 base/frontend/deployment.yaml create mode 100644 base/frontend/ingress.yaml create mode 100644 base/frontend/kustomization.yaml create mode 100644 base/frontend/service.yaml diff --git a/base/frontend/deployment.yaml b/base/frontend/deployment.yaml new file mode 100644 index 0000000..8c0eca8 --- /dev/null +++ b/base/frontend/deployment.yaml @@ -0,0 +1,47 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: frontend + labels: + app: frontend + component: ui +spec: + replicas: 2 + selector: + matchLabels: + app: frontend + template: + metadata: + labels: + app: frontend + component: ui + spec: + containers: + - name: frontend + image: gitea.example.com/inventory/frontend:latest # Overridden by Kustomize + ports: + - containerPort: 80 + name: http + resources: + requests: + memory: "64Mi" + cpu: "50m" + limits: + memory: "128Mi" + cpu: "100m" + livenessProbe: + httpGet: + path: / + port: 80 + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 3 + failureThreshold: 3 + readinessProbe: + httpGet: + path: / + port: 80 + initialDelaySeconds: 3 + periodSeconds: 5 + timeoutSeconds: 2 + failureThreshold: 2 diff --git a/base/frontend/ingress.yaml b/base/frontend/ingress.yaml new file mode 100644 index 0000000..6b3521d --- /dev/null +++ b/base/frontend/ingress.yaml @@ -0,0 +1,44 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: inventory-ingress + annotations: + nginx.ingress.kubernetes.io/rewrite-target: / + nginx.ingress.kubernetes.io/ssl-redirect: "false" +spec: + ingressClassName: nginx + rules: + - host: inventory.local # Change to your domain + http: + paths: + # Backend API routes + - path: /api + pathType: Prefix + backend: + service: + name: backend + port: + number: 3000 + # Health and readiness endpoints + - path: /health + pathType: Exact + backend: + service: + name: backend + port: + number: 3000 + - path: /ready + pathType: Exact + backend: + service: + name: backend + port: + number: 3000 + # Frontend routes (must be last to act as catch-all) + - path: / + pathType: Prefix + backend: + service: + name: frontend + port: + number: 80 diff --git a/base/frontend/kustomization.yaml b/base/frontend/kustomization.yaml new file mode 100644 index 0000000..bd2e3fb --- /dev/null +++ b/base/frontend/kustomization.yaml @@ -0,0 +1,10 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - deployment.yaml + - service.yaml + - ingress.yaml + +commonLabels: + tier: frontend diff --git a/base/frontend/service.yaml b/base/frontend/service.yaml new file mode 100644 index 0000000..9810a88 --- /dev/null +++ b/base/frontend/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: frontend + labels: + app: frontend + component: ui +spec: + type: ClusterIP + ports: + - port: 80 + targetPort: 80 + name: http + selector: + app: frontend