-
Notifications
You must be signed in to change notification settings - Fork 829
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into prep/0.11.0
- Loading branch information
Showing
57 changed files
with
2,104 additions
and
163 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
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,106 @@ | ||
# Copyright 2019 Google LLC All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
provider "azuread" { | ||
version = "=0.1.0" | ||
} | ||
|
||
# Create Service Principal password | ||
resource "azuread_service_principal_password" "aks" { | ||
end_date = "2299-12-30T23:00:00Z" # Forever | ||
service_principal_id = "${azuread_service_principal.aks.id}" | ||
value = "${random_string.password.result}" | ||
} | ||
|
||
# Create Azure AD Application for Service Principal | ||
resource "azuread_application" "aks" { | ||
name = "agones-sp" | ||
} | ||
|
||
# Create Service Principal | ||
resource "azuread_service_principal" "aks" { | ||
application_id = "${azuread_application.aks.application_id}" | ||
} | ||
|
||
# Generate random string to be used for Service Principal Password | ||
resource "random_string" "password" { | ||
length = 32 | ||
special = true | ||
} | ||
|
||
resource "azurerm_resource_group" "test" { | ||
name = "agonesRG" | ||
location = "East US" | ||
} | ||
|
||
resource "azurerm_kubernetes_cluster" "test" { | ||
name = "${var.cluster_name}" | ||
location = "${azurerm_resource_group.test.location}" | ||
resource_group_name = "${azurerm_resource_group.test.name}" | ||
dns_prefix = "agones" | ||
// Version 1.11.8 has issues with RBAC on AKS | ||
// So this parameter is commented out | ||
//kubernetes_version = "1.11.8" | ||
|
||
|
||
agent_pool_profile { | ||
name = "default" | ||
count = 2 | ||
vm_size = "${var.machine_type}" | ||
os_type = "Linux" | ||
os_disk_size_gb = 30 | ||
} | ||
|
||
service_principal { | ||
client_id = "${azuread_application.aks.application_id}" | ||
client_secret = "${azuread_service_principal_password.aks.value}" | ||
} | ||
tags = { | ||
Environment = "Production" | ||
} | ||
} | ||
resource "azurerm_network_security_group" "test" { | ||
name = "agonesSecurityGroup" | ||
location = "${azurerm_resource_group.test.location}" | ||
resource_group_name = "${azurerm_resource_group.test.name}" | ||
} | ||
|
||
resource "azurerm_network_security_rule" "gameserver" { | ||
name = "gameserver" | ||
priority = 100 | ||
direction = "Inbound" | ||
access = "Allow" | ||
protocol = "UDP" | ||
source_port_range = "*" | ||
destination_port_range = "7000-8000" | ||
source_address_prefix = "*" | ||
destination_address_prefix = "*" | ||
resource_group_name = "${azurerm_resource_group.test.name}" | ||
network_security_group_name = "${azurerm_network_security_group.test.name}" | ||
} | ||
|
||
|
||
resource "azurerm_network_security_rule" "outbound" { | ||
name = "outbound" | ||
priority = 100 | ||
direction = "Outbound" | ||
access = "Allow" | ||
protocol = "Tcp" | ||
source_port_range = "*" | ||
destination_port_range = "*" | ||
source_address_prefix = "*" | ||
destination_address_prefix = "*" | ||
resource_group_name = "${azurerm_resource_group.test.name}" | ||
network_security_group_name = "${azurerm_network_security_group.test.name}" | ||
} |
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,34 @@ | ||
# Copyright 2019 Google LLC All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
output "cluster_ca_certificate" { | ||
value = "${base64decode(azurerm_kubernetes_cluster.test.kube_config.0.cluster_ca_certificate)}" | ||
} | ||
|
||
output "client_certificate" { | ||
value = "${azurerm_kubernetes_cluster.test.kube_config.0.client_certificate}" | ||
} | ||
|
||
output "kube_config" { | ||
value = "${azurerm_kubernetes_cluster.test.kube_config_raw}" | ||
} | ||
|
||
output "host" { | ||
value = "${azurerm_kubernetes_cluster.test.kube_config.0.host}" | ||
} | ||
|
||
output "token" { | ||
value = "${azurerm_kubernetes_cluster.test.kube_config.0.password}" | ||
} | ||
|
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,21 @@ | ||
# Copyright 2019 Google LLC All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
variable "machine_type" { | ||
default = "Standard_D2_v2" | ||
} | ||
|
||
variable "cluster_name" { | ||
default="test-cluster" | ||
} |
Oops, something went wrong.