Skip to content

Commit

Permalink
Merge pull request #609 from danpaul81/rancher-dr
Browse files Browse the repository at this point in the history
fix async-dr for rancher
  • Loading branch information
danpaul81 authored Jan 29, 2025
2 parents 9002843 + 0be8171 commit 119f37b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
6 changes: 3 additions & 3 deletions defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ azure_tenant_id: ""
azure_subscription_id: ""
aks_version: "1.30"

rancher_version: "2.9.3"
rancher_k3s_version: "1.30.6+k3s1"
rancher_k8s_version: "1.30.6+rke2r1"
rancher_version: "2.10.1"
rancher_k3s_version: "1.30.8+k3s1"
rancher_k8s_version: "1.30.8+rke2r1"

vsphere_host: ""
vsphere_compute_resource: ""
Expand Down
2 changes: 2 additions & 0 deletions scripts/clusterpair-dr
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ if [ "$platform" = eks ] || [ "$platform" = ocp4 ]; then
[ "$host" ] && break
sleep 1
done
elif [ "$platform" = rancher ]; then
host=$(kubectl get nodes -l node-role.kubernetes.io/worker=true -o json |jq -r '.items[0].status.addresses[] | select(.type=="InternalIP") | .address')
else
host=node-$cluster-1
fi
Expand Down
5 changes: 4 additions & 1 deletion terraform/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ terraform {
}
rancher2 = {
source = "rancher/rancher2"
version = "5.1.0"
version = "6.0.0"
}
random = {
source ="hashicorp/random"
Expand All @@ -28,6 +28,9 @@ terraform {
source = "loafoe/ssh"
version = "2.7.0"
}
time = {
source = "hashicorp/time"
}
}
}

Expand Down
10 changes: 8 additions & 2 deletions terraform/aws/rancher/rancher-server.tf
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,20 @@ resource "rancher2_cloud_credential" "aws" {
}
}

resource "time_sleep" "wait_30_seconds" {
depends_on = [rancher2_cloud_credential.aws]
create_duration = "30s"
}

resource "rancher2_machine_config_v2" "node" {
for_each = var.rancherclusters
depends_on = [
helm_release.rancher_server,
rancher2_cloud_credential.aws
rancher2_cloud_credential.aws,
time_sleep.wait_30_seconds
]
provider = rancher2.admin
generate_name = format("node-templ-%s",each.key)
generate_name = format("templ-%s",each.key)
amazonec2_config {
ami = data.aws_ami.ubuntu.id
root_size = "50"
Expand Down

0 comments on commit 119f37b

Please sign in to comment.