Reputation: 13
I did the following tutorial:
I created the ingress.yaml file as follows:
#ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: cna-express
annotations:
kubernetes.io/ingress.class: addon-http-application-routing
spec:
rules:
- host: cna-express.4d667ba6676144bbac81.westeurope.aksapp.io
paths:
- path: / # Which path is this rule referring to
pathType: Prefix
backend: # How the ingress will handle the requests
service:
name: cna-express # Which service the request will be forwarded to
port:
name: http # Which port in that service
However, I have the following output:
error: error parsing ./ingress.yaml: error converting YAML to JSON: yaml: line 11: mapping values are not allowed in this context
Do you have any idea about what could be the issue? With my best
Upvotes: 0
Views: 1618
Reputation: 232
You forgot to add http line. Try this one please:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: cna-express
annotations:
kubernetes.io/ingress.class: addon-http-application-routing
spec:
rules:
- host: cna-express.4d667ba6676144bbac81.westeurope.aksapp.io
http:
paths:
- path: / # Which path is this rule referring to
pathType: Prefix
backend: # How the ingress will handle the requests
service:
name: cna-express # Which service the request will be forwarded to
port:
name: http # Which port in that service
Also you can use this documentation for more information about ingress: https://kubernetes.io/docs/concepts/services-networking/ingress/
Upvotes: 0