Files
virtual-kubelet/providers/azurebatch/deployment/storage/main.tf
Lawrence Gripper d6e8b3daf7 Create a provider to use Azure Batch (#133)
* Started work on provider

* WIP Adding batch provider

* Working basic call into pool client. Need to parameterize the baseurl

* Fixed job creation by manipulating the content-type

* WIP Kicking off containers. Dirty

* [wip] More meat around scheduling simple containers.

* Working on basic task wrapper to co-schedule pods

* WIP on task wrapper

* WIP

* Working pod minimal wrapper for batch

* Integrate pod template code into provider

* Cleaning up

* Move to docker without gpu

* WIP batch integration

* partially working

* Working logs

* Tidy code

* WIP: Testing and readme

* Added readme and terraform deployment for GPU Azure Batch pool.

* Update to enable low priority nodes for gpu

* Fix log formatting bug. Return node logs when container not yet started

* Moved to golang v1.10

* Fix cri test

* Fix up minor docs Issue. Add provider to readme. Add var for vk image.
2018-06-22 16:33:49 -07:00

78 lines
1.9 KiB
HCL

resource "random_string" "storage" {
keepers = {
# Generate a new id each time we switch to a new resource group
group_name = "${var.resource_group_name}"
}
length = 8
upper = false
special = false
number = false
}
resource "azurerm_storage_account" "batchstorage" {
name = "${lower(random_string.storage.result)}"
resource_group_name = "${var.resource_group_name}"
location = "${var.resource_group_location}"
account_tier = "Standard"
account_replication_type = "LRS"
}
resource "azurerm_storage_container" "boostrapscript" {
name = "scripts"
resource_group_name = "${var.resource_group_name}"
storage_account_name = "${azurerm_storage_account.batchstorage.name}"
container_access_type = "private"
}
resource "azurerm_storage_blob" "initscript" {
name = "init.sh"
resource_group_name = "${var.resource_group_name}"
storage_account_name = "${azurerm_storage_account.batchstorage.name}"
storage_container_name = "${azurerm_storage_container.boostrapscript.name}"
type = "block"
source = "${var.pool_bootstrap_script_path}"
}
data "azurerm_storage_account_sas" "scriptaccess" {
connection_string = "${azurerm_storage_account.batchstorage.primary_connection_string}"
https_only = true
resource_types {
service = false
container = false
object = true
}
services {
blob = true
queue = false
table = false
file = false
}
start = "${timestamp()}"
expiry = "${timeadd(timestamp(), "8776h")}"
permissions {
read = true
write = false
delete = false
list = false
add = false
create = false
update = false
process = false
}
}
output "pool_boostrap_script_url" {
value = "${azurerm_storage_blob.initscript.url}${data.azurerm_storage_account_sas.scriptaccess.sas}"
}
output "id" {
value = "${azurerm_storage_account.batchstorage.id}"
}