bitnami / kube-libsonnet

Bitnami's jsonnet library for building Kubernetes manifests
https://bitnami.com
Apache License 2.0
174 stars 50 forks source link

[jjo] support Kubernetes v1.22+ apiVersions deprecations #61

Closed jjo closed 3 years ago

jjo commented 3 years ago

Fixes #60.

Support Kubernetes v1.22+ apiVersions deprecations, notably:

Other changes:

FYI this is on top of #59.

NOTE: once merged upstream, would strongly recommend tagging it as v1.19.0, following the convention that tags' <major>.<minor> should express minimum required Kubernetes release.

dbarranco commented 3 years ago

It seems this PR is going to cause some issues. I've tested some new Ingresses in a 1.19 kops-based Kubernetes cluster and found-out the following:

....
[spec.rules[0].http.paths[0].backend: Invalid value: "": cannot set both port name & port number

And the Ingress resource I'm testing is:

...
  - host: <omitted>
    http:
      paths:
      - backend:
          service:
            name: <omitted>
            port:
              name: http
              number: 8080
        path: /
        pathType: ImplementationSpecific

Checking-out the official docs, it seems they also stopped adding the port number and name:

spec:
  rules:
  - http:
      paths:
      - path: /testpath
        pathType: Prefix
        backend:
          service:
            name: test
            port:
              number: 80

Ref.

dbarranco commented 3 years ago

Given this is nowadays breaking some of our Continuous Deployment pipelines that are sticking to the latest kube-libsonnet, I would rather revert this PR until some changes are made (code / tests) so we stop setting the port name (I don't see the point on having a custom name there).

What do you think @jjo, @jbianquetti-nami ?

jjo commented 3 years ago

Given this is nowadays breaking some of our Continuous Deployment pipelines that are sticking to the latest kube-libsonnet, I would rather revert this PR until some changes are made (code / tests) so we stop setting the port name (I don't see the point on having a custom name there).

What do you think @jjo, @jbianquetti-nami ?

Gah sorry for that ! :( Will redo the PR, reproducing those errors using the e2e tests we already have setup there, thanks for the quick turnaround