-
Notifications
You must be signed in to change notification settings - Fork 984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lease: Failed to get lease: leases.coordination.k8s.io #1634
Comments
Do you have an entry like this in your aws-auth config map? kubectl get configmap aws-auth -n kube-system -o yaml
apiVersion: v1
data:
mapRoles: |
- groups:
- system:bootstrappers
- system:nodes
rolearn: arn:aws:iam::1234567890:role/eksctl-karpenter-demo-nodegroup-k-NodeInstanceRole-YBGH50RFGIEL
username: system:node:{{EC2PrivateDNSName}} |
Yes apiVersion: v1
data:
mapRoles: |
- groups:
- system:bootstrappers
- system:nodes
rolearn: arn:aws:iam::xxxx:role/sentries-eks-node-group-xxxx
username: system:node:{{EC2PrivateDNSName}}
kind: ConfigMap
metadata:
name: aws-auth
namespace: kube-system |
FYI I was able to do karpenter(verb) successfully with |
EDIT: nvm I see you upgraded to >18 and that doesn't exist :( let me track this down more. I still think it's something to do with that role. actually I think this:
should be:
Specifically this line should be |
These are the managed policies that the Node needs. Can you try adding these to an IAM Role you create in Terraform and passing that new role's instance profile to Karpenter?
|
FYI - working example that you can refer to @pratikbin https://github.com/clowdhaus/eks-reference-architecture/tree/main/karpenter |
@bryantbiggs thanks I'll try it |
There is no |
Karpenter requires at least one node to get started (something to host pods to start controlling scaling as well as running CoreDNS, VPC CNI, etc.). Here is an example of just deploying an EKS managed node group with a single node https://github.com/terraform-aws-modules/terraform-aws-eks/blob/3ff17205a4ead51cca993547ef3de42cc080043b/examples/karpenter/main.tf#L45-L56 So with that node group, an IAM role is created by the module and we can reference that to create an instance profile for Karpenter https://github.com/terraform-aws-modules/terraform-aws-eks/blob/3ff17205a4ead51cca993547ef3de42cc080043b/examples/karpenter/main.tf#L119-L122 |
@bryantbiggs It worked. Now I'll compare your's with mine.
Yes I know that. It was somekind of permission issue I bet but which permissions that I have to find. |
@pratikbin were you able to figure out this? |
@dheeraj-incred no I haven't dug deep but @bryantbiggs TF worked for me. He's using module for karpenter. |
I faced this issue and fixed it. In my case, it was due to the karpenter node had not been allow traffic to ECR service endpint which is put in private network. How did I figureout the rootcause? Reference to Troubleshoot Karpenter Node |
I had exactly the same issue, but my problem was that I mixed karpenter + managed eks groups (intentionally) and then my tag value for Provisioner.spec.provider.securityGroupSelector was selecting only "partial" of security groups, which resulted that the new node had NO security group which allows communication with the control plane of the cluster. Once I fixed it - everything worked like a charm! |
Hey all, it looks like this issue is now resolved. I'm going to close it out, but feel free to reopen if you're still having issues. Thanks! |
this should have never worked in your example because the tags are applied outside the launch template and at the cluster level .... they need to be inside the |
was running a custom AMI and had this error, my fix was changing amiFamily: Custom to amiFamily: AL2 |
Commenting on this for posterity. You can also run into this issue if you (accidentally) set the The Troubleshooting guide helped me dig into the Kubelet logs and I found:
Cert error is because it's trying to connect with the wrong certificate. Totally didn't happen to me 😄 |
== heads-up == Another "operator error" type issue can occur when one has a Karpenter provisioner with |
Version
Karpenter: v0.8.0
Kubernetes: v1.21.5-eks-bc4871b
Expected Behavior
Actual Behavior
Getting
Lease: Failed to get lease: leases.coordination.k8s.io "ip-xx-xx-xx-xx.ap-south-1.compute.internal" not found
Steps to Reproduce the Problem
Got this terraform steps from docs, fixed few deprecated modules inputs.
This will create file
basic
with necessary helm, provisioner etc. fields filled up.Resource Specs and Logs
webhook logs
https://gist.github.com/pratikbin/5e2f1c54032c6a8c43d4e60e1648c481
controller logs
https://gist.github.com/pratikbin/3db319cd9195818f6c814ce8c55644fe
The text was updated successfully, but these errors were encountered: