-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #904 from terraform-providers/b-kubernetes_cluster…
…-admin Changed admin_username and key_data to require a new resource.
- Loading branch information
Showing
6 changed files
with
91 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
resource "azurerm_resource_group" "akc-rg" { | ||
name = "${var.resource_group_name}" | ||
location = "${var.resource_group_location}" | ||
} | ||
|
||
#an attempt to keep the aci container group name (and dns label) somewhat unique | ||
resource "random_integer" "random_int" { | ||
min = 100 | ||
max = 999 | ||
} | ||
|
||
resource "azurerm_kubernetes_cluster" "aks_container" { | ||
name = "akc-${random_integer.random_int.result}" | ||
location = "${var.resource_group_location}" | ||
dns_prefix = "akc-${random_integer.random_int.result}" | ||
|
||
resource_group_name = "${azurerm_resource_group.akc-rg.name}" | ||
kubernetes_version = "1.8.7" | ||
|
||
|
||
linux_profile { | ||
admin_username = "${var.linux_admin_username}" | ||
ssh_key { | ||
key_data = "${var.linux_admin_ssh_publickey}" | ||
} | ||
} | ||
|
||
agent_pool_profile { | ||
name = "agentpool" | ||
count = "2" | ||
vm_size = "Standard_DS2_v2" | ||
os_type = "Linux" | ||
} | ||
|
||
service_principal { | ||
client_id = "${var.client_id}" | ||
client_secret = "${var.client_secret}" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
output "id" { | ||
value = "${azurerm_kubernetes_cluster.aks_container.id}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
variable "name" { | ||
type = "string" | ||
description = "Name of this cluster." | ||
default = "akc-example" | ||
} | ||
|
||
variable "client_id" { | ||
type = "string" | ||
description = "Client ID" | ||
} | ||
|
||
variable "client_secret" { | ||
type = "string" | ||
description = "Client secret." | ||
} | ||
|
||
variable "resource_group_name" { | ||
type = "string" | ||
description = "Name of the azure resource group." | ||
default = "akc-rg" | ||
} | ||
|
||
variable "resource_group_location" { | ||
type = "string" | ||
description = "Location of the azure resource group." | ||
default = "eastus" | ||
} | ||
|
||
variable "linux_admin_username" { | ||
type = "string" | ||
description = "User name for authentication to the Kubernetes linux agent virtual machines in the cluster." | ||
} | ||
|
||
variable "linux_admin_ssh_publickey" { | ||
type = "string" | ||
description = "Configure all the linux virtual machines in the cluster with the SSH RSA public key string. The key should include three parts, for example 'ssh-rsa AAAAB...snip...UcyupgH azureuser@linuxvm'" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters