Difference between revisions of "Kubectl apply -f ingress.yaml"

From wikieduonline
Jump to navigation Jump to search
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{lc}}
 
{{lc}}
  
 +
* https://docs.okd.io/latest/rest_api/network_apis/ingress-networking-k8s-io-v1.html
  
 +
kubectl apply -f ingress.yaml && [[kubectl describe ingress]]
 +
[[ingress.networking.k8s.io]]/yournewingress created
  
 +
== Errors ==
 
  [[error: resource mapping not found]] for name: "your-ingress" namespace: "your-namespace" from "ingress.yaml": no matches for kind "[[Ingress]]" in version "[[networking.k8s.io/v1beta1]]" [[ensure CRDs are installed first]]
 
  [[error: resource mapping not found]] for name: "your-ingress" namespace: "your-namespace" from "ingress.yaml": no matches for kind "[[Ingress]]" in version "[[networking.k8s.io/v1beta1]]" [[ensure CRDs are installed first]]
 +
 +
Solution: change [[networking.k8s.io/v1beta1]] for [[networking.k8s.io/v1]] or your K8s version: [[kubectl api-resources]] | grep [[networking.k8s.io]]
  
 +
{{error validating ingress.yaml}}
 +
 +
 +
== Related ==
 
* [[kubectl create ingress --help]]
 
* [[kubectl create ingress --help]]
 
* [[ingresses.networking.k8s.io]]
 
* [[ingresses.networking.k8s.io]]
 +
* [[netpol]]
 +
* [[spec.rules.host]]
  
 
== See also ==
 
== See also ==
* {{CRD}}
 
 
* {{kind: Ingress}}
 
* {{kind: Ingress}}
 
* {{kubectl ingress}}
 
* {{kubectl ingress}}

Latest revision as of 12:34, 6 February 2024

kubectl apply -f ingress.yaml && kubectl describe ingress
ingress.networking.k8s.io/yournewingress created

Errors[edit]

error: resource mapping not found for name: "your-ingress" namespace: "your-namespace" from "ingress.yaml": no matches for kind "Ingress" in version "networking.k8s.io/v1beta1" ensure CRDs are installed first

Solution: change networking.k8s.io/v1beta1 for networking.k8s.io/v1 or your K8s version: kubectl api-resources | grep networking.k8s.io
 error: error validating "ingress.yaml": error validating data: [ValidationError(Ingress.spec.rules[0].http.paths[0].backend): unknown field "serviceName" in io.k8s.api.networking.v1.IngressBackend, ValidationError(Ingress.spec.rules[0].http.paths[0].backend): unknown field "servicePort" in io.k8s.api.networking.v1.IngressBackend]; if you choose to ignore these errors, turn validation off with --validate=false
error: error parsing ingress.yaml: error converting YAML to JSON: yaml: line 16: mapping values are not allowed in this context
The Ingress "youingress" is invalid: spec.rules[0].http.paths[0].backend: Required value: port name or number is required
Warning  Rejected  31s   nginx-ingress-controller  spec.rules(0).host: Required value


Related[edit]

See also[edit]

Advertising: