-
Notifications
You must be signed in to change notification settings - Fork 879
/
Copy pathGuestbook.cs
37 lines (30 loc) · 1.01 KB
/
Guestbook.cs
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
// Copyright 2016-2025, Pulumi Corporation. All rights reserved.
using Pulumi;
class Guestbook : Stack
{
public Guestbook()
{
var config = new Config();
var isMiniKube = config.GetBoolean("isMiniKube") ?? false;
var redisLeader = new ServiceDeployment("redis-leader", new ServiceDeploymentArgs
{
Image = "redis",
Ports = {6379}
});
var redisReplica = new ServiceDeployment("redis-replica", new ServiceDeploymentArgs
{
Image = "pulumi/guestbook-redis-replica",
Ports = {6379}
});
var frontend = new ServiceDeployment("frontend", new ServiceDeploymentArgs
{
Replicas = 3,
Image = "pulumi/guestbook-php-redis",
Ports = {80},
AllocateIPAddress = true,
ServiceType = isMiniKube ? "ClusterIP" : "LoadBalancer"
});
this.FrontendIp = frontend.IpAddress;
}
[Output] public Output<string> FrontendIp { get; set; }
}