terraform-provider-scaleway
terraform-provider-scaleway copied to clipboard
Unable to assign a security group to k8s node pool
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
Currently it seems impossible to assign a security group to instances created by a k8s node pool, that then gets applied to instances created by the pool. In the UI, the security group is able to be edited or reassigned per node, but as far as I can tell, not in TF.
New or Affected Resource(s)
- scaleway_k8s_pool
Potential Terraform Configuration
It would make sense to be able to pass the security group here:
resource "scaleway_instance_security_group" "k8s_allow" {
enable_default_security = false
}
resource "scaleway_k8s_pool" "k8s-test" {
cluster_id = scaleway_k8s_cluster.test.id
name = "k8s-test"
node_type = "GP1-XS"
size = 2
tags = ["k8s", var.environment]
security_group_id = scaleway_instance_security_group.k8s_allow.id
}
If there is another way to achieve this and I am mistaken in my assumptions, please let me know.
At the moment Kapsule does not enable support for security groups. One supported way that you can use to still enable a given security group is to create a security group with the name kubernetes $UUID just before creating your pool. Security groups for pools are fetched by name and this is the pattern that is currently used.
@jtherin
linked to https://github.com/scaleway/terraform-provider-scaleway/issues/2565.
The feature is now available through Kapsule Scaleway API, support on terraform provider will be provided in the coming weeks I believe.