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

Add Nutanix CCM ignore node IPs list #9072

Merged
merged 3 commits into from
Dec 19, 2024

Conversation

adiantum
Copy link
Contributor

Description of changes:
Add kube-vip and optional list of ip addresses to CCM node ip addresses ignore list.
Required to fix bug with LB ip pool ranges and kube vip interception with node ip addresses.

Testing (if applicable):

2024-12-12T16:01:52.833Z        V6      Executing command       {"cmd": "/usr/bin/docker version --format {{.Client.Version}}"}
2024-12-12T16:01:52.853Z        V6      Executing command       {"cmd": "/usr/bin/docker info --format '{{json .MemTotal}}'"}
2024-12-12T16:01:52.898Z        V4      Reading bundles manifest        {"url": "bin/local-bundle-release.yaml"}
2024-12-12T16:01:52.917Z        V4      Using CAPI provider versions    {"Core Cluster API": "v1.8.3+c663d87", "Kubeadm Bootstrap": "v1.8.3+14076da", "Kubeadm Control Plane": "v1.8.3+c8fd5a5", "External etcd Bootstrap": "v1.0.15+b81b10d", "External etcd Controller": "v1.0.24+59fdbc8", "Cluster API Provider Nutanix": "v1.4.0+21588c3"}
2024-12-12T16:01:53.052Z        V5      Retrier:        {"timeout": "2562047h47m16.854775807s", "backoffFactor": null}
2024-12-12T16:01:53.052Z        V2      Pulling docker image    {"image": "public.ecr.aws/l0g8r8j6/eks-anywhere-cli-tools:v0.21.1-eks-a-v0.21.2-dev-build.2"}
2024-12-12T16:01:53.052Z        V6      Executing command       {"cmd": "/usr/bin/docker pull public.ecr.aws/l0g8r8j6/eks-anywhere-cli-tools:v0.21.1-eks-a-v0.21.2-dev-build.2"}
2024-12-12T16:02:03.172Z        V5      Retry execution successful      {"retries": 1, "duration": "10.12078801s"}
2024-12-12T16:02:03.172Z        V3      Initializing long running container     {"name": "eksa_1734019313052099014", "image": "public.ecr.aws/l0g8r8j6/eks-anywhere-cli-tools:v0.21.1-eks-a-v0.21.2-dev-build.2"}
2024-12-12T16:02:03.173Z        V6      Executing command       {"cmd": "/usr/bin/docker run -d --name eksa_1734019313052099014 --network host -w /home/ubuntu/eksa-tests/ccm-ips -v /var/run/docker.sock:/var/run/docker.sock -v /home/ubuntu/eksa-tests/ccm-ips:/home/ubuntu/eksa-tests/ccm-ips -v /home/ubuntu/eksa-tests/ccm-ips:/home/ubuntu/eksa-tests/ccm-ips --entrypoint sleep public.ecr.aws/l0g8r8j6/eks-anywhere-cli-tools:v0.21.1-eks-a-v0.21.2-dev-build.2 infinity"}
2024-12-12T16:02:03.878Z        V1      Using the eksa controller to create the management cluster
2024-12-12T16:02:03.878Z        V4      Task start      {"task_name": "setup-validate"}
2024-12-12T16:02:03.878Z        V0      Performing setup and validations
2024-12-12T16:02:03.878Z        V0      ValidateClusterSpec for Nutanix datacenter      {"NutanixDatacenter": "eksa-ntnx-fiql-fix"}
2024-12-12T16:02:09.980Z        V0      ✅ Nutanix Provider setup is valid
2024-12-12T16:02:09.980Z        V0      ✅ Validate OS is compatible with registry mirror configuration
2024-12-12T16:02:09.980Z        V0      ✅ Validate certificate for registry mirror
2024-12-12T16:02:09.980Z        V0      ✅ Validate authentication for git provider
2024-12-12T16:02:09.980Z        V0      ✅ Validate cluster's eksaVersion matches EKS-A version
2024-12-12T16:02:09.980Z        V4      Task finished   {"task_name": "setup-validate", "duration": "6.101914735s"}
2024-12-12T16:02:09.980Z        V4      ----------------------------------
...
2024-12-12T16:19:07.807Z        V6      Executing command       {"cmd": "/usr/bin/docker exec -i eksa_1734019313052099014 kind delete cluster --name eksa-ntnx-fiql-fix-eks-a-cluster"}
2024-12-12T16:19:08.915Z        V5      Retry execution successful      {"retries": 1, "duration": "1.108862206s"}
2024-12-12T16:19:08.915Z        V0      🎉 Cluster created!
2024-12-12T16:19:08.915Z        V4      Task finished   {"task_name": "delete-kind-cluster", "duration": "1.563733969s"}
2024-12-12T16:19:08.915Z        V4      ----------------------------------
2024-12-12T16:19:08.915Z        V4      Task start      {"task_name": "install-curated-packages"}
--------------------------------------------------------------------------------------
The Amazon EKS Anywhere Curated Packages are only available to customers with the
Amazon EKS Anywhere Enterprise Subscription
--------------------------------------------------------------------------------------
...
Screenshot 2024-12-12 at 17 39 41

Documentation added/planned (if applicable):
Description of 'ccmExcludeNodeIPs' field of NutanixDatacenterConfig spec will be added

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@eks-distro-bot
Copy link
Collaborator

Hi @adiantum. Thanks for your PR.

I'm waiting for a aws 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.

@eks-distro-bot eks-distro-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Dec 12, 2024
 - fix kube-vip validation
 - fix kube-vip add to ignore node list
 - add unit-test
@abhinavmpandey08
Copy link
Member

/ok-to-test

Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 83.60656% with 20 lines in your changes missing coverage. Please review.

Please upload report for BASE (release-0.21@9185691). Learn more about missing BASE report.

Files with missing lines Patch % Lines
pkg/providers/nutanix/validator.go 78.57% 8 Missing and 4 partials ⚠️
pkg/providers/nutanix/template.go 87.87% 6 Missing and 2 partials ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##             release-0.21    #9072   +/-   ##
===============================================
  Coverage                ?   72.39%           
===============================================
  Files                   ?      578           
  Lines                   ?    45541           
  Branches                ?        0           
===============================================
  Hits                    ?    32968           
  Misses                  ?    10837           
  Partials                ?     1736           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 605 to 610
ip, ipNet, err := net.ParseCIDR(cidr)
if err != nil {
// log error and continue
log.Printf("error parsing CIDR %s: %v", cidr, err)
return result
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are already validating this in the validator. Let's remove it from here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Comment on lines 623 to 650
// Parse the range
ipRange := strings.Split(ipRangeStr, "-")
if len(ipRange) != 2 {
// log error and return
log.Printf("error parsing range %s: expected 2 values, got %d", ipRangeStr, len(ipRange))
return result
}

// Parse the start and end of the range
start := net.ParseIP(strings.TrimSpace(ipRange[0]))
end := net.ParseIP(strings.TrimSpace(ipRange[1]))
if start == nil || end == nil {
// log error and return
log.Printf("error parsing range %s: invalid IP address", ipRangeStr)
return result
}

cmp, err := compareIP(start, end)
if err != nil {
// log error and return
log.Printf("error comparing IP addresses %s and %s: %v", start.String(), end.String(), err)
return result
}

if cmp >= 0 {
// swap start and end if start is greater than end
start, end = end, start
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above, already validated in validator, can be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Comment on lines 663 to 668
ip := net.ParseIP(ipAddrStr)
if ip == nil {
// log error and return
log.Printf("error parsing IP address %s", ipAddrStr)
return result
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here as well, already validated, can be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Member

@abhinavmpandey08 abhinavmpandey08 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve
/woof

@eks-distro-bot
Copy link
Collaborator

@abhinavmpandey08: dog image

In response to this:

/lgtm
/approve
/woof

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.

@eks-distro-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavmpandey08

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

@eks-distro-bot eks-distro-bot merged commit c13528d into aws:release-0.21 Dec 19, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm ok-to-test size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants