Skip to content

unable to retrieve the complete list of server APIs #6361

Closed

Description

@planetf1

Output of helm version:
version.BuildInfo{Version:"v3.0+unreleased", GitCommit:"180db556aaf45f34516f8ddb9ddac28d71736a3e", GitTreeState:"clean", GoVersion:"go1.13"}

Output of kubectl version:
lient Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3", GitCommit:"2d3c76f9091b6bec110a5e63777c332469e0cba2", GitTreeState:"clean", BuildDate:"2019-08-19T12:36:28Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3+IKS", GitCommit:"66a72e7aa8fd2dbf64af493f50f943d7f7067916", GitTreeState:"clean", BuildDate:"2019-08-23T08:07:38Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}

Cloud Provider/Platform (AKS, GKE, Minikube etc.):
IBM Cloud

Helm chart deployment fails with:

➜  charts git:(h2update2) helm install vdc -f ~/etc/cloud-noes.yaml vdc                                                                                                                                <<<
coalesce.go:155: warning: skipped value for image: Not a table.
Error: could not get apiVersions from Kubernetes: unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: the server is currently unable to handle the request

(The first error is in a confluent chart... here I discuss the second issue)

Looking at the error I see a similar problem with

➜  charts git:(h2update2) kubectl api-resources
NAME                              SHORTNAMES      APIGROUP                           NAMESPACED   KIND
bindings                                                                             true         Binding
componentstatuses                 cs                                                 false        ComponentStatus
configmaps                        cm                                                 true         ConfigMap
endpoints                         ep                                                 true         Endpoints
events                            ev                                                 true         Event
limitranges                       limits                                             true         LimitRange
namespaces                        ns                                                 false        Namespace
nodes                             no                                                 false        Node
persistentvolumeclaims            pvc                                                true         PersistentVolumeClaim
persistentvolumes                 pv                                                 false        PersistentVolume
pods                              po                                                 true         Pod
podtemplates                                                                         true         PodTemplate
replicationcontrollers            rc                                                 true         ReplicationController
resourcequotas                    quota                                              true         ResourceQuota
secrets                                                                              true         Secret
serviceaccounts                   sa                                                 true         ServiceAccount
services                          svc                                                true         Service
mutatingwebhookconfigurations                     admissionregistration.k8s.io       false        MutatingWebhookConfiguration
validatingwebhookconfigurations                   admissionregistration.k8s.io       false        ValidatingWebhookConfiguration
customresourcedefinitions         crd,crds        apiextensions.k8s.io               false        CustomResourceDefinition
apiservices                                       apiregistration.k8s.io             false        APIService
controllerrevisions                               apps                               true         ControllerRevision
daemonsets                        ds              apps                               true         DaemonSet
deployments                       deploy          apps                               true         Deployment
replicasets                       rs              apps                               true         ReplicaSet
statefulsets                      sts             apps                               true         StatefulSet
meshpolicies                                      authentication.istio.io            false        MeshPolicy
policies                                          authentication.istio.io            true         Policy
tokenreviews                                      authentication.k8s.io              false        TokenReview
localsubjectaccessreviews                         authorization.k8s.io               true         LocalSubjectAccessReview
selfsubjectaccessreviews                          authorization.k8s.io               false        SelfSubjectAccessReview
selfsubjectrulesreviews                           authorization.k8s.io               false        SelfSubjectRulesReview
subjectaccessreviews                              authorization.k8s.io               false        SubjectAccessReview
horizontalpodautoscalers          hpa             autoscaling                        true         HorizontalPodAutoscaler
metrics                                           autoscaling.internal.knative.dev   true         Metric
podautoscalers                    kpa,pa          autoscaling.internal.knative.dev   true         PodAutoscaler
cronjobs                          cj              batch                              true         CronJob
jobs                                              batch                              true         Job
images                            img             caching.internal.knative.dev       true         Image
certificatesigningrequests        csr             certificates.k8s.io                false        CertificateSigningRequest
certificates                      cert,certs      certmanager.k8s.io                 true         Certificate
challenges                                        certmanager.k8s.io                 true         Challenge
clusterissuers                                    certmanager.k8s.io                 false        ClusterIssuer
issuers                                           certmanager.k8s.io                 true         Issuer
orders                                            certmanager.k8s.io                 true         Order
adapters                                          config.istio.io                    true         adapter
attributemanifests                                config.istio.io                    true         attributemanifest
handlers                                          config.istio.io                    true         handler
httpapispecbindings                               config.istio.io                    true         HTTPAPISpecBinding
httpapispecs                                      config.istio.io                    true         HTTPAPISpec
instances                                         config.istio.io                    true         instance
quotaspecbindings                                 config.istio.io                    true         QuotaSpecBinding
quotaspecs                                        config.istio.io                    true         QuotaSpec
rules                                             config.istio.io                    true         rule
templates                                         config.istio.io                    true         template
leases                                            coordination.k8s.io                true         Lease
brokers                                           eventing.knative.dev               true         Broker
channels                          chan            eventing.knative.dev               true         Channel
clusterchannelprovisioners        ccp             eventing.knative.dev               false        ClusterChannelProvisioner
eventtypes                                        eventing.knative.dev               true         EventType
subscriptions                     sub             eventing.knative.dev               true         Subscription
triggers                                          eventing.knative.dev               true         Trigger
events                            ev              events.k8s.io                      true         Event
daemonsets                        ds              extensions                         true         DaemonSet
deployments                       deploy          extensions                         true         Deployment
ingresses                         ing             extensions                         true         Ingress
networkpolicies                   netpol          extensions                         true         NetworkPolicy
podsecuritypolicies               psp             extensions                         false        PodSecurityPolicy
replicasets                       rs              extensions                         true         ReplicaSet
channels                          ch              messaging.knative.dev              true         Channel
choices                                           messaging.knative.dev              true         Choice
inmemorychannels                  imc             messaging.knative.dev              true         InMemoryChannel
sequences                                         messaging.knative.dev              true         Sequence
nodes                                             metrics.k8s.io                     false        NodeMetrics
pods                                              metrics.k8s.io                     true         PodMetrics
certificates                      kcert           networking.internal.knative.dev    true         Certificate
clusteringresses                                  networking.internal.knative.dev    false        ClusterIngress
ingresses                         ing             networking.internal.knative.dev    true         Ingress
serverlessservices                sks             networking.internal.knative.dev    true         ServerlessService
destinationrules                  dr              networking.istio.io                true         DestinationRule
envoyfilters                                      networking.istio.io                true         EnvoyFilter
gateways                          gw              networking.istio.io                true         Gateway
serviceentries                    se              networking.istio.io                true         ServiceEntry
sidecars                                          networking.istio.io                true         Sidecar
virtualservices                   vs              networking.istio.io                true         VirtualService
ingresses                         ing             networking.k8s.io                  true         Ingress
networkpolicies                   netpol          networking.k8s.io                  true         NetworkPolicy
poddisruptionbudgets              pdb             policy                             true         PodDisruptionBudget
podsecuritypolicies               psp             policy                             false        PodSecurityPolicy
clusterrolebindings                               rbac.authorization.k8s.io          false        ClusterRoleBinding
clusterroles                                      rbac.authorization.k8s.io          false        ClusterRole
rolebindings                                      rbac.authorization.k8s.io          true         RoleBinding
roles                                             rbac.authorization.k8s.io          true         Role
authorizationpolicies                             rbac.istio.io                      true         AuthorizationPolicy
clusterrbacconfigs                                rbac.istio.io                      false        ClusterRbacConfig
rbacconfigs                                       rbac.istio.io                      true         RbacConfig
servicerolebindings                               rbac.istio.io                      true         ServiceRoleBinding
serviceroles                                      rbac.istio.io                      true         ServiceRole
priorityclasses                   pc              scheduling.k8s.io                  false        PriorityClass
configurations                    config,cfg      serving.knative.dev                true         Configuration
revisions                         rev             serving.knative.dev                true         Revision
routes                            rt              serving.knative.dev                true         Route
services                          kservice,ksvc   serving.knative.dev                true         Service
apiserversources                                  sources.eventing.knative.dev       true         ApiServerSource
awssqssources                                     sources.eventing.knative.dev       true         AwsSqsSource
containersources                                  sources.eventing.knative.dev       true         ContainerSource
cronjobsources                                    sources.eventing.knative.dev       true         CronJobSource
githubsources                                     sources.eventing.knative.dev       true         GitHubSource
kafkasources                                      sources.eventing.knative.dev       true         KafkaSource
csidrivers                                        storage.k8s.io                     false        CSIDriver
csinodes                                          storage.k8s.io                     false        CSINode
storageclasses                    sc              storage.k8s.io                     false        StorageClass
volumeattachments                                 storage.k8s.io                     false        VolumeAttachment
clustertasks                                      tekton.dev                         false        ClusterTask
pipelineresources                                 tekton.dev                         true         PipelineResource
pipelineruns                      pr,prs          tekton.dev                         true         PipelineRun
pipelines                                         tekton.dev                         true         Pipeline
taskruns                          tr,trs          tekton.dev                         true         TaskRun
tasks                                             tekton.dev                         true         Task
error: unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: the server is currently unable to handle the request
➜  charts git:(h2update2)

Then looking at 'action.go' in the source I can see that if this api call fails, we exit getCapabilities(). I understand why ... but is this failure too 'hard' - in the case above the error was a minor service?

This seems to have come up recently due to some changes on the k8s service with metrics.
I will persue that seperately... but was after thoughts on how helm handles this situation
Also a heads up helm3 may be broken on IKS - but I'm not knowledgeable enough to dig much further?

Activity

  1. added
    v3.x
    on Sep 6, 2019
  2. kalioz commented on Sep 11, 2019

    @kalioz

    I have the same issue on AKS, though the error message is

    Error: could not get apiVersions from Kubernetes: unable to retrieve the complete list of server APIs: metrics.k8s.io/v1beta1: the server is currently unable to handle the request

    my config :

    • kubectl version :

    Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.2", GitCommit:"f6278300bebbb750328ac16ee6dd3aa7d3549568", GitTreeState:"clean", BuildDate:"2019-08-05T09:23:26Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"windows/amd64"}
    Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.6", GitCommit:"96fac5cd13a5dc064f7d9f4f23030a6aeface6cc", GitTreeState:"clean", BuildDate:"2019-08-19T11:05:16Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}

    • helm version: alpine/helm:3.0.0-beta.2 (docker)

    • kubectl api-resources

    bindings                                                                      true         Binding
    componentstatuses                 cs                                          false        ComponentStatus
    configmaps                        cm                                          true         ConfigMap
    endpoints                         ep                                          true         Endpoints
    events                            ev                                          true         Event
    limitranges                       limits                                      true         LimitRange
    namespaces                        ns                                          false        Namespace
    nodes                             no                                          false        Node
    persistentvolumeclaims            pvc                                         true         PersistentVolumeClaim
    persistentvolumes                 pv                                          false        PersistentVolume
    pods                              po                                          true         Pod
    podtemplates                                                                  true         PodTemplate
    replicationcontrollers            rc                                          true         ReplicationController
    resourcequotas                    quota                                       true         ResourceQuota
    secrets                                                                       true         Secret
    serviceaccounts                   sa                                          true         ServiceAccount
    services                          svc                                         true         Service
    mutatingwebhookconfigurations                  admissionregistration.k8s.io   false        MutatingWebhookConfiguration
    validatingwebhookconfigurations                admissionregistration.k8s.io   false        ValidatingWebhookConfiguration
    customresourcedefinitions         crd,crds     apiextensions.k8s.io           false        CustomResourceDefinition
    apiservices                                    apiregistration.k8s.io         false        APIService
    controllerrevisions                            apps                           true         ControllerRevision
    daemonsets                        ds           apps                           true         DaemonSet
    deployments                       deploy       apps                           true         Deployment
    replicasets                       rs           apps                           true         ReplicaSet
    statefulsets                      sts          apps                           true         StatefulSet
    tokenreviews                                   authentication.k8s.io          false        TokenReview
    localsubjectaccessreviews                      authorization.k8s.io           true         LocalSubjectAccessReview
    selfsubjectaccessreviews                       authorization.k8s.io           false        SelfSubjectAccessReview
    selfsubjectrulesreviews                        authorization.k8s.io           false        SelfSubjectRulesReview
    subjectaccessreviews                           authorization.k8s.io           false        SubjectAccessReview
    horizontalpodautoscalers          hpa          autoscaling                    true         HorizontalPodAutoscaler
    cronjobs                          cj           batch                          true         CronJob
    jobs                                           batch                          true         Job
    certificatesigningrequests        csr          certificates.k8s.io            false        CertificateSigningRequest
    leases                                         coordination.k8s.io            true         Lease
    events                            ev           events.k8s.io                  true         Event
    daemonsets                        ds           extensions                     true         DaemonSet
    deployments                       deploy       extensions                     true         Deployment
    ingresses                         ing          extensions                     true         Ingress
    networkpolicies                   netpol       extensions                     true         NetworkPolicy
    podsecuritypolicies               psp          extensions                     false        PodSecurityPolicy
    replicasets                       rs           extensions                     true         ReplicaSet
    ingresses                         ing          networking.k8s.io              true         Ingress
    networkpolicies                   netpol       networking.k8s.io              true         NetworkPolicy
    runtimeclasses                                 node.k8s.io                    false        RuntimeClass
    poddisruptionbudgets              pdb          policy                         true         PodDisruptionBudget
    podsecuritypolicies               psp          policy                         false        PodSecurityPolicy
    clusterrolebindings                            rbac.authorization.k8s.io      false        ClusterRoleBinding
    clusterroles                                   rbac.authorization.k8s.io      false        ClusterRole
    rolebindings                                   rbac.authorization.k8s.io      true         RoleBinding
    roles                                          rbac.authorization.k8s.io      true         Role
    priorityclasses                   pc           scheduling.k8s.io              false        PriorityClass
    csidrivers                                     storage.k8s.io                 false        CSIDriver
    csinodes                                       storage.k8s.io                 false        CSINode
    storageclasses                    sc           storage.k8s.io                 false        StorageClass
    volumeattachments                              storage.k8s.io                 false        VolumeAttachment
    error: unable to retrieve the complete list of server APIs: metrics.k8s.io/v1beta1: the server is currently unable to handle the request```
    
  3. planetf1 commented on Sep 11, 2019

    @planetf1
    Author

    I believe in my case this issue started recently... it seems to be in relation to having knative installed in my case (On IBM Cloud IKS this is a managed option). I've uninstalled knative and am ok for now, but there could be an interop issue here

    @kalioz out of interest are you using knative on AWS? It looks not actually since I can't see the tekton objects

  4. EmperorArthur commented on Sep 12, 2019

    @EmperorArthur

    I have just seen this issue myself. In my case it was cert-manager that triggered the problem. Still working on how to get it back to how it was.

  5. kalioz commented on Sep 12, 2019

    @kalioz

    @planetf1 I'm not using knative (or i think i don't), but the problem only exist on the new cluster I deployed for this test.
    The differences between the working cluster and the not-working are :

    working not-working
    kube version 1.13.5 1.14.6
    azure AD authentification disabled enabled
    RBAC disabled enabled

    So i have some major changes.

    To me the problem is that helm3 crash because of the lack of access to some apis, who are not used for the chart i'm trying to deploy.

  6. rvairaashtak commented on Sep 20, 2019

    @rvairaashtak

    I am using it on k8 cluster version 1.13.9, same error is coming for deploying any stable chart.

    helm version
    version.BuildInfo{Version:"v3.0.0-beta.3", GitCommit:"5cb923eecbe80d1ad76399aee234717c11931d9a", GitTreeState:"clean", GoVersion:"go1.12.9"}

    helm.go:81: [debug] unable to retrieve the complete list of server APIs: metrics.k8s.io/v1beta1: the server is currently unable to handle the request.

  7. kalioz commented on Sep 22, 2019

    @kalioz

    After resolving the issue from the metrics pod (can't remember how I solved it, i think it might have to do with hostNetwork or simply restarting the associated pod) helm3 function as expected.
    So it might be a 'feature' as it forces to maintain the cluster in good health, but it'll require someone to manually go in the cluster each time an api break (and thus might prevent using helm3 to deploy pods able to be listed on this).

  8. EmperorArthur commented on Sep 23, 2019

    @EmperorArthur

    It's really, really annoying as someone starting out with Kubernetes. I'm hand rolling a solution for certificates using acme, since I can't guarantee that cert manager won't still be broken even after configuring it.

    The really annoying part is I can't just use helm to uninstall cert manager and get back to where I was! Anything which allows a strongly recommended service to break it, and won't undo the change is broken.

  9. brendandburns commented on Oct 4, 2019

    @brendandburns

    For anyone who hits this, it's caused by api-services that no longer have backends running...

    In my case it was KEDA, but there are a number of different services that install aggregated API servers.

    To fix it:

    kubectl get apiservice
    

    Look for ones the AVAILABLE is False

    If you don't need those APIs any more, delete them:

    kubectl delete apiservce <service-name>
    

    Then Helm should work properly. I think improving the Helm error message for this case may be worthwhile...

  10. planetf1 commented on Oct 4, 2019

    @planetf1
    Author

    Thanks for the explanation - is there a way Helm could code around this too?

  11. technosophos commented on Oct 4, 2019

    @technosophos
    Member

    We think so, though we're still investigating. My first look suggests that this is just related to our usage of the Discovery API, which is used for the Capabilities object in template rendering. We might be able to trap this particular error and warn the user instead of failing.

  12. added
    bug
    and removed on Oct 4, 2019
  13. sjentzsch commented on Oct 21, 2019

    @sjentzsch

    Same with 2.15.0 now:

    Error: Could not get apiVersions from Kubernetes: unable to retrieve the complete list of server APIs: metrics.k8s.io/v1beta1: the server is currently unable to handle the request
    

    This is pretty annoying. Warning instead of failing would be much better indeed.
    Any updates on this so far?

    EDIT: can s/o confirm 2.15 also being affected? Then I would suggest to adjust the labels of this ticket.

  14. 58 remaining items

  15. gkowalski-google commented on Mar 17, 2020

    @gkowalski-google

    I have not, I can give it a try this week. Since I am using this with Terraform, can I build/run the dev-v2 branch and set the repository variable of the helm_release resource to "local" to simulate?

  16. oleksandr-semak commented on Apr 7, 2020

    @oleksandr-semak

    @bacongobbler We faced the same issue with prometheus-adapter which exposed custom apiservice and if I failed release with custom apiservice and kubectl get apiservice any of this list would be AVAILABLE=false helm no longer able to make any new release even if it not related to custom apiservice:
    err="Could not get apiVersions from Kubernetes: unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: the server is currently unable to handle the request"

  17. buremba commented on Apr 28, 2020

    @buremba

    Helm 2 with the Terraform provider is broken because of this issue at the moment and. I hope you can also provide a fix for it, it looks like this is a common use-case.

  18. nodox commented on Jun 19, 2020

    @nodox

    Can confirm I'm having this issue as well. Hoping for a fix.

  19. Sanket110297 commented on Jun 20, 2020

    @Sanket110297

    Solution:

    The steps I followed are:

    1. kubectl get apiservices : If metric-server service is down with the error CrashLoopBackOff try to follow the step 2 otherwise just try to restart the metric-server service using kubectl delete apiservice/"service_name". For me it was v1beta1.metrics.k8s.io .

    2. kubectl get pods -n kube-system and found out that pods like metrics-server, kubernetes-dashboard are down because of the main coreDNS pod was down.

    For me it was:

    NAME                          READY   STATUS             RESTARTS   AGE
    pod/coredns-85577b65b-zj2x2   0/1     CrashLoopBackOff   7          13m
    
    1. Use kubectl describe pod/"pod_name" to check the error in coreDNS pod and if it is down because of /etc/coredns/Corefile:10 - Error during parsing: Unknown directive proxy, then we need to use forward instead of proxy in the yaml file where coreDNS config is there. Because CoreDNS version 1.5x used by the image does not support the proxy keyword anymore.

    https://stackoverflow.com/questions/62442679/could-not-get-apiversions-from-kubernetes-unable-to-retrieve-the-complete-list

  20. added a commit that references this issue on Jul 6, 2020
  21. added a commit that references this issue on Jul 6, 2020
  22. marcelloromani commented on Jun 11, 2021

    @marcelloromani

    @brendandburns Glad to have found your answer after a few hours of googling! :-D Too bad this is not StackOverflow, you'd deserve quite a few upvotes ;-)

  23. pcgeek86 commented on Feb 28, 2022

    @pcgeek86

    On Amazon EKS I had to uninstall their metrics server. That cleaned up the error.

    kubectl delete --filename https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
    

    Use this command to verify that you don't get any more errors.

    kubectl api-resources
    

    https://docs.aws.amazon.com/eks/latest/userguide/metrics-server.html

  24. rubenpetrosyan1 commented on Apr 7, 2022

    @rubenpetrosyan1

    For anyone who hits this, it's caused by api-services that no longer have backends running...

    In my case it was KEDA, but there are a number of different services that install aggregated API servers.

    To fix it:

    kubectl get apiservice
    

    Look for ones the AVAILABLE is False

    If you don't need those APIs any more, delete them:

    kubectl delete apiservce <service-name>
    

    Then Helm should work properly. I think improving the Helm error message for this case may be worthwhile...

    This helped a lot.
    In my case there was restarting pod causing the issue. Solved the issue with pod and everything beck operational.
    Thanks

  25. uqix commented on Feb 2, 2023

    @uqix

    For anyone who hits this, it's caused by api-services that no longer have backends running...

    In my case it was KEDA, but there are a number of different services that install aggregated API servers.

    To fix it:

    kubectl get apiservice
    

    Look for ones the AVAILABLE is False

    If you don't need those APIs any more, delete them:

    kubectl delete apiservce <service-name>
    

    Then Helm should work properly. I think improving the Helm error message for this case may be worthwhile...

    There is a typo: apiservce.

  26. francardoso93 commented on Dec 12, 2024

    @francardoso93

    For future readers: I got this error because I was with my VPN turned off

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugv3.x

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions