Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing aliases and deprecation warnings for some API resources #919

Closed
AaronFriel opened this issue Dec 16, 2019 · 2 comments · Fixed by #921
Closed

Missing aliases and deprecation warnings for some API resources #919

AaronFriel opened this issue Dec 16, 2019 · 2 comments · Fixed by #921
Assignees
Labels
kind/enhancement Improvements or new features
Milestone

Comments

@AaronFriel
Copy link
Member

Problem description

There are many kinds of resources not covered beyond the StatefulSet and Deployment currently canonicalized. Because of this, changing the API versions of other kinds of resources fails, e.g.: ingresses, statefulsets, networkpolicies, etc.

Errors & Logs

Pulumi both warns that old versions of resources are out of date:

203  ~  kubernetes:extensions:Ingress stack-foo/some-resource refresh warning: extensions/v1beta1/Ingress is not supported by Kubernetes 1.16+ clusters. Use networking/v1beta1/Ingress instead.
...

230 Diagnostics:
...
237   kubernetes:extensions:Ingress (stack-foo/some-resource):
238     warning: extensions/v1beta1/Ingress is not supported by Kubernetes 1.16+ clusters. Use networking/v1beta1/Ingress instead.

And then fails when said resource is changed:

336  +  kubernetes:networking.k8s.io:Ingress stack-foo/some-resource creating 
338  +  kubernetes:networking.k8s.io:Ingress stack-foo/some-resource creating Retry #0; creation failed: ingresses.networking.k8s.io "chronicler" already exists
339  +  kubernetes:networking.k8s.io:Ingress stack-foo/some-resource creating error: resource stack-foo/some-resource was not successfully created by the Kubernetes API server : ingresses.networking.k8s.io "chronicler" already exists
340  +  kubernetes:networking.k8s.io:Ingress stack-foo/some-resource **creating failed** error: resource stack-foo/some-resource was not successfully created by the Kubernetes API server : ingresses.networking.k8s.io "chronicler" already exists

Affected product version(s)

All versions

Reproducing the issue

Deploy a extensions/v1beta1 Ingress then upgrade it to a networking/v1beta1 Ingress.

Suggestions for a fix

I went through and labeled all of the deprecations and removals I could. Here's how to read the table:

  • Implemented: the minimum version of k8s required to perform this canonicalization
  • Deprecated: the release that marked the API as deprecated, but the API is reachable
  • Removed: the release that removed access to the API by default

The table below might be useful for passing an optional argument to the canonicalizer with the current k8s API version, one could imagine if (version >= deprecated) { return newApi } else { return oldApi }

I think the implemented version is not terribly necessary, and since those versions are quite old and only early adopters switched API versions right away, it's probably best to compare the current k8s cluster version to the version an API was deprecated in, in which the official release notes suggest moving to a new API. This list may not be complete.

1.9 Deprecations
1.10 Deprecations
1.11 Deprecations
1.12 Deprecations
1.13 Deprecations
1.14 Deprecations
1.15 Deprecations
1.16 Deprecations
1.17 Deprecations

Implemented Deprecated Removed Kind From From
1.14 1.14 1.20 Ingress extensions/v1beta1 networking.k8s.io/v1beta1
1.8 1.14 1.16 NetworkPolicy extensions/v1beta1 networking.k8s.io/v1
1.10 1.14 1.16 PodSecurityPolicy extensions/v1beta1 policy/v1beta1
1.9 1.14 1.16 DaemonSet extensions/v1beta1 apps/v1
1.9 1.14 1.16 Deployment extensions/v1beta1 apps/v1
1.9 1.14 1.16 ReplicaSet extensions/v1beta1 apps/v1
1.9 1.14 1.16 StatefulSet extensions/v1beta1 apps/v1
1.9 1.16 * apps/v1beta1 apps/v1
1.9 1.16 * apps/v1beta2 apps/v1
1.11 1.14 1.17 PriorityClass scheduling/k8s.io/v1alpha1 scheduling.k8s.io/v1
1.11 1.14 1.17 PriorityClass scheduling/k8s.io/v1beta1 scheduling.k8s.io/v1
1.15 1.17 1.20 * kubeadm.k8s.io/v1beta1 kubeadm.k8s.io/v1beta2
1.9 1.17 1.20 * rbac.authorization.k8s.io/v1alpha1 rbac.authorization.k8s.io/v1
1.9 1.17 1.20 * rbac.authorization.k8s.io/v1beta1 rbac.authorization.k8s.io/v1

This table would also be helpful if Pulumi maintained it because combing over Kubernetes release notes is a pain!

@lukehoban lukehoban added this to the 0.31 milestone Dec 16, 2019
@lukehoban lukehoban added the kind/enhancement Improvements or new features label Dec 16, 2019
@lblackstone
Copy link
Member

The issue description isn't quite right, but I fixed the underlying problems in #921 and #918

The provider should now properly warn for all deprecated APIs, and provide an error if the API has been removed in the targeted cluster version.

@lblackstone lblackstone changed the title API Version canonicalization is not complete and not versioned Missing aliases and deprecation warnings for some API resources Dec 17, 2019
@Dominik-K
Copy link

@AaronFriel Great overview list. Thanks 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements or new features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants