aws / karpenter-provider-aws

Karpenter is a Kubernetes Node Autoscaler built for flexibility, performance, and simplicity.
https://karpenter.sh
Apache License 2.0
6.83k stars 962 forks source link

Missing list/watch on customresourcedefinitions in 1.0.4 chart #7121

Closed jan-ludvik closed 1 month ago

jan-ludvik commented 1 month ago

Description

Observed Behavior: I updated from 1.0.2 to 1.0.4 and karpenter now says list:

k8s.io/client-go@v0.30.3/tools/cache/reflector.go:232: failed to list *v1.CustomResourceDefinition: customresourcedefinitions.apiextensions.k8s.io is forbidden: User "system:serviceaccount:kube-system:karpenter" cannot list resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster scope

watch:

k8s.io/client-go@v0.30.3/tools/cache/reflector.go:232: Failed to watch *v1.CustomResourceDefinition: failed to list *v1.CustomResourceDefinition: customresourcedefinitions.apiextensions.k8s.io is forbidden: User "system:serviceaccount:kube-system:karpenter" cannot list resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster scope

Did I miss something or was this missed in helm chart? After this karpenter pod crashes Expected Behavior: No crashloops. Reproduction Steps (Please include YAML): Used helm chart for karpenter and CRDs and updated from 1.0.2 to 1.0.4 Versions:

marcincuber commented 1 month ago

I came across this as well on EKS 1.31 and #7123 fixes the issue.

jmdeal commented 1 month ago

I take it both of you have webhooks disabled in your helm charts? These permissions are required for a version migration controller which is responsible for ensuring all resources are stored at v1; if the webhooks are disabled, the controllers shouldn't be enabled. While we're working on a fix / patch release to conditionally disable these controllers, you can unblock by adding these permissions or rolling back to the previous patch.

jmdeal commented 1 month ago

We've merged #7128 which will disable the migration controllers when the webhooks aren't enabled. We'll be getting another patch release with this fix out soon.

jmdeal commented 1 month ago

Closing, we've released 1.0.5 with the discussed changes.