From 78aaf561499fd39588b74ae6ab850db59b8f74f4 Mon Sep 17 00:00:00 2001 From: Khang Duy LAI Date: Wed, 11 Mar 2026 15:00:56 +0100 Subject: [PATCH] feat: add Kubernetes manifests for Traefik ingress --- k8s/deployment.yaml | 29 +++++++++++++++++++++++++++++ k8s/ingress.yaml | 18 ++++++++++++++++++ k8s/service.yaml | 11 +++++++++++ 3 files changed, 58 insertions(+) create mode 100644 k8s/deployment.yaml create mode 100644 k8s/ingress.yaml create mode 100644 k8s/service.yaml diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml new file mode 100644 index 0000000..789b760 --- /dev/null +++ b/k8s/deployment.yaml @@ -0,0 +1,29 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: cmsn-b-linh + labels: + app: cmsn-b-linh +spec: + replicas: 1 + selector: + matchLabels: + app: cmsn-b-linh + template: + metadata: + labels: + app: cmsn-b-linh + spec: + containers: + - name: nginx + image: cmsn-b-linh:latest # Change to your registry + imagePullPolicy: IfNotPresent + ports: + - containerPort: 80 + resources: + requests: + cpu: "50m" + memory: "64Mi" + limits: + cpu: "100m" + memory: "128Mi" diff --git a/k8s/ingress.yaml b/k8s/ingress.yaml new file mode 100644 index 0000000..8253a8a --- /dev/null +++ b/k8s/ingress.yaml @@ -0,0 +1,18 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: cmsn-b-linh + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web +spec: + rules: + - host: cmsn-b-linh.duylai.duckdns.org + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: cmsn-b-linh + port: + number: 80 diff --git a/k8s/service.yaml b/k8s/service.yaml new file mode 100644 index 0000000..68119c7 --- /dev/null +++ b/k8s/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: cmsn-b-linh +spec: + selector: + app: cmsn-b-linh + ports: + - port: 80 + targetPort: 80 + type: ClusterIP