Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

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

Merged
merged 3 commits into from
Jun 16, 2021

Conversation

jjo
Copy link
Contributor

@jjo jjo commented Jun 15, 2021

Fixes #60.

Support Kubernetes v1.22+ apiVersions deprecations, notably:

  • Ingress:

    • use apiVersion: networking.k8s.io/v1
    • create (and populate) service field to each path
      (previously serviceName and servicePort)
    • bitnami.libsonnet: use pathType: ImplementationSpecific, which seems to be the
      most generic one
  • CustomResourceDefinition:

    • use apiVersion: apiextensions.k8s.io/v1
    • create versions map with sensible defaults, including spec
      field, as commonly used fro CRs

Other changes:

  • tests/Makefile: support (only) v1.19+

  • tests/init-kube.jsonnet: CRD tweaks

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.

jjo added 2 commits June 15, 2021 17:28
Fixes bitnami#60.

Support Kubernetes v1.22+ apiVersions deprecations, notably:

* `Ingress`:
  - use `apiVersion: networking.k8s.io/v1`
  - create (and populate) `service` field to each `path`
    (previously `serviceName` and `servicePort`)
  - `bitnami.libsonnet`: use `pathType: ImplementationSpecific`, which seems to be the
    most generic one

* `CustomResourceDefinition`:
  - use `apiVersion: apiextensions.k8s.io/v1`
  - create `versions` map with sensible defaults, including `spec`
    field, as commonly used fro CRs

Other changes:

* `tests/Makefile`: support (only) v1.19+

* `tests/init-kube.jsonnet`: CRD tweaks

FYI this is on top of bitnami#59.
@jjo jjo changed the title jjo fix issue60 1.22 deprecations [jjo] support Kubernetes v1.22+ apiVersions deprecations Jun 15, 2021
Copy link
Contributor

@dbarranco dbarranco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks good to me, thanks a lot for the contribution @jjo :)

Copy link
Contributor

@jbianquetti-nami jbianquetti-nami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! SGTM

@dbarranco dbarranco merged commit f067696 into bitnami:master Jun 16, 2021
@dbarranco
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor Author

jjo commented Jun 16, 2021

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

jjo pushed a commit to jjo/kube-libsonnet that referenced this pull request Jun 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix apiVersions for kube 1.22+
3 participants