Skip to content

Add LKE Nodepool Isolation field - #908

Merged
zliang-akamai merged 18 commits into
linode:mainfrom
aweingarten:rulesets-nodepool-isolation
Jun 5, 2026
Merged

Add LKE Nodepool Isolation field#908
zliang-akamai merged 18 commits into
linode:mainfrom
aweingarten:rulesets-nodepool-isolation

Conversation

@aweingarten

@aweingarten aweingarten commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

📝 Description

Adds Go SDK support for node pool network isolation.

Node Pool Isolation

New LKENodePoolIsolation struct with PublicIPv4/PublicIPv6 booleans, added to LKENodePool, LKENodePoolCreateOptions, and LKENodePoolUpdateOptions:

type LKENodePoolIsolation struct {
    PublicIPv4 bool `json:"public_ipv4"`
    PublicIPv6 bool `json:"public_ipv6"`
}

Allows controlling whether worker nodes get public IPv4/IPv6 addresses. Essential for VPC-only deployments where nodes should have no public IPv4.

✔️ How to Test

make test-unit

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds Go SDK support for LKE Enterprise cluster firewall ruleset_ids, and introduces node pool network isolation + disk encryption fields so callers can control public IP assignment and encrypted disks via the API.

Changes:

  • Add RuleSetIDs to LKECluster for enterprise service-managed firewall rulesets deserialization.
  • Add Isolation to LKE node pool structs/options and propagate it through GetCreateOptions() / GetUpdateOptions().
  • Add DiskEncryption to LKENodePoolCreateOptions and propagate it through GetCreateOptions().

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lke_clusters.go Adds ruleset_ids field + struct for enterprise firewall ruleset ID deserialization.
lke_node_pools.go Adds node pool isolation + create-time disk_encryption support and propagates them into option helpers.
Comments suppressed due to low confidence (3)

lke_node_pools.go:153

  • LKENodePool.GetCreateOptions() does not copy the pool Type into LKENodePoolCreateOptions (Type is a required JSON field). This can produce invalid create requests when callers use GetCreateOptions() to recreate/clone an existing pool. Copy l.Type into o.Type (and consider whether any other required fields should be mirrored).
func (l LKENodePool) GetCreateOptions() (o LKENodePoolCreateOptions) {
	o.Count = l.Count
	o.Disks = l.Disks
	o.Tags = l.Tags
	o.Labels = l.Labels
	o.Taints = l.Taints
	o.Autoscaler = &l.Autoscaler
	o.K8sVersion = l.K8sVersion
	o.UpdateStrategy = l.UpdateStrategy
	o.Label = l.Label
	o.FirewallID = l.FirewallID
	o.DiskEncryption = l.DiskEncryption
	o.Isolation = l.Isolation

lke_node_pools.go:113

  • New Isolation/DiskEncryption fields were added to the node pool types/options, but there are no corresponding unit tests asserting request serialization and response deserialization for these fields. Given existing unit coverage for LKE node pools, add tests/fixtures that (1) include isolation in create + update payloads and (2) verify disk_encryption is sent on create and unmarshaled on responses.
	Isolation *LKENodePoolIsolation `json:"isolation,omitempty"`

	// K8sVersion and UpdateStrategy are only for LKE Enterprise to support node pool upgrades.
	// It may not currently be available to all users and is under v4beta.
	K8sVersion     *string                    `json:"k8s_version,omitempty"`
	UpdateStrategy *LKENodePoolUpdateStrategy `json:"update_strategy,omitempty"`
}

// LKENodePoolCreateOptions fields are those accepted by CreateLKENodePool
type LKENodePoolCreateOptions struct {
	Count  int                `json:"count"`
	Type   string             `json:"type"`
	Disks  []LKENodePoolDisk  `json:"disks"`
	Tags   []string           `json:"tags"`
	Labels LKENodePoolLabels  `json:"labels"`
	Taints []LKENodePoolTaint `json:"taints"`
	Label  *string            `json:"label,omitempty"`

	Autoscaler *LKENodePoolAutoscaler `json:"autoscaler,omitempty"`
	FirewallID *int                   `json:"firewall_id,omitempty"`

	// NOTE: Disk encryption may not currently be available to all users.
	DiskEncryption InstanceDiskEncryption `json:"disk_encryption,omitempty"`
	Isolation      *LKENodePoolIsolation  `json:"isolation,omitempty"`

lke_clusters.go:60

  • RuleSetIDs was added to LKECluster, but there are no unit tests/fixtures in the current test suite validating (a) unmarshaling when ruleset_ids is present for enterprise clusters and (b) behavior when it is absent. Add unit tests similar to other LKE cluster unmarshal tests to prevent regressions in timestamp masking/custom unmarshaling.
	// RuleSetIDs contains the IDs of the service-managed firewall rulesets
	// automatically created for LKE Enterprise clusters.
	RuleSetIDs *LKEClusterRuleSetIDs `json:"ruleset_ids,omitempty"`
}

// LKEClusterRuleSetIDs contains the inbound and outbound ruleset IDs for an LKE-E cluster.
type LKEClusterRuleSetIDs struct {
	Inbound  int `json:"inbound"`
	Outbound int `json:"outbound"`
}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aweingarten
aweingarten force-pushed the rulesets-nodepool-isolation branch 7 times, most recently from 4a0d3d6 to 6030012 Compare March 5, 2026 18:43
@aweingarten
aweingarten force-pushed the rulesets-nodepool-isolation branch from 6030012 to 271eb30 Compare March 10, 2026 18:01
@mawilk90
mawilk90 requested a review from zliang-akamai March 13, 2026 10:15
@zliang-akamai
zliang-akamai requested a review from a team as a code owner April 11, 2026 01:40
@zliang-akamai
zliang-akamai requested review from ckulinsk and removed request for a team April 11, 2026 01:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread test/unit/firewall_rules_test.go
Comment thread AGENTS.md
Comment thread lke_node_pools.go Outdated
zliang-akamai and others added 2 commits June 3, 2026 20:16
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread lke_node_pools.go Outdated
Comment thread lke_node_pools.go Outdated
Comment thread test/unit/fixtures/lke_node_pool_get.json
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@zliang-akamai
zliang-akamai requested a review from Copilot June 4, 2026 14:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread lke_node_pools.go
@zliang-akamai zliang-akamai changed the title Rulesets nodepool isolation Add LKE Nodepool Isolation field Jun 4, 2026
@zliang-akamai
zliang-akamai merged commit 8501733 into linode:main Jun 5, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants