kubernetes-ingress icon indicating copy to clipboard operation
kubernetes-ingress copied to clipboard

Update Ingress documentation and examples to networking.k8s.io/v1

Open haywoodsh opened this issue 1 year ago • 7 comments
trafficstars

Describe the bug Under docs and example/ingress-reources folder, a lot of docs and examples in Markdown are still using the beta version of the Ingress API with deprecated fields such as serviceName and servicePort, even though apiVersion has been updated. For example:

  rules:
  - host: cafe.example.com
    http:
      paths:
      - path: /tea
        backend:
          serviceName: tea-svc
          servicePort: 80
      - path: /coffee
        backend:
          serviceName: coffee-svc
          servicePort: 80

It should be updated to use the v1 API like the following:

  rules:
  - host: cafe.example.com
    http:
      paths:
      - path: /tea
        pathType: Prefix
        backend:
          service:
            name: tea-svc
            port:
              number: 80
      - path: /coffee
        pathType: Prefix
        backend:
          service:
            name: coffee-svc
            port:
              number: 80

In the Kubernetes versions we currently support, if users copy and paste these examples and deploy the YAMLs, the Kubernetes API would reject the requests as invalid and return errors such as

 strict decoding error: unknown field "spec.rules[0].http.paths[0].backend.serviceName", unknown field "spec.rules[0].http.paths[0].backend.servicePort", unknown field "spec.rules[0].http.paths[1].backend.serviceName", unknown field "spec.rules[0].http.paths[1].backend.servicePort"

Some of the affected pages include: docs/content/configuration/ingress-resources/basic-configuration.md docs/content/configuration/configuration-examples.md examples/ingress-resources/path-regex/README.md

The oldest Kubernetes version we currently support is 1.23, but the beta API is no longer supported in 1.22. See https://kubernetes.io/docs/reference/using-api/deprecation-guide/#ingress-v122

haywoodsh avatar Jan 29 '24 18:01 haywoodsh

Hi @haywoodsh thanks for reporting!

Be sure to check out the docs and the Contributing Guidelines while you wait for a human to take a look at this :slightly_smiling_face:

Cheers!

github-actions[bot] avatar Jan 29 '24 18:01 github-actions[bot]

image what happen to this i have follow all the configuration setup what is the missing piece to browse in http and https and seeing the picture?

reganfamor avatar Jan 30 '24 01:01 reganfamor

please I really need your help

reganfamor avatar Jan 30 '24 01:01 reganfamor

Hi @reganfamor, can you please create a new issue with all the details? thanks!

vepatel avatar Jan 30 '24 13:01 vepatel

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] avatar May 13 '24 01:05 github-actions[bot]

This issue was closed because it has been stalled for 10 days with no activity.

github-actions[bot] avatar May 24 '24 01:05 github-actions[bot]