Enable azure-py-aks test for examples
MODIFY
azure-py-aks/__main__.py
azure-py-aks/__main__.py
@@ -4,9 +4,7 @@ from pulumi_kubernetes import Provider
from pulumi_kubernetes.apps.v1 import Deployment
from pulumi_kubernetes.core.v1 import Service
from pulumi_azure.core import ResourceGroup
-from pulumi_azure.role import Assignment
-from pulumi_azure.containerservice import KubernetesCluster, Registry
-from pulumi_azure.network import VirtualNetwork, Subnet
+from pulumi_azure.containerservice import KubernetesCluster
from pulumi_azuread import Application, ServicePrincipal, ServicePrincipalPassword
# read and set config values
@@ -20,34 +18,6 @@ LOCATION = config.get("location") or "east us"
# create a Resource Group and Network for all resources
resource_group = ResourceGroup("rg", name=PREFIX + "rg", location=LOCATION)
-vnet = VirtualNetwork(
- "vnet",
- name=PREFIX + "vnet",
- location=resource_group.location,
- resource_group_name=resource_group.name,
- address_spaces=["10.0.0.0/16"],
- __opts__=ResourceOptions(parent=resource_group),
-)
-
-subnet = Subnet(
- "subnet",
- name=PREFIX + "subnet",
- resource_group_name=resource_group.name,
- address_prefix="10.0.0.0/24",
- virtual_network_name=vnet.name,
- __opts__=ResourceOptions(parent=vnet),
-)
-
-# create Azure Container Registry to store images in
-acr = Registry(
- "acr",
- name=PREFIX + "acr",
- location=resource_group.location,
- resource_group_name=resource_group.name,
- sku="basic",
- __opts__=ResourceOptions(parent=resource_group),
-)
-
# create Azure AD Application for AKS
app = Application("aks-app", name=PREFIX + "aks-app")
@@ -67,52 +37,22 @@ sppwd = ServicePrincipalPassword(
__opts__=ResourceOptions(parent=sp),
)
-# assignments are needed for AKS to be able to interact with those resources
-acr_assignment = Assignment(
- "aks-acr-permissions",
- principal_id=sp.id,
- role_definition_name="AcrPull",
- scope=acr.id,
- __opts__=ResourceOptions(parent=sp),
-)
-
-subnet_assignment = Assignment(
- "aks-subnet-permissions",
- principal_id=sp.id,
- role_definition_name="Network Contributor",
- scope=subnet.id,
- __opts__=ResourceOptions(parent=sp),
-)
-
aks = KubernetesCluster(
"aks",
name=PREFIX + "aks",
location=resource_group.location,
resource_group_name=resource_group.name,
- kubernetes_version="1.13.5",
+ kubernetes_version="1.14.6",
dns_prefix="dns",
+ linux_profile={"adminUsername": "azureuser", "ssh_key": {"keyData": SSHKEY}},
+ service_principal={"clientId": app.application_id, "clientSecret": sppwd.value},
agent_pool_profiles=[
{
"name": "type1",
"count": 2,
"vmSize": "Standard_B2ms",
- "osType": "Linux",
- "maxPods": 110,
- "vnet_subnet_id": subnet.id,
}
],
- linux_profile={"adminUsername": "azureuser", "ssh_key": {"keyData": SSHKEY}},
- service_principal={"clientId": app.application_id, "clientSecret": sppwd.value},
- role_based_access_control={"enabled": "true"},
- network_profile={
- "networkPlugin": "azure",
- "serviceCidr": "10.10.0.0/16",
- "dns_service_ip": "10.10.0.10",
- "dockerBridgeCidr": "172.17.0.1/16",
- },
- __opts__=ResourceOptions(
- parent=resource_group, depends_on=[acr_assignment, subnet_assignment]
- ),
)
k8s_provider = Provider(

MODIFY
misc/test/examples_test.go
misc/test/examples_test.go
@@ -336,6 +336,15 @@ func TestExamples(t *testing.T) {
}),
// azure-py-aks
+ base.With(integration.ProgramTestOptions{
+ Dir: path.Join(cwd, "..", "..", "azure-py-aks"),
+ Config: map[string]string{
+ "azure:environment": azureEnviron,
+ "password": "testTEST1234+_^$",
+ "prefix": "acctest",
+ "sshkey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDeREOgHTUgPT00PTr7iQF9JwZQ4QF1VeaLk2nHKRvWYOCiky6hDtzhmLM0k0Ib9Y7cwFbhObR+8yZpCgfSX3Hc3w2I1n6lXFpMfzr+wdbpx97N4fc1EHGUr9qT3UM1COqN6e/BEosQcMVaXSCpjqL1jeNaRDAnAS2Y3q1MFeXAvj9rwq8EHTqqAc1hW9Lq4SjSiA98STil5dGw6DWRhNtf6zs4UBy8UipKsmuXtclR0gKnoEP83ahMJOpCIjuknPZhb+HsiNjFWf+Os9U6kaS5vGrbXC8nggrVE57ow88pLCBL+3mBk1vBg6bJuLBCp2WTqRzDMhSDQ3AcWqkucGqf dremy@remthinkpad",
+ },
+ }),
//base.With(integration.ProgramTestOptions{
// Dir: path.Join(cwd, "..", "..", "azure-py-webserver"),

Enable azure-py-aks test for examples (#382)