calico: Couldn't get resource list for projectcalico.org/v3: the server is currently unable to handle the request
@caseydavenport Your request was to raise a separate issue.
I installed the latest version of calico using this helm chart. The kube-apiserver-kmaster1 returns the following error in the logs: v3.projectcalico.org failed with: failing or missing response from https://**:443/apis/projectcalico.org/v3.
Also after each random kubectl command it returns errors about these CRDs.
E0406 15:33:42.335160 55793 memcache.go:106] couldn't get resource list for projectcalico.org/v3: the server is currently unable to handle the request
NAME STATUS ROLES AGE VERSION
kmaster1 Ready control-plane 19d v1.26.3
kworker1 Ready <none> 18d v1.26.3
kworker2 Ready <none> 18d v1.26.3
These CRDs are automitcally installed using the helm chart stated above.
--> k api-resources | grep calico
E0406 15:34:26.465805 55853 memcache.go:255] couldn't get resource list for projectcalico.org/v3: the server is currently unable to handle the request
E0406 15:34:26.481896 55853 memcache.go:106] couldn't get resource list for projectcalico.org/v3: the server is currently unable to handle the request
bgpconfigurations crd.projectcalico.org/v1 false BGPConfiguration
bgppeers crd.projectcalico.org/v1 false BGPPeer
blockaffinities crd.projectcalico.org/v1 false BlockAffinity
caliconodestatuses crd.projectcalico.org/v1 false CalicoNodeStatus
clusterinformations crd.projectcalico.org/v1 false ClusterInformation
felixconfigurations crd.projectcalico.org/v1 false FelixConfiguration
globalnetworkpolicies crd.projectcalico.org/v1 false GlobalNetworkPolicy
globalnetworksets crd.projectcalico.org/v1 false GlobalNetworkSet
hostendpoints crd.projectcalico.org/v1 false HostEndpoint
ipamblocks crd.projectcalico.org/v1 false IPAMBlock
ipamconfigs crd.projectcalico.org/v1 false IPAMConfig
ipamhandles crd.projectcalico.org/v1 false IPAMHandle
ippools crd.projectcalico.org/v1 false IPPool
ipreservations crd.projectcalico.org/v1 false IPReservation
kubecontrollersconfigurations crd.projectcalico.org/v1 false KubeControllersConfiguration
networkpolicies crd.projectcalico.org/v1 true NetworkPolicy
networksets crd.projectcalico.org/v1 true NetworkSet
error: unable to retrieve the complete list of server APIs: projectcalico.org/v3: the server is currently unable to handle the request
Do I understand it correctly that these crd.projectcalico.org/v1 CRDs are still needed - so not deleting them - and I need to manually install the v3 CRDs? If so, where can I download these v3 CRDs as I can’t find it
I believe chet-tuttle-3 is facing some similar issues
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 7
- Comments: 48 (11 by maintainers)
For some reason, the calico-apiserver pod is failing on liveness probes because the apiserver is not starting correctly or something is not working at all, due to that, the
apiserviceis getting reported asFailedDiscoveryCheck. I tried to play around with deployment and other things but wasn’t able to achieve something. Is there any way to enable debug logs for apiserver?I also saw that csi nodedriver for calico was failing with following reason:
@headyj added this security rule in the eks cluster:
The only apiservice that has a status of false is
v3.projectcalico.orgthat has the following error message:failing or missing response from https://***:443/apis/projectcalico.org/v3: Get "https://***:443/apis/projectcalico.org/v3": context deadline exceeded➜ ~ kubectl describe apiservice v3.projectcalico.org
The logs of the
calico-apiservicelooks like this: ➜ ~ kubectl logs --tail=-1 -n calico-apiserver -l k8s-app=calico-apiserverAnd the tigerastatus apiserver looks like this: ➜ ~ kubectl describe tigerastatus apiserver
@caseydavenport Can you maybe point me in the correct direction with this information?
If you are uninstalling apiserver, then you won’t be able to install networkpolicies with helm chart. Working around the problem doesn’t solve the issue.
@caseydavenport I followed this guide https://docs.aws.amazon.com/eks/latest/userguide/calico.html which referenced this doc for tigera operator deployment https://docs.tigera.io/calico/latest/getting-started/kubernetes/helm#install-calico basically deployed the helm chart with
kubernetesProviderset toEKSand I also assume that it auto-deploys apiserver out of the box when you deploy the operator using helm chart.I was also facing the same issue, and fixed it for the time being by running
Based on https://docs.tigera.io/calico/latest/operations/install-apiserver#uninstall-the-calico-api-server
Since we are using the default calico helm chart based install, I think the apiserver was getting created, but not configuring it properly perhaps. And since I doubt if we have a need to update the Calico settings from kubectl as part of our use-case, I think it is best to delete it for now. I will also try to find some helm value in the tigera-operator to disable this from start if possible.
PS: I am new to Calico, and please let me know if this is “unsafe” to remove, although the documentation above does not seem to suggest so.
EDIT It is easy to disable the apiServer with the helm values
Also, it seems it is not so important after all - https://docs.tigera.io/calico/latest/reference/architecture/overview#calico-api-server The component architecture says it is only needed to manage calico with kubectl, and I think that would logically mean, it is not used from “within” the cluster.
We are faced with same problem when installing tigera-operator helm chart with APIServer enabled on EKS cluster.
@lucasscheepers I was running into the same issue and was able to get around it by following the Manifest Install directions here: https://docs.tigera.io/calico/latest/operations/install-apiserver
Specifically the patch command fixed the issue:
kubectl patch apiservice v3.projectcalico.org -p \ "{\"spec\": {\"caBundle\": \"$(kubectl get secret -n calico-apiserver calico-apiserver-certs -o go-template='{{ index .data "apiserver.crt" }}')\"}}"@caseydavenport
Thank you for the update. That’s helpful. Since AWS is directly linking to Calico, you might want to update your document with a big red warning that says “Prior to installing Calico, make sure you are correctly configured your YAML”. However, my 2 cents is that the EKS configuration doesn’t seem to be actually required, since Calico worked the first time.
Unfortunately, I am hitting the issue again. I don’t know if something mysteriously got redeployed, or if it just suddenly started happening, or if I was too tired on a Friday to wait for the problem to start happening again. Regardless, here is what I see:
More Diagnostics
The problem
E0627 11:56:49.015185 15798 memcache.go:255] couldn't get resource list for projectcalico.org/v3: the server is currently unable to handle the requestmysteriously started happening again, and I need to unfortunately spend more time debugging this. This is critical to me, since I need to be able to install Network Policies using Infrastructure As Code, similar to this blog.I came across this link, which provided some hints: https://github.com/helm/helm/issues/6361
This provide some interesting details:
We can see that the API Service has failed discovery check. Digging in more:
So now I know where the issue is occurring, I can begin to actually diagnose this problem. We should check to what is going on from the pod end that should be serving the requests:
I ran an ubuntu bastion pod, and from the pod, I curled the API server:
This is a different error message than the timeout. This indicates that the server is online and responding, but that we are unauthenticated. As a result, this seems like a control plane issue, as as @caseydavenport mentioned before, I could try with
hostNetwork: trueI attempted to do this with
kubectl edit, but the deployment will not update the pods. I cannot edit the pods directly either.I then considered that perhaps the Tigera Operator was controlling this calude. I investigated if it was possible to modify this from the helm chart, but it does not seem that this is possible, since it is not located in the documentation.
We are planning to use the VPC CNI plugin soon, however it isn’t installed yet. Therefore, setting
hostNetwork: truedoes seem related to the problem as indicated here. I am not sure how it might be possible to set this. It is however suggested this is possible here.At this point I’m a little lost as to how this can be fixed. I am still digging though, so I may post another update. I am posting as much as I am so that this is perhaps helpful to someone else who stumbles upon this.
EDIT I’m pretty sure the Operator controls
hostNetwork, and it is impossible to configure this. This code suggests thathostNetworkis only set to true if you are configured to run EKS and Calico CNI. And This code suggests thathostNetworkis false by default and not configurable.For me this was some sort of firewall issue. I have configured firewall to be more permissive and I don’t see this issue anymore.