terraform-provider-rancher2: [BUG] kubelet-args are not supported via TF
Rancher Server Setup
- Rancher version: v2.7.0
- Installation option (Docker install/Helm Chart):
- If Helm Chart, Kubernetes Cluster and version: 3-node cluster, rancher-stable, v1.24.9+rke2r1
- Proxy/Cert Details: no proxy, self-signed
Information about the Cluster
- In process of creating downstream custom cluster
User Information
- What is the role of the user logged in?: Admin
Provider Information
- What is the version of the Rancher v2 Terraform Provider in use?
- 1.25.0
- What is the version of Terraform in use?
- v1.2.9
Describe the bug
Using kubelet-arg via Terraform rancher2 provider resulting in unexpected behavior of cluster not starting. This bug is described here https://github.com/rancher/rancher/issues/38112 I think this is specific to the Terraform provider, not the Rancher itself.
Kubelet-arg which is part of config under machine_selector_config should be list type not string. In other words, config should be able to accept list types.
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 20 (17 by maintainers)
above test results have been updated + completed. Closing out this issue now
Ticket rancher/dashboard#1074 - Test Results - ✅
Verified on Rancher
v2.7.8-rc1:3.1.0=> Upgrade tf tov3.2.0-rc3and add machine selector config with 2 kubelet args => update/modify kubelet args once more and verify they are successfully accepted + functionalScenario 1 - ✅
v2.7.8-rc1tfp-rancher2 v3.2.0-rc4, provision a downstream RKE2 AWS Node driver cluster, usingmachine_selector_configblock and defining 2 kubelet arguments - [ i used themain.tfshown below]Scenario 2 - ✅
max-podlimit to 255, using tfp-rancher2v3.2.0-rc4and re-runterraform applymax-podkubelet arg successfully updated; as expectedv3.2.0-rc4, remove and delete kubelet argsScenario 3 - ✅
v2.7.8v3.1.0, provision a downstream RKE2 AWS Node driver clusteractive, update tfp-rancher2 tov3.2.0-rc5v3.2.0-rc5, define amachine_selector_configblock and set multiple kubelet-args underconfig@Josh-Diamond There’s some confusion about how/which arguments to pass via TF to the kubelet for a working v2 cluster. Here’s a working example. I updated the Test Template.
I also missed a backport to release/v3. After I get that in and cut a new RC, please re-test this on v3.2.0-rc4.
@boris-stojnev Sorry, I was asking about
machine_global_configearlier which supports yaml. Made a spelling error in the comment. Since investigating, I don’t think usingmachine_global_configis an ideal workaround because it deviates from the options exposed in the rancher UI.I tried with the following config
with TF 1.25 and reproduced https://github.com/rancher/rancher/issues/38112
causing the UI to look like this
TF needs to have parity with Rancher so it needs to support passing multiple
kubelet-argto themachine_selector_configbut from your comment https://github.com/rancher/terraform-provider-rancher2/issues/1074#issuecomment-1648412146 and what I see, this doesn’t appear possible without a fix. This is a confirmed bug. I think updating themachine_selector_config.Configto aType.Listshould solve this but will have to test it. We may need to add state migration logic as well or users with clusters already provisioned with an earlier version of TF may see them break.