ionos-cloud/terraform-provider-ionoscloud

Support Taints on ionoscloud_k8s_node_pool

djjudas21 opened this issue · 4 comments

Current Provider Version

[jgazeley@hephaestos cr-terraform]$ terraform version
Terraform v1.1.7
on linux_amd64
+ provider registry.terraform.io/hashicorp/kubernetes v2.8.0
+ provider registry.terraform.io/hashicorp/vault v3.3.1
+ provider registry.terraform.io/ionos-cloud/ionoscloud v6.1.6

Use-cases

I have created a ionoscloud_k8s_cluster with multiple ionoscloud_k8s_node_pool. I need to dedicate one node pool as an infrastructure node pool and this requires setting a taint on the node, as in the Openshift docs (also applicable to Kubernetes).

These Taints on the nodepools will then match Tolerations on the infrastructure pods (e.g. Ingress)

Attempted Solutions

I also considered setting Labels on the node pools but this then requires setting a NodeSelector on every workload pod, and is not a workable solution as it relies on every user of the cluster to remember to set a suitable NodeSelector.

resource "ionoscloud_k8s_node_pool" "infra" {
  ...
  labels = {
    "node-role.kubernetes.io/infra" = ""
  }
}

Proposal

The ionoscloud_k8s_node_pool resource should support setting taints on a node pool. For example, this syntax:

resource "ionoscloud_k8s_node_pool" "infra" {
  ...
  taints = {
    "node-role.kubernetes.io/infra" = "NoSchedule"
  }
}

would be used to represent this Taint on the underlying Kubernetes node pool object:

      taints: 
      - key: node-role.kubernetes.io/infra
        effect: NoSchedule

Thanks for raising this issue! We currently do not support this but it is on the roadmap. We will let you know once this is added.