Skip to content

[feat] add support for using linode interfaces (beta-only) #435

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

Merged
merged 4 commits into from
Aug 19, 2025

Conversation

AshleyDumaine
Copy link
Contributor

@AshleyDumaine AshleyDumaine commented Aug 13, 2025

Linode Interfaces is in beta. This adds support so the CCM can work on Linodes using the new linode interfaces.

NOTE: If you want to test this locally you need to opt in to the Linode Interfaces beta AND the ability to use VPC-only backends (see linode/cluster-api-provider-linode#803).

Testing with linode interfaces

  1. Make a CAPL cluster that uses the new network interfaces (follow the Testing section in [feat] Add support for new network interfaces cluster-api-provider-linode#821) but update the test-cluster.yaml BEFORE APPLYING IT to have the following:
  • adumaine/linode-cloud-controller-manager:linode-interfaces for the CCM repo and version, e.g.:
<snip>
---
apiVersion: addons.cluster.x-k8s.io/v1alpha1
kind: HelmChartProxy
metadata:
  name: test-cluster-linode-cloud-controller-manager
  namespace: default
spec:
  chartName: ccm-linode
  clusterSelector:
    matchLabels:
      ccm: test-cluster-linode
  namespace: kube-system
  options:
    timeout: 5m
    wait: true
    waitForJobs: true
  repoURL: https://linode.github.io/linode-cloud-controller-manager/
  valuesTemplate: |
    routeController:
      vpcNames: {{ .InfraCluster.spec.vpcRef.name }}
      clusterCIDR: 10.0.0.0/8
      configureCloudRoutes: true
    secretRef:
      name: "linode-token-region"
    image:
      pullPolicy: IfNotPresent
      repository: adumaine/linode-cloud-controller-manager
      tag: linode-interfaces
<snip>
  • VPC NBs by replacing the LinodeMachineTemplate.Spec.Template.Spec.Interfaces with:
      privateIP: false
      vpcRef:
        apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
        kind: LinodeVPC
        name: test-cluster

and adding the following to the LinodeCluster.Spec.Network:

    enableVPCBackends: true
  1. Apply the update cluster yaml:
kubectl apply -f test-cluster.yaml
  1. Get the kubeconfig:
clusterctl get kubeconfig test-cluster > test-kubeconfig.yaml
  1. Wait for the cluster to be ready
kubectl wait --for=condition=Ready cluster test-cluster --timeout=60s
  1. Confirm CCM runs successfully with new network interfaces:
kubctl --kubeconfig test-kubeconfig.yaml -n kube-system logs -f ds/ccm-linode

General:

  • Have you removed all sensitive information, including but not limited to access keys and passwords?
  • Have you checked to ensure there aren't other open or closed Pull Requests for the same bug/feature/question?

Pull Request Guidelines:

  1. Does your submission pass tests?
  2. Have you added tests?
  3. Are you addressing a single feature in this PR?
  4. Are your commits atomic, addressing one change per commit?
  5. Are you following the conventions of the language?
  6. Have you saved your large formatting changes for a different PR, so we can focus on your work?
  7. Have you explained your rationale for why this feature is needed?
  8. Have you linked your PR to an open issue

Copy link

codecov bot commented Aug 13, 2025

Codecov Report

❌ Patch coverage is 52.63158% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.87%. Comparing base (ee8fb73) to head (2b2d8e8).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
cloud/nodeipam/ipam/cloud_allocator.go 43.58% 18 Missing and 4 partials ⚠️
cloud/linode/route_controller.go 62.16% 12 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #435      +/-   ##
==========================================
- Coverage   72.17%   71.87%   -0.31%     
==========================================
  Files          19       19              
  Lines        3551     3598      +47     
==========================================
+ Hits         2563     2586      +23     
- Misses        751      773      +22     
- Partials      237      239       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AshleyDumaine
Copy link
Contributor Author

Unless there's some refactoring on the CCM so we can use the instanceCache outside of the linode package (running into cyclic dependencies), I think we’re going to need the flag for using new network interfaces.
However, with the flag approach, that would assume a homogeneous cluster all using the new linode interfaces or legacy interfaces so I think we do want the refactor for the edge case of a mixed cluster.

@AshleyDumaine AshleyDumaine changed the title [feat] - add support for using linode interfaces (beta-only) [feat] add support for using linode interfaces (beta-only) Aug 15, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for Linode Interfaces (currently in beta), enabling the CCM to work with instances using the new interface generation. The key change is implementing dual-path functionality that handles both legacy instance configuration interfaces and the new Linode interfaces based on the InterfaceGeneration field.

Key changes:

  • Added support for detecting and handling Linode interfaces vs legacy instance config interfaces
  • Implemented IPv6 range extraction from the new interface format
  • Updated route management to work with both interface types

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
cloud/nodeipam/ipam/cloud_allocator.go Core logic to detect interface generation and handle both Linode interfaces and legacy config interfaces for IPv6 CIDR allocation
cloud/nodeipam/ipam/cloud_allocator_test.go Comprehensive test cases covering both interface types with mocking for the new interface APIs
cloud/linode/route_controller.go Route management refactored to support both interface generations with a unified handler function
cloud/linode/route_controller_test.go Test coverage for route operations using Linode interfaces
cloud/linode/client/client.go Interface definition for new Linode interface API methods
cloud/linode/client/client_with_metrics.go Prometheus metrics wrapper for the new interface methods
cloud/linode/client/mocks/mock_client.go Generated mock implementations for testing the new interface methods

Copy link
Contributor

@komer3 komer3 left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@AshleyDumaine AshleyDumaine merged commit df34350 into main Aug 19, 2025
9 of 12 checks passed
@AshleyDumaine AshleyDumaine deleted the linode-interfaces branch August 19, 2025 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature for new features in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants