K3s-cluster/nginx/ingress.yaml

30 lines
616 B
YAML

apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: stripprefix
spec:
stripPrefix:
prefixes:
- /nginx
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nginx-ingress
annotations:
kubernetes.io/ingress.class: "traefik"
"traefik.ingress.kubernetes.io/router.middlewares": default-stripprefix@kubernetescrd
spec:
rules:
- host: nginx.localhost
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: nginx-svc
port:
number: 80