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
- Navigate to Ingress in the sidebar
- Click Create Ingress or Import YAML
- 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
| Annotation | Description | Default |
|---|---|---|
nginx.ingress.kubernetes.io/rewrite-target | Rewrite URL path | - |
nginx.ingress.kubernetes.io/ssl-redirect | Force HTTPS | true |
nginx.ingress.kubernetes.io/proxy-body-size | Max request body | 1m |
nginx.ingress.kubernetes.io/proxy-read-timeout | Backend timeout | 60s |
nginx.ingress.kubernetes.io/rate-limit | Requests per second | - |
nginx.ingress.kubernetes.io/whitelist-source-range | IP whitelist | - |
Path Types
| Type | Behavior | Example |
|---|---|---|
Prefix | Matches path prefix | /api matches /api, /api/users |
Exact | Exact path match | /api matches only /api |
ImplementationSpecific | Regex 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 namespaceproduction- Production environmentstaging- Staging environment- Custom namespaces for your organization