Skip to content

Commit 4fa4916

Browse files
committed
added user tagging of nodes
1 parent 4819cf7 commit 4fa4916

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

rancher/do/.terraform.lock.hcl

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rancher/do/infra.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ resource "digitalocean_droplet" "rancher_server" {
2929
region = var.do_region
3030
size = var.droplet_size
3131
ssh_keys = [digitalocean_ssh_key.quickstart_ssh_key.fingerprint]
32+
tags = var.user_tag != "" ? [var.user_tag] : []
3233

3334
provisioner "remote-exec" {
3435
inline = [
@@ -74,6 +75,7 @@ resource "digitalocean_droplet" "quickstart_node" {
7475
region = var.do_region
7576
size = var.droplet_size
7677
ssh_keys = [digitalocean_ssh_key.quickstart_ssh_key.fingerprint]
78+
tags = var.user_tag != "" ? [var.user_tag] : []
7779

7880
user_data = templatefile(
7981
"${path.module}/files/userdata_quickstart_node.template",
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
21
# DigitalOcean API token used to create infrastructure
32
do_token = ""
43

4+
# Configure your user tag
5+
user_tag = "user:delete-me"
6+
57
# Admin password to use for Rancher server bootstrap, min. 12 characters
68
rancher_server_admin_password = ""
79

@@ -12,19 +14,19 @@ cert_manager_version = "1.11.0"
1214
do_region = "nyc1"
1315

1416
# Droplet size used for all droplets
15-
droplet_size = "s-2vcpu-4gb"
17+
droplet_size = "s-4vcpu-8gb"
1618

1719
# Prefix added to names of all resources
18-
prefix = "quickstart"
20+
prefix = "tj"
1921

2022
# The helm repository, where the Rancher helm chart is installed from
2123
rancher_helm_repository = "https://releases.rancher.com/server-charts/latest"
2224

2325
# Kubernetes version to use for Rancher server cluster
24-
rancher_kubernetes_version = "v1.24.14+k3s1"
26+
rancher_kubernetes_version = "v1.31.9+k3s1"
2527

2628
# Rancher server version (format: v0.0.0)
27-
rancher_version = "2.7.9"
29+
rancher_version = "2.10.7"
2830

2931
# Kubernetes version to use for managed workload cluster
30-
workload_kubernetes_version = "v1.24.14+rke2r1"
32+
workload_kubernetes_version = "v1.31.9+rke2r1"

rancher/do/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ variable "rancher_server_admin_password" {
5858
description = "Admin password to use for Rancher server bootstrap, min. 12 characters"
5959
}
6060

61+
variable "user_tag" {
62+
type = string
63+
description = "Tag to assign to resources, in the format 'user:username'"
64+
default = "delete-me"
65+
}
66+
6167
# Local variables used to reduce repetition
6268
locals {
6369
node_username = "root"

0 commit comments

Comments
 (0)