Skip to content
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

Daemonset Antiaffinity for Fargate Nodes #329

Merged
merged 1 commit into from Mar 11, 2021
Merged

Daemonset Antiaffinity for Fargate Nodes #329

merged 1 commit into from Mar 11, 2021

Conversation

ghost
Copy link

@ghost ghost commented Feb 10, 2021

Is this a bug fix or adding new feature?

Bug fix. Relating to Issue 328

What is this PR about? / Why do we need it?

By default when following the docs at [1] with a mixed ec2/fargate EKS cluster the efs-csi-node DaemonSet will try to schedule to fargate nodes which results in pods becoming stuck in the "Pending" status.

This is easily resolvable with a node anti affinity rule.

[1] https://docs.aws.amazon.com/eks/latest/userguide/efs-csi.html

What testing is done?

I have tested the changes on my branch within a test cluster using the command below which is the exact command from the documentation but with a modified endpoint pointing to my test branch.

kubectl apply -k https://github.com/benmccown-amz/aws-efs-csi-driver/deploy/kubernetes/overlays/stable/ecr?ref=daemonset-antiaffinity-fargate

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Feb 10, 2021
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 10, 2021
@k8s-ci-robot
Copy link
Contributor

Welcome @benmccown-amz!

It looks like this is your first PR to kubernetes-sigs/aws-efs-csi-driver 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/aws-efs-csi-driver has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @benmccown-amz. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Feb 10, 2021
@ghost
Copy link
Author

ghost commented Feb 10, 2021

Just got CLA sorted.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 10, 2021
@wongma7
Copy link
Contributor

wongma7 commented Feb 10, 2021

/approve

thank you, could you squash the commits into 1. e.g. git rebase -i upstream/master ``

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: benmccown-amz, wongma7

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 10, 2021
@wongma7
Copy link
Contributor

wongma7 commented Feb 10, 2021

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 10, 2021
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 10, 2021
@ghost
Copy link
Author

ghost commented Feb 10, 2021

@wongma7 commits have been squashed.

@wongma7
Copy link
Contributor

wongma7 commented Mar 10, 2021

/lgtm

thanks again

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 10, 2021
@wongma7
Copy link
Contributor

wongma7 commented Mar 10, 2021

/test pull-aws-efs-csi-driver-e2e

1 similar comment
@wongma7
Copy link
Contributor

wongma7 commented Mar 10, 2021

/test pull-aws-efs-csi-driver-e2e

@nicogl
Copy link

nicogl commented May 24, 2021

@wongma7 @ben-mccown
The DaemonSet antiaffinity for Fargate nodes introduced here doesn't solve the issue. I tested it and still get PodNotSupported errors. I think the problem is that the way the "matchExpressions" element is defined doesn't have an infuence on the NodeGroup nodes:

    - matchExpressions:
        - key: eks.amazonaws.com/compute-type
          operator: NotIn
          values:
          - fargate

As per my understanding, above condition requires that the label "eks.amazonaws.com/compute-type" exists on the node for it to be evaluated. Now note that this label is only present on Fargate nodes, not on EC2 nodes beloging to a node group. This can be checked by running this command: kubectl get nodes --show-labels

The way I fixed it was changing the affinity to:

      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: eks.amazonaws.com/nodegroup
                operator: Exists
                values: []

This way I ensure that the related pods are run on a node group and not Fargate.

Last but not least, this affinity also has to be added to the "efs-csi-controller" Deployment element. Otherwise, the controller pods also throw errors.

Hope this makes sense, kind regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants