forked from pulumi/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
47 lines (40 loc) · 1.48 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright 2016-2019, Pulumi Corporation. All rights reserved.
import * as azure from "@pulumi/azure";
import { AksCluster } from "./cluster";
import { KedaService, KedaStorageQueueHandler } from "./keda";
// Define the resource group to contain all resources
const resourceGroup = new azure.core.ResourceGroup("keda-pulumi");
// Create an AKS K8s cluster
const aks = new AksCluster("keda-cluster", {
resourceGroupName: resourceGroup.name,
kubernetesVersion: "1.13.5",
vmSize: "Standard_B2s",
vmCount: 3,
});
// Deploy shared components of KEDA (container registry, kedacore/keda-edge Helm chart)
const service = new KedaService("keda-edge", {
resourceGroup,
k8sProvider: aks.provider,
});
// Create the storage account and the storage queue to listen to
const storageAccount = new azure.storage.Account("kedapulumi", {
resourceGroupName: resourceGroup.name,
accountTier: "Standard",
accountReplicationType: "LRS",
});
const queue = new azure.storage.Queue("kedaqueue", {
storageAccountName: storageAccount.name,
});
// Deploy a Function App which subscribes to the Storage Queue
const app = new KedaStorageQueueHandler("queue-handler", {
resourceGroup,
service,
storageAccount,
queue,
path: "./functionapp",
});
// Output the cluster name and .kube/config
export const clusterName = aks.cluster.name;
export const kubeConfig = aks.cluster.kubeConfigRaw;
export const storageAccountName = storageAccount.name;
export const queueName = queue.name;