...
Finally, we create the input resource with the usual command kubectl apply -f <file.yaml>, even if it is better to take a look at the contents of the .yaml file first.
| Info | ||
|---|---|---|
| ||
What we present here (multiple path) is only one of the 2 ways in which incoming requests can be routed to the services present in the cluster. The other modality, present in the following, makes use of sub-domains to manage incoming requests. |
| Code Block | ||||
|---|---|---|---|---|
| ||||
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: cafe-ingress
spec:
# tls: # Let's ignore
# - hosts: # and comment
# - cafe.example.com # these lines
# secretName: cafe-secret # for the moment
rules:
- host: cafe.example.com
http:
paths:
- path: /tea # Use cafe.example.com/tea to target "tea" services
backend:
serviceName: tea-svc # Enter the service name
servicePort: 80 # Enter the port number on which the service is listening
- path: /coffee # Use cafe.example.com/coffee to target "coffee" services
backend:
serviceName: coffee-svc # Enter the service name
servicePort: 80 # Enter the port number on which the service is listening |
...