Skip to content

Instantly share code, notes, and snippets.

@flypenguin
Created May 17, 2020 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flypenguin/5df404f6f09f2bdfceee37593bd14e1f to your computer and use it in GitHub Desktop.
Save flypenguin/5df404f6f09f2bdfceee37593bd14e1f to your computer and use it in GitHub Desktop.
Rancher Azure fiction
# AGAIN - THIS DOES NOT WORK (as of 2020-05-17)
# WHY - no symlink support in azure files.
# ... but it could have been *that* easy.
resource "azurerm_resource_group" "personal" {
name = "test_${var.i_am}"
location = "West Europe"
}
resource "random_string" "rancher" {
length = 8
special = false
upper = false
number = true
}
resource "azurerm_storage_account" "rancher" {
name = "rancher${random_string.rancher.result}"
resource_group_name = azurerm_resource_group.personal.name
location = azurerm_resource_group.personal.location
account_tier = "Standard"
account_replication_type = "LRS"
}
resource "azurerm_storage_share" "rancher" {
name = "rancher${random_string.rancher.result}"
storage_account_name = azurerm_storage_account.rancher.name
quota = 50
}
resource "azurerm_container_group" "rancher" {
name = "rancher"
location = azurerm_resource_group.personal.location
resource_group_name = azurerm_resource_group.personal.name
ip_address_type = "public"
dns_name_label = "test-rancher-${var.i_am}"
os_type = "Linux"
container {
name = "rancher-server"
image = "rancher/rancher"
cpu = "2"
memory = "4"
ports {
port = 443
protocol = "TCP"
}
ports {
port = 80
protocol = "TCP"
}
# https://is.gd/MH925K - rancher
# https://is.gd/AwqhvJ - azure
volume {
name = "rancher-data"
mount_path = "/var/lib/rancher"
storage_account_name = azurerm_storage_account.rancher.name
storage_account_key = azurerm_storage_account.rancher.primary_access_key
share_name = azurerm_storage_share.rancher.name
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment