Hi CKAD lightninglab2 5th question, I used the below yaml to create a ingress ro . . .

karthik:
Hi CKAD lightninglab2 5th question, I used the below yaml to create a ingress routing…But, I don’t get a successful response from curl command
"Create a single ingress resource called ingress-vh-routing. The resource should route HTTP traffic to multiple hostnames as specified below:

  1. The service video-service should be accessible on <http://watch.ecom-store.com:30093/video>
  2. The service apparels-service should be accessible on <http://apparels.ecom-store.com:30093/wear>"
apiVersion: <http://networking.k8s.io/v1|networking.k8s.io/v1>
kind: Ingress
metadata:
  name: ingress-vh-routing
spec:
  rules:
  - host: "<http://watch.ecom-store.com|watch.ecom-store.com>"
    http:
      paths:
      - pathType: Prefix
        path: "/video"
        backend:
          service:
            name: video-service
            port:
              number: 8080
  - host: "<http://apparels.ecom-store.com|apparels.ecom-store.com>"
    http:
      paths:
      - pathType: Prefix
        path: "/wear"
        backend:
          service:
            name: apparels-service
            port:
              number: 8080

karthik:
I saw the solution video and it uses a different apiVersion: http://networking.k8s.io/v1beta1|networking.k8s.io/v1beta1

Is it because of that?

karthik:
The yaml file in solution video seems to work. But, it gives a warning while creating the ingress resource “Warning: http://networking.k8s.io/v1beta1|networking.k8s.io/v1beta1 Ingress is deprecated in v1.19+, unavailable in v1.22+; use http://networking.k8s.io/v1|networking.k8s.io/v1 Ingress
http://ingress.networking.k8s.io/ingress-vh-routing|ingress.networking.k8s.io/ingress-vh-routing created”

apiVersion: <http://networking.k8s.io/v1beta1|networking.k8s.io/v1beta1>
kind: Ingress
metadata:
  name: ingress-vh-routing
spec:
  rules:
  - host: "<http://watch.ecom-store.com|watch.ecom-store.com>"
    http:
      paths:
      - pathType: Prefix
        path: "/video"
        backend:
            serviceName: video-service
            servicePort: 8080
  - host: "<http://apparels.ecom-store.com|apparels.ecom-store.com>"
    http:
      paths:
      - pathType: Prefix
        path: "/wear"
        backend:
            serviceName: apparels-service
            servicePort: 8080

karthik:
Latest kubectl documentation has the yaml format that I sent …But, that yaml doesn’t seem to work

Tej_Singh_Rana:
Hello, @karthik
> that yaml doesn’t seem to work
What kind of issue are you experiencing?

Tej_Singh_Rana:
> The yaml file in solution video seems to work. But, it gives a warning while creating the ingress resource “Warning: http://networking.k8s.io/v1beta1|networking.k8s.io/v1beta1 Ingress is deprecated in v1.19+, unavailable in v1.22+; use http://networking.k8s.io/v1|networking.k8s.io/v1 Ingress
> http://ingress.networking.k8s.io/ingress-vh-routing|ingress.networking.k8s.io/ingress-vh-routing created”
Syntax has changed in the latest k8s version.

karthik:
After refreshing the lab session, I tried the same Yaml and it worked