https://pulumi.com logo
#kubernetes
Title
# kubernetes
c

crooked-helicopter-55521

03/25/2020, 4:05 PM
Hey y'all, I've got a question about creating a
PriorityClass
. I'm trying to do the following (on GCP):
Copy code
const schedulingPriorities = new k8s.scheduling.v1.PriorityClassList("scheduler-priorities", {
    items: [
        new k8s.scheduling.v1.PriorityClass("selector-spread-priority", {
            value: 10,
            metadata: {namespace: "default"}
        })
    ]
});
but it fails with the error:
Copy code
resource scheduler-priorities-5ynfh088 was not successfully created by the Kubernetes API server : failed to determine if the following GVK is namespaced: <http://scheduling.k8s.io/v1|scheduling.k8s.io/v1>, Kind=PriorityClassList
Anyone know what's going wrong there? Seems like the PriorityClassList doesn't take a namespace of its own
g

gorgeous-egg-16927

03/25/2020, 4:08 PM
PriorityClass
is a cluster-scoped Kind, so it doesn’t include a namespace. It seems like the error message isn’t very helpful, but try removing the namespace value and see if that fixes it
c

crooked-helicopter-55521

03/25/2020, 4:09 PM
oh, huh, Ill give that a shot. I originally had no namespace and got the same error so I tried adding it.
yeah, same thing
g

gorgeous-egg-16927

03/25/2020, 4:11 PM
Ah, I think this is actually a bug with the List type. Can you file an issue on the pulumi-kubernetes repo with that code snippet and error message?
c

crooked-helicopter-55521

03/25/2020, 4:12 PM
interesting, yup, will do. Thanks for the quick look
g

gorgeous-egg-16927

03/25/2020, 4:12 PM
You should be able to work around it by creating the
PriorityClass
directly without the enclosing
PriorityClassList
c

crooked-helicopter-55521

03/25/2020, 4:12 PM
nice, will give that a shot
b

billowy-army-68599

03/25/2020, 4:38 PM
c

crooked-helicopter-55521

03/25/2020, 4:39 PM
huh, maybe, I'm not familiar enough to really know, but that seems to be on the read side instead of the write
4 Views