Skip to main content

Kubernetes Ingress

TunnelAPI acts as a Kubernetes-compatible Ingress Controller, allowing you to use familiar K8s Ingress YAML manifests.

Creating Ingress Rules

Via Web UI

  1. Navigate to Ingress in the sidebar
  2. Click Create Ingress or Import YAML
  3. Configure:
    • Name: K8s-style name (lowercase, hyphens)
    • Namespace: Logical grouping (default: default)
    • Host: Public hostname
    • Path: URL path to match
    • Backend URL: Where to route traffic

Via YAML Import

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-app-ingress
namespace: production
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
ingressClassName: tunnelapi
tls:
- hosts:
- myapp.ingress.tunnelapi.in
secretName: myapp-tls
rules:
- host: myapp.ingress.tunnelapi.in
http:
paths:
- path: /api
pathType: Prefix
backend:
service:
name: api-service
port:
number: 8080
- path: /
pathType: Prefix
backend:
url: http://localhost:3000

Supported Annotations

AnnotationDescriptionDefault
nginx.ingress.kubernetes.io/rewrite-targetRewrite URL path-
nginx.ingress.kubernetes.io/ssl-redirectForce HTTPStrue
nginx.ingress.kubernetes.io/proxy-body-sizeMax request body1m
nginx.ingress.kubernetes.io/proxy-read-timeoutBackend timeout60s
nginx.ingress.kubernetes.io/rate-limitRequests per second-
nginx.ingress.kubernetes.io/whitelist-source-rangeIP whitelist-

Path Types

TypeBehaviorExample
PrefixMatches path prefix/api matches /api, /api/users
ExactExact path match/api matches only /api
ImplementationSpecificRegex support/api/v[0-9]+

Exporting YAML

Export your ingress rules for version control:

# Via CLI
arm ingress export my-ingress -n production > ingress.yaml

# Via API
curl https://api.tunnelapi.in/api/ingress/production/my-ingress/yaml \
-H "Authorization: Bearer YOUR_TOKEN"

Namespaces

Organize your ingress rules by namespace:

  • default - Default namespace
  • production - Production environment
  • staging - Staging environment
  • Custom namespaces for your organization