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

k8s.networking.v1.Ingress creates extensions/v1beta1 Ingress resource #1606

Closed
shinebayar-g opened this issue Jun 9, 2021 · 3 comments
Closed
Labels
kind/bug Some behavior is incorrect or out of spec

Comments

@shinebayar-g
Copy link

shinebayar-g commented Jun 9, 2021

Steps to reproduce

  1. Apply:
new k8s.networking.v1.Ingress(
  `test`,
  {
    metadata: {
      name: 'test',
      annotations: 'test',
    },
    spec: {
      rules: [
        {
          host: 'example.com',
          http: {
            paths: [
              {
                path: '/',
                pathType: 'Prefix',
                backend: {
                  service: {
                    name: 'test-svc',
                    port: {
                      number: 80
                    },
                  },
                },
              },
            ],
          },
        },
      ],
    },
  },
);
  1. Check Ingress resource that is just created.
kubectl get ing test -o yaml

Expected: pulumi-kubernetes package creates Ingress resource with apiVersion: networking.k8s.io/v1
Actual: Ingress resource was created with apiVersion: extensions/v1beta1 which is deprecated.

@shinebayar-g shinebayar-g added the kind/bug Some behavior is incorrect or out of spec label Jun 9, 2021
@shinebayar-g
Copy link
Author

I guess this has something to do with kubernetes/kubernetes#94761

kubectl get ingresses.v1.networking.k8s.io test -o yaml

returns apiVersion: networking.k8s.io/v1 Ingress.

@lblackstone
Copy link
Member

@shinebayar-g FYI, kubectl will return the apiVersion of the resource that you request, regardless of which version was used to create the resource. (It automatically converts between versions on the server). If you look at the resource in the Pulumi state, you can see which version it was created with in the __initialApiVersion field of the resource outputs.

@shinebayar-g
Copy link
Author

Mhm, thanks for the explanation. I took the hint from Ingress resource's last-applied-configuration annotation. It was indeed networking.k8s.io/v1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

2 participants