Skip to content

Commit e2f4649

Browse files
committed
Initial commit
0 parents  commit e2f4649

File tree

7 files changed

+666
-0
lines changed

7 files changed

+666
-0
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# vendor folder
2+
vendor
3+
4+
# go build output
5+
pulumi-do-polkadot

Makefile

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
GOPATH=$(shell go env GOPATH)
2+
BINNAME="pulumi-do-polkadot"
3+
4+
.PHONY: deps clean build
5+
deps:
6+
@go mod vendor
7+
clean:
8+
@rm -v $(BINNAME)
9+
@go clean -i .
10+
build:
11+
@go build -o $(BINNAME)

Pulumi.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: pulumi-do-polkadot
2+
runtime:
3+
name: go
4+
options:
5+
binary: pulumi-do-polkadot
6+
description: A Go Pulumi program to deploy polkadot validator on digital ocean k8s engine

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# pulumi-do-polkadot

go.mod

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
module pulumi-do-polkadot
2+
3+
go 1.14
4+
5+
require (
6+
github.com/Microsoft/go-winio v0.5.0 // indirect
7+
github.com/cheggaaa/pb v1.0.29 // indirect
8+
github.com/djherbis/times v1.5.0 // indirect
9+
github.com/gofrs/flock v0.8.0 // indirect
10+
github.com/gofrs/uuid v4.0.0+incompatible // indirect
11+
github.com/gogo/protobuf v1.3.2 // indirect
12+
github.com/golang/glog v0.0.0-20210429001901-424d2337a529 // indirect
13+
github.com/hashicorp/errwrap v1.1.0 // indirect
14+
github.com/hashicorp/go-multierror v1.1.1 // indirect
15+
github.com/kevinburke/ssh_config v1.1.0 // indirect
16+
github.com/mattn/go-runewidth v0.0.13 // indirect
17+
github.com/opentracing/basictracer-go v1.1.0 // indirect
18+
github.com/opentracing/opentracing-go v1.2.0 // indirect
19+
github.com/pulumi/pulumi-digitalocean/sdk/v4 v4.4.1
20+
github.com/pulumi/pulumi/sdk/v3 v3.4.0
21+
github.com/sabhiram/go-gitignore v0.0.0-20201211210132-54b8a0bf510f // indirect
22+
github.com/sergi/go-diff v1.2.0 // indirect
23+
github.com/spf13/cobra v1.1.3 // indirect
24+
github.com/texttheater/golang-levenshtein v1.0.1 // indirect
25+
github.com/uber/jaeger-client-go v2.29.1+incompatible // indirect
26+
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
27+
github.com/xanzy/ssh-agent v0.3.0 // indirect
28+
go.uber.org/atomic v1.8.0 // indirect
29+
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect
30+
golang.org/x/net v0.0.0-20210610132358-84b48f89b13b // indirect
31+
golang.org/x/sys v0.0.0-20210611083646-a4fc73990273 // indirect
32+
golang.org/x/term v0.0.0-20210503060354-a79de5458b56 // indirect
33+
google.golang.org/genproto v0.0.0-20210611144927-798beca9d670 // indirect
34+
)

go.sum

+572
Large diffs are not rendered by default.

main.go

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package main
2+
3+
import (
4+
"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
5+
6+
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
7+
)
8+
9+
func init() {
10+
initDOConfig() // Initialize digitalocean configs using env vars
11+
}
12+
13+
// init digital ocean config based on env
14+
func initDOConfig() {
15+
// os.Setenv("DIGITALOCEAN_API_URL")
16+
}
17+
18+
func main() {
19+
pulumi.Run(func(ctx *pulumi.Context) error {
20+
cluster, err := digitalocean.NewKubernetesCluster(
21+
ctx,
22+
"polkadot-k8s",
23+
&digitalocean.KubernetesClusterArgs{
24+
NodePool: &digitalocean.KubernetesClusterNodePoolArgs{
25+
Name: pulumi.String("polkadot-k8s-np"),
26+
Size: pulumi.String("s-2vcpu-2gb"),
27+
NodeCount: pulumi.Int(3)},
28+
Region: pulumi.String("AMS3"),
29+
Version: pulumi.String("1.20.7-do.0"),
30+
})
31+
if err != nil {
32+
return err
33+
}
34+
ctx.Export("configs", cluster.KubeConfigs)
35+
return nil
36+
})
37+
}

0 commit comments

Comments
 (0)