Skip to content

fix: k8s ingress rewrites all paths, add TLS, securityContext, resource limits, probes - #16

Merged
Senthil455 merged 1 commit into
mainfrom
fix/k8s-ingress-security
Jun 15, 2026
Merged

fix: k8s ingress rewrites all paths, add TLS, securityContext, resource limits, probes#16
Senthil455 merged 1 commit into
mainfrom
fix/k8s-ingress-security

Conversation

@Senthil455

Copy link
Copy Markdown
Owner

Kubernetes Ingress & Deployment Security Fix

Issues fixed

1. Ingress rewrite-target: / breaks all routes


  • ginx.ingress.kubernetes.io/rewrite-target: /\ stripped every path to just /\
  • /api/auth/login\ became /\ when forwarded to the backend
  • Fix: Changed to /\ with regex path /api(/|$)(.*)\ — preserves the subpath

2. No TLS configured

  • Added \ ls\ section with \�tlas-tls\ secret, \ssl-redirect: true, and explicit \ingressClassName: nginx\

3. No securityContext on any deployment

  • Added pod-level:
    unAsNonRoot: true,
    unAsUser: 1001, \ sGroup: 1001\
  • Added container-level: \�llowPrivilegeEscalation: false, \capabilities.drop: [ALL]\

4. No resource limits

  • Added
    equests\ (100m cpu / 128Mi memory) and \limits\ (500m cpu / 256Mi memory) on all 14 containers

5. No liveness/readiness probes

  • Added \livenessProbe\ and
    eadinessProbe\ (httpGet /health) with appropriate delays on all containers

Files changed

  • \k8s/ingress.yaml\ — fixed rewrite-target, added TLS, regex path capture
  • \k8s/deployments.yaml\ — added securityContext, resource limits, probes to all deployments

…source limits, probes

- Ingress: fixed rewrite-target from '/' to '/' with regex capture
  so /api/auth/login becomes /auth/login (not /)
- Ingress: added TLS section with atlas-tls secret
- Ingress: added ssl-redirect annotation, explicit ingressClassName
- Deployments: added pod securityContext (runAsNonRoot, runAsUser, fsGroup)
- Deployments: added container securityContext (no ptrace, no CAP)
- Deployments: added resource requests/limits (cpu/memory) on all containers
- Deployments: added livenessProbe and readinessProbe on all containers
@Senthil455
Senthil455 merged commit 7e4aee8 into main Jun 15, 2026
1 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant