Skip to content

Conversation

lgarber-akamai
Copy link
Contributor

@lgarber-akamai lgarber-akamai commented Mar 11, 2025

📝 Description

This pull request implements support for managing LKE Enterprise enterprise clusters, including the following changes:

  • New lke/tiers/{tier}/versions and lke/tiers/{tier}/versions/{version} endpoints
  • New tier field when creating and reading LKE clusters
  • New k8s_version and update_strategy fields when creating, updating, and reading LKE node pools

✔️ How to Test

The following test steps assume you have pulled down this PR locally and run make install.

Unit Testing

make test-unit

Integration Testing

make TEST_COMMAND=models/lke test-int

Manual Testing

  1. In a linode_api4-python sandbox environment (e.g. dx-devenv), run the following:
import os

from linode_api4 import LinodeClient, TieredKubeVersion


def main():
    client = LinodeClient(os.getenv("LINODE_TOKEN"), base_url="https://api.linode.com/v4beta")

    versions = client.lke.tier("enterprise").versions()
    target_version = versions[0].id

    cluster = client.lke.cluster_create(
        region="us-mia",
        label="test-lke-cluster",
        kube_version=target_version,
        tier="enterprise",
        node_pools=[
            client.lke.node_pool(
                "g6-standard-2",
                3,
                kube_version=target_version,
                update_strategy="on_recycle"
            )
        ]
    )

    print(cluster)

if __name__ == "__main__":
    main()
  1. Ensure a new matching LKE enterprise cluster is created successfully.

@lgarber-akamai lgarber-akamai added the new-feature for new features in the changelog. label Mar 11, 2025
"labels": Property(mutable=True),
"taints": Property(mutable=True),
# Enterprise-specific properties
# Ideally we would use slug_relationship=TieredKubeVersion here, but
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any ideas on workarounds for this?

from linode_api4.objects import TieredKubeVersion


class LKETierGroup(Group):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a new pattern since the LKE tier path is the first of its kind. Let me know if you have any feedback!

@lgarber-akamai lgarber-akamai marked this pull request as ready for review March 13, 2025 16:32
@lgarber-akamai lgarber-akamai requested a review from a team as a code owner March 13, 2025 16:32
@lgarber-akamai lgarber-akamai requested review from jriddle-linode and ezilber-akamai and removed request for a team March 13, 2025 16:32
Copy link
Contributor

@ezilber-akamai ezilber-akamai left a comment

Choose a reason for hiding this comment

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

All tests are passing locally!

Copy link
Collaborator

@jriddle-linode jriddle-linode left a comment

Choose a reason for hiding this comment

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

LGTM and is passing locally

@lgarber-akamai lgarber-akamai merged commit 95970e4 into linode:dev Mar 31, 2025
12 checks passed
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