Skip to content

Commit

Permalink
Fix location in azure-ts-aks-multicluster. (pulumi#197)
Browse files Browse the repository at this point in the history
- per-cluster location was using global config value instead of per-cluster config
- rename location config value to be consistent with other examples
  • Loading branch information
clstokes committed Dec 18, 2018
1 parent dffb7cf commit 22173d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion azure-ts-aks-multicluster/Pulumi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ template:
secret: true
sshPublicKey:
description: Your SSH public key (generate with `ssh-keygen -t rsa -f key.rsa`)
resourceGroupLocation:
location:
description: The location to use for the Azure Resource Group
18 changes: 10 additions & 8 deletions azure-ts-aks-multicluster/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as azure from "@pulumi/azure";
import * as pulumi from "@pulumi/pulumi";
import * as config from "./config";

// Per-Cluster Config
// Per-cluster config
const aksClusterConfig = [
{
name: 'east',
Expand Down Expand Up @@ -32,14 +32,8 @@ const adSpPassword = new azure.ad.ServicePrincipalPassword("aksSpPassword", {
// Create the individual clusters
const k8sClusters = aksClusterConfig.map((perClusterConfig, index) => {
const cluster = new azure.containerservice.KubernetesCluster(`aksCluster-${perClusterConfig.name}`, {
// Global config arguments
resourceGroupName: config.resourceGroup.name,
location: config.location,
agentPoolProfile: {
name: "aksagentpool",
count: perClusterConfig.nodeCount,
vmSize: perClusterConfig.nodeSize,
},
dnsPrefix: `${pulumi.getStack()}-kube`,
linuxProfile: {
adminUsername: "aksuser",
sshKeys: [{
Expand All @@ -50,6 +44,14 @@ const k8sClusters = aksClusterConfig.map((perClusterConfig, index) => {
clientId: adApp.applicationId,
clientSecret: adSpPassword.value,
},
// Per-cluster config arguments
location: perClusterConfig.location,
agentPoolProfile: {
name: "aksagentpool",
count: perClusterConfig.nodeCount,
vmSize: perClusterConfig.nodeSize,
},
dnsPrefix: `${pulumi.getStack()}-kube`,
});
return cluster;
});
Expand Down

0 comments on commit 22173d4

Please sign in to comment.