Closed mateuszkwiatkowski closed 2 months ago
Changing /bin/sh
symlink to point to bash instead of dash (withdpkg-reconfigure dash
) fixes the "unexpected operator" errors. The cp error is still there.
The bug happens when the last argument to the /home/tf-rke2/install.sh
script is empty like in this Terraform log:
+ sudo /home/tf-rke2/install.sh server /home/tf-rke2/rke2_artifacts v1.29.3+rke2r1 tar ''
The fix here is to provide RKE2's .tar.gz and checksum file before the install.sh script is launched or to let it download it by itself (this is controlled with the INSTALL_RKE2_ARTIFACT_PATH
variable.
ok, I am looking into this, thank you! I should have a new major release for this repo sometime this week(hopefully): https://github.com/rancher/terraform-aws-rke2/pull/152
The reason we aren't letting the installer download the tarball files is because we are targeting air-gapped environments with install method tar.
What version of the module are you using?
Hey @matttrach,
It's version 0.1.22.
If target is air-gapped env it wasn't obvious to me. Now I understand that after reading source code a bit. At first I have setup a cluster with RHEL-9 + rpm
installation method and it just worked. After a while I decided I prefer running it on Ubuntu and I just switched these two settings to Ubuntu-22.04 and tar
- it didn't work.
Maybe it just lacks documentation how to populate artifacts to these servers? I don't mind downloading them to my workstation and letting terraform to upload them to servers.
I am so sorry that this happened... Thank you for reaching out. I want to make sure to validate the options that you are choosing, this is what I understand so far:
This is the test id I am using to represent this use case: "ubuntu-22-canal-stable-one-tar-ipv4-nginx"
Yes, I copied the devcluster example and changed these two variables: OS = ubuntu-22.04, installation_method = tar. It's single node, yes.
Excellent! If you don't mind upgrading, you can use either the "one" example or the "simple" example to accomplish this.
I manually tested this diff on the simple example:
diff --git a/examples/simple/main.tf b/examples/simple/main.tf
index 3b98736..c64cc3f 100644
--- a/examples/simple/main.tf
+++ b/examples/simple/main.tf
@@ -40,4 +40,7 @@ module "this" {
}
local_file_path = local.local_file_path
install_rke2_version = local.rke2_version
+
+ server_image_type = "ubuntu-22"
+ install_use_strategy = "tar"
}
For the "one" example I set these parameters:
"key_name" = <my key name in aws>
"key" = <my public key>
"identifier" = <a random string>
"zone" = <my route53 zone>
"rke2_version" = "v1.29.5+rke2r1"
"os" = "ubuntu-22"
"install_method" = "tar"
"file_path" = "" // using the default ./rke2
"cni" = "canal" // default
"ip_family" = "ipv4" // default
ingress_controller = "nginx" // default
You can also skip dns provisioning by setting project_domain_use_strategy = "skip"
.
I have not yet implemented ipv6 or dualstack for ip_family, or alternative ingresses, those are coming soon.
You can see the test id here: https://github.com/rancher/terraform-aws-rke2/blob/main/tests/test/ready_test.go#L41 This is where I set the combinations that we verify before release, please let me know if there are any others you would like to try out.
I set
image_type = ubuntu-22
andinstall_method = tar
.I'm getting this error:
It looks that the script is not executed with bash and it uses bash syntax.