Skip to content

Conversation

yec-akamai
Copy link
Contributor

@yec-akamai yec-akamai commented Sep 3, 2025

📝 Description

Support a couple of new fields and options for LKE enterprise: Bring your own VPC/Subnet; Support dual stack cluster; Allow to enable audit log in cluster control plane.

✔️ How to Test

There is a list of tags you will need with your account for testing. Please refer to the Jira epic for details.

Integration test:

make test-int PKG_NAME="lke" TEST_CASE="TestAccResourceLKECluster_enterprise"                            
make test-int PKG_NAME="lke" TEST_CASE="TestAccDataSourceLKECluster_enterprise"

Manual test:

  1. In a sandbox environment, run the following script to create a VPC and a subnet, and bring it to create an LKE enterprise cluster:
resource "linode_vpc" "foobar" {
    label = "my-vpc-1"
    region = "no-osl-1"
    description = "description"
}

resource "linode_vpc_subnet" "foobar" {
    vpc_id = linode_vpc.foobar.id
    label = "my-subnet-1"
    ipv4 = "172.16.0.0/14"
}

resource "linode_lke_cluster" "test" {
    label       = "lke-cluster-byo-vpc"
    region      = "no-osl-1"
    k8s_version = "v1.31.9+lke5"
    tags        = ["test"]
    tier = "enterprise"
    vpc_id = linode_vpc.foobar.id
    subnet_id = linode_vpc_subnet.foobar.id
    stack_type = "ipv4"

    pool {
        type  = "g6-standard-1"
        count = 3
    }

    control_plane {
      acl {
        enabled = true
      }
      audit_logs_enabled = false
    }
}

  1. Observe the resource created successfully.
  2. Update and Enable the audit logs
resource "linode_lke_cluster" "test" {
    label       = "lke-cluster-byo-vpc"
    region      = "no-osl-1"
    k8s_version = "v1.31.9+lke5"
    tags        = ["test"]
    tier = "enterprise"
    vpc_id = linode_vpc.foobar.id
    subnet_id = linode_vpc_subnet.foobar.id
    stack_type = "ipv4"

    pool {
        type  = "g6-standard-1"
        count = 3
    }

    control_plane {
      acl {
        enabled = true
      }
      audit_logs_enabled = true
    }
}
  1. Get some output from the lke data source, i.e.
data "linode_lke_cluster" "test" {
  id = linode_lke_cluster.test.id
}

output "lke" {
  value = data.linode_lke_cluster.test.vpc_id
}
  1. From the listing data source get the newly created cluster
data "linode_lke_clusters" "test" {
  filter {
    name = "label"
    values = ["lke-cluster-byo-vpc"]
  }
}

output "result" {
  value = data.linode_lke_clusters.test.lke_clusters.0
}
  1. Clean up the resource after testing

@yec-akamai yec-akamai requested a review from a team as a code owner September 3, 2025 13:35
@yec-akamai yec-akamai requested review from vshanthe and ezilber-akamai and removed request for a team September 3, 2025 13:35
@yec-akamai yec-akamai added the new-feature for new features in the changelog. label Sep 3, 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

Adds support for LKE Enterprise phase 2 features including Bring Your Own VPC, dual stack clusters, and audit log enabling. This update extends the LKE cluster resource and data sources with new VPC networking capabilities and enhanced control plane configuration options.

  • Added VPC and subnet ID fields for BYO VPC functionality
  • Implemented dual stack networking support with stack type configuration
  • Added audit logs enablement for cluster control plane

Reviewed Changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
linode/lkeclusters/framework_models.go Added new fields for subnet ID, VPC ID, stack type, and audit logs to cluster models
linode/lkeclusters/framework_datasource_schema.go Extended datasource schema with new VPC and audit log attributes
linode/lke/tmpl/template.go Added audit logs template data field
linode/lke/tmpl/enterprise.gotf Updated enterprise template to include VPC resource and configuration
linode/lke/schema_resource.go Added schema definitions for new VPC and audit log fields with validation
linode/lke/resource.go Implemented creation and reading logic for new VPC and audit log fields
linode/lke/framework_resource_test.go Updated enterprise test with hardcoded region and version for BYO VPC testing
linode/lke/framework_models.go Added new fields to framework data models for VPC and audit log support
linode/lke/framework_datasource_schema.go Extended framework datasource schema with new attributes
linode/lke/cluster.go Added flattening and expanding logic for audit logs in control plane
go.mod Added temporary linodego dependency replacement
docs/resources/lke_cluster.md Updated documentation with new fields and enterprise cluster example
docs/data-sources/lke_clusters.md Added documentation for new VPC and audit log attributes
docs/data-sources/lke_cluster.md Updated datasource documentation with new field descriptions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@lgarber-akamai lgarber-akamai self-requested a review September 8, 2025 13:12
Copy link
Contributor

@lgarber-akamai lgarber-akamai left a comment

Choose a reason for hiding this comment

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

Looks great other than the small fix above. Great work!

@yec-akamai yec-akamai merged commit 5f72324 into dev Sep 9, 2025
12 checks passed
@zliang-akamai zliang-akamai deleted the TPT-3895/support-lke-e-phase2 branch September 9, 2025 15:20
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