Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
robholland committed Aug 16, 2022
1 parent 692c688 commit bccaced
Show file tree
Hide file tree
Showing 16 changed files with 958 additions and 0 deletions.
1 change: 1 addition & 0 deletions aws/Pulumi.eks-small-postgres.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
encryptionsalt: v1:9jONCQ4bTX4=:v1:CXKpBB4EM0kvAT/4:p93C3ISgysWAWdP1uHGu0UK6qIQNAQ==
3 changes: 3 additions & 0 deletions aws/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: temporal-benchmark
runtime: go
description: Benchmark clusters for Temporal
64 changes: 64 additions & 0 deletions aws/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
module temporal-benchmark

go 1.17

require (
github.com/pulumi/pulumi-awsx/sdk v1.0.0-beta.10
github.com/pulumi/pulumi-eks/sdk v0.41.0
github.com/pulumi/pulumi/sdk/v3 v3.35.3
)

require (
github.com/Masterminds/semver v1.5.0 // indirect
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/cheggaaa/pb v1.0.18 // indirect
github.com/djherbis/times v1.2.0 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/gofrs/uuid v3.3.0+incompatible // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
github.com/golang/protobuf v1.4.2 // indirect
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-multierror v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect
github.com/mattn/go-runewidth v0.0.8 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-ps v1.0.0 // indirect
github.com/opentracing/basictracer-go v1.0.0 // indirect
github.com/opentracing/opentracing-go v1.1.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/term v1.1.0 // indirect
github.com/pulumi/pulumi-aws/sdk/v5 v5.9.2 // indirect
github.com/pulumi/pulumi-docker/sdk/v3 v3.2.0 // indirect
github.com/pulumi/pulumi-kubernetes/sdk/v3 v3.17.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rogpeppe/go-internal v1.8.1 // indirect
github.com/sabhiram/go-gitignore v0.0.0-20180611051255-d3107576ba94 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/spf13/cobra v1.4.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/src-d/gcfg v1.4.0 // indirect
github.com/texttheater/golang-levenshtein v0.0.0-20191208221605-eb6844b05fc6 // indirect
github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7 // indirect
github.com/uber/jaeger-client-go v2.22.1+incompatible // indirect
github.com/uber/jaeger-lib v2.2.0+incompatible // indirect
github.com/xanzy/ssh-agent v0.2.1 // indirect
go.uber.org/atomic v1.6.0 // indirect
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect
golang.org/x/net v0.0.0-20201021035429-f5854403a974 // indirect
golang.org/x/sys v0.0.0-20210817190340-bfb29a6856f2 // indirect
golang.org/x/text v0.3.3 // indirect
google.golang.org/genproto v0.0.0-20200608115520-7c474a2e3482 // indirect
google.golang.org/grpc v1.29.1 // indirect
google.golang.org/protobuf v1.24.0 // indirect
gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect
gopkg.in/src-d/go-git.v4 v4.13.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
lukechampine.com/frand v1.4.2 // indirect
sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0 // indirect
)
404 changes: 404 additions & 0 deletions aws/go.sum

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions aws/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package main

import (
"encoding/json"

"github.com/pulumi/pulumi-awsx/sdk/go/awsx/ec2"
"github.com/pulumi/pulumi-eks/sdk/go/eks"
k8s "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Create or lookup a VPC for our cluster.
vpc, err := ec2.NewVpc(ctx, "temporal-benchmark", &ec2.VpcArgs{})
if err != nil {
return err
}

// Create an EKS cluster with the default configuration.
cluster, err := eks.NewCluster(ctx, "temporal-benchmark", &eks.ClusterArgs{
VpcId: vpc.VpcId,
PublicSubnetIds: vpc.PublicSubnetIds,
PrivateSubnetIds: vpc.PrivateSubnetIds,
NodeAssociatePublicIpAddress: pulumi.Bool(false),
DesiredCapacity: pulumi.Int(3),
MinSize: pulumi.Int(3),
MaxSize: pulumi.Int(3),
})
if err != nil {
return err
}

// Create a Kubernetes provider using the new cluster's Kubeconfig.
_, err = k8s.NewProvider(ctx, "temporal-benchmark", &k8s.ProviderArgs{
Kubeconfig: cluster.Kubeconfig.ApplyT(
func(config interface{}) (string, error) {
b, err := json.Marshal(config)
if err != nil {
return "", err
}
return string(b), nil
}).(pulumi.StringOutput),
})
if err != nil {
return err
}

// Export the cluster's kubeconfig.
ctx.Export("kubeconfig", cluster.Kubeconfig)
return nil
})
}
Empty file added k8s/base/dynamic_config.yaml
Empty file.
76 changes: 76 additions & 0 deletions k8s/base/frontend-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/component: frontend
app.kubernetes.io/instance: temporal
app.kubernetes.io/name: temporal
app.kubernetes.io/part-of: temporal
app.kubernetes.io/version: 1.17.2
name: temporal-frontend
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app.kubernetes.io/component: frontend
app.kubernetes.io/instance: temporal
app.kubernetes.io/name: temporal
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app.kubernetes.io/component: frontend
app.kubernetes.io/instance: temporal
app.kubernetes.io/name: temporal
app.kubernetes.io/part-of: temporal
app.kubernetes.io/version: 1.17.2
spec:
containers:
- env:
- name: BIND_ON_IP
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
- name: SERVICES
value: frontend
image: temporalio/server:1.17.2
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 3
initialDelaySeconds: 150
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: rpc
timeoutSeconds: 1
name: temporal
ports:
- containerPort: 7233
name: rpc
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /etc/temporal/dynamic_config
name: dynamic-config
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- configMap:
defaultMode: 420
items:
- key: dynamic_config.yaml
path: dynamic_config.yaml
name: temporal-dynamic-config
name: dynamic-config
23 changes: 23 additions & 0 deletions k8s/base/frontend-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/component: frontend
app.kubernetes.io/instance: temporal
app.kubernetes.io/name: temporal
app.kubernetes.io/part-of: temporal
app.kubernetes.io/version: 1.17.2
name: temporal-frontend
spec:
internalTrafficPolicy: Cluster
ports:
- name: grpc-rpc
port: 7233
protocol: TCP
targetPort: rpc
selector:
app.kubernetes.io/component: frontend
app.kubernetes.io/instance: temporal
app.kubernetes.io/name: temporal
sessionAffinity: None
type: ClusterIP
77 changes: 77 additions & 0 deletions k8s/base/history-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/component: history
app.kubernetes.io/instance: temporal
app.kubernetes.io/name: temporal
app.kubernetes.io/part-of: temporal
app.kubernetes.io/version: 1.17.2
name: temporal-history
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app.kubernetes.io/component: history
app.kubernetes.io/instance: temporal
app.kubernetes.io/name: temporal
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app.kubernetes.io/component: history
app.kubernetes.io/instance: temporal
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: temporal
app.kubernetes.io/part-of: temporal
app.kubernetes.io/version: 1.17.2
spec:
containers:
- env:
- name: BIND_ON_IP
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
- name: SERVICES
value: history
image: temporalio/server:1.17.2
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 3
initialDelaySeconds: 150
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: rpc
timeoutSeconds: 1
name: temporal
ports:
- containerPort: 7234
name: rpc
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /etc/temporal/dynamic_config
name: dynamic-config
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- configMap:
defaultMode: 420
items:
- key: dynamic_config.yaml
path: dynamic_config.yaml
name: temporal-dynamic-config
name: dynamic-config
10 changes: 10 additions & 0 deletions k8s/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resources:
- frontend-service.yaml
- frontend-deployment.yaml
- worker-deployment.yaml
- matching-deployment.yaml
- history-deployment.yaml
configMapGenerator:
- name: temporal-dynamic-config
files:
- dynamic_config.yaml
76 changes: 76 additions & 0 deletions k8s/base/matching-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/component: matching
app.kubernetes.io/instance: temporal
app.kubernetes.io/name: temporal
app.kubernetes.io/part-of: temporal
app.kubernetes.io/version: 1.17.2
name: temporal-matching
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app.kubernetes.io/component: matching
app.kubernetes.io/instance: temporal
app.kubernetes.io/name: temporal
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app.kubernetes.io/component: matching
app.kubernetes.io/instance: temporal
app.kubernetes.io/name: temporal
app.kubernetes.io/part-of: temporal
app.kubernetes.io/version: 1.17.2
spec:
containers:
- env:
- name: BIND_ON_IP
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
- name: SERVICES
value: matching
image: temporalio/server:1.17.2
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 3
initialDelaySeconds: 150
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: rpc
timeoutSeconds: 1
name: temporal
ports:
- containerPort: 7235
name: rpc
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /etc/temporal/dynamic_config
name: dynamic-config
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- configMap:
defaultMode: 420
items:
- key: dynamic_config.yaml
path: dynamic_config.yaml
name: temporal-dynamic-config
name: dynamic-config

0 comments on commit bccaced

Please sign in to comment.