I tried using pulumi kubernete custom resource, bu...
# kubernetes
l
I tried using pulumi kubernete custom resource, but i got the following error, anyone know how i can force using 'v1' instead of 'v1beta1'?
Copy code
const trailingSlashMiddleware = new k8s.apiextensions.CustomResource(`${name}-trailing-slash`, {
      apiVersion: '<http://traefik.containo.us/v1alpha1|traefik.containo.us/v1alpha1>',
      kind: 'Middleware',
      metadata: { namespace: args.namespace },
      spec: {
        redirectRegex: {
          regex: `^.*\\${args.prefix}$`,
          replacement: `${args.prefix}/`,
          permanent: false,
        },
      }, 
    }, { provider: opts?.provider });

-----------ERROR----------
warning: apiVersion "<http://apiextensions.k8s.io/v1beta1/CustomResourceDefinition|apiextensions.k8s.io/v1beta1/CustomResourceDefinition>" was removed in Kubernetes 1.22. Use "<http://apiextensions.k8s.io/v1/CustomResourceDefinition|apiextensions.k8s.io/v1/CustomResourceDefinition>" instead.
    error: resource <http://middlewares.traefik.containo.us|middlewares.traefik.containo.us> was not successfully created by the Kubernetes API server : apiVersion "<http://apiextensions.k8s.io/v1beta1/CustomResourceDefinition|apiextensions.k8s.io/v1beta1/CustomResourceDefinition>" was removed in Kubernetes 1.22. 
Use "<http://apiextensions.k8s.io/v1/CustomResourceDefinition|apiextensions.k8s.io/v1/CustomResourceDefinition>" instead.
f
you’re going to have to update traefik to get the v1 custom resource definitions
l
Thanks! I will give this a try
This worked! The problem was I was using an outdated helm chart
_<https://containous.github.io/traefik-helm-chart>_
whereas the correct one to use is
<https://traefik.github.io/charts>
f
great. glad i could help!