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

new: Support control plane ACL in lke cluster resoure and datasource #1436

Merged
merged 6 commits into from
May 24, 2024

Conversation

yec-akamai
Copy link
Contributor

@yec-akamai yec-akamai commented May 20, 2024

📝 Description

Support control plane ACL CRUD operations in LKE cluster resource and data source. Because of the 1:1 relationship between cluster and ACL, we decided to manage ACL along with the cluster, instead of having an extra resource to do so.

✔️ How to Test

make PKG_NAME="linode/lke" int-test

Manual test:

  1. In a sandbox environment, i.e. dx-dvenv, run the following tf config to create an LKE cluster with control plane ACL:
resource "linode_lke_cluster" "test" {
    label       = "my-cluster"     
    k8s_version = "1.28"           
    region      = "us-east"     
    tags        = ["prod"]         
    control_plane {
        acl {
            enabled = true
            addresses {
                ipv4 = "0.0.0.0/0"
                ipv6 = "2001:db8::/32"
            }
        }
    }
    pool {
        type  = "g6-standard-2"
        count = 1
    }
}
  1. Run the above plan and observe the resource created successfully.
  2. Disable the ACL
resource "linode_lke_cluster" "test" {
    label       = "my-cluster"     
    k8s_version = "1.28"           
    region      = "us-east"     
    tags        = ["prod"]         
    control_plane {
        acl {
            enabled = false
        }
    }
    pool {
        type  = "g6-standard-2"
        count = 1
    }
}
  1. Read the data source from the updated LKE
data "linode_lke_cluster" "test" {
    id = linode_lke_cluster.test.id
}
  1. Change around the configs to see if there is any edge case

@yec-akamai yec-akamai added the new-feature for new features in the changelog. label May 20, 2024
@yec-akamai yec-akamai requested a review from a team as a code owner May 20, 2024 20:22
@yec-akamai yec-akamai requested review from jriddle-linode and lgarber-akamai and removed request for a team May 20, 2024 20:22
go.mod Outdated Show resolved Hide resolved
@@ -143,8 +144,48 @@ var resourceSchema = map[string]*schema.Schema{
Optional: true,
Computed: true,
},
"acl": {
Copy link
Contributor

@lgarber-akamai lgarber-akamai May 21, 2024

Choose a reason for hiding this comment

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

I noticed dropping the acl block after applying a configuration with a valid ACL doesn't trigger any updates, similar to how we treat the nested disk block in the linode_instance resource. I think this behavior is probably fine/expected but I just wanted to bring attention to it just in case 🙂

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.

Just a few small changes and this should be good to go, excellent work!

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.

LGTM, nice work!

Copy link
Contributor

@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! working on my end!

@yec-akamai yec-akamai merged commit dcdf26f into dev May 24, 2024
7 checks passed
@yec-akamai yec-akamai deleted the TPT-2855/lke-acls branch May 24, 2024 16:55
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