kubernetes 1.19 Ingress Path types: Exact vs. Prefix

Jbn1233
Oct 30, 2020

--

This is my ingress:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: minimal-ingress
annotations:
spec:
rules:
- http:
paths:
- path: /rain
pathType: Exact
backend:
service:
name: echo
port:
number: 80
- path: /snow
pathType: Prefix
backend:
service:
name: echo
port:
number: 80

This is the result:

Request path: /snowy is Prefix matches /snow, so client got HTTP 200.

Request path: /rainy is not Exact matches /rain, so client got HTTP 404.

That’s all.

--

--

Jbn1233
Jbn1233

Written by Jbn1233

Very short and simple notes for CKA/SRE and may not works on your environment | jbn1233@gmail.com | Bangkok, Thailand |

No responses yet