mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-24 09:48:30 +02:00
fix: pulumi stack for k3s-prod-1
This commit is contained in:
@@ -5,6 +5,7 @@ go 1.21
|
|||||||
toolchain go1.21.6
|
toolchain go1.21.6
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
github.com/pulumi/pulumi-kubernetes v1.6.0
|
||||||
github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.7.1
|
github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.7.1
|
||||||
github.com/pulumi/pulumi/sdk/v3 v3.106.0
|
github.com/pulumi/pulumi/sdk/v3 v3.106.0
|
||||||
)
|
)
|
||||||
@@ -13,7 +14,6 @@ require (
|
|||||||
dario.cat/mergo v1.0.0 // indirect
|
dario.cat/mergo v1.0.0 // indirect
|
||||||
github.com/Microsoft/go-winio v0.6.1 // indirect
|
github.com/Microsoft/go-winio v0.6.1 // indirect
|
||||||
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
|
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
|
||||||
github.com/acomagu/bufpipe v1.0.4 // indirect
|
|
||||||
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
|
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
|
||||||
github.com/agext/levenshtein v1.2.3 // indirect
|
github.com/agext/levenshtein v1.2.3 // indirect
|
||||||
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
|
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
|
||||||
@@ -32,6 +32,7 @@ require (
|
|||||||
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
|
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
|
||||||
github.com/go-git/go-billy/v5 v5.5.0 // indirect
|
github.com/go-git/go-billy/v5 v5.5.0 // indirect
|
||||||
github.com/go-git/go-git/v5 v5.11.0 // indirect
|
github.com/go-git/go-git/v5 v5.11.0 // indirect
|
||||||
|
github.com/gofrs/flock v0.7.1 // indirect
|
||||||
github.com/gogo/protobuf v1.3.2 // indirect
|
github.com/gogo/protobuf v1.3.2 // indirect
|
||||||
github.com/golang/glog v1.1.0 // indirect
|
github.com/golang/glog v1.1.0 // indirect
|
||||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||||
@@ -47,6 +48,7 @@ require (
|
|||||||
github.com/mattn/go-isatty v0.0.19 // indirect
|
github.com/mattn/go-isatty v0.0.19 // indirect
|
||||||
github.com/mattn/go-localereader v0.0.1 // indirect
|
github.com/mattn/go-localereader v0.0.1 // indirect
|
||||||
github.com/mattn/go-runewidth v0.0.15 // indirect
|
github.com/mattn/go-runewidth v0.0.15 // indirect
|
||||||
|
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||||
github.com/mitchellh/go-ps v1.0.0 // indirect
|
github.com/mitchellh/go-ps v1.0.0 // indirect
|
||||||
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
|
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
|
||||||
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
|
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
|
||||||
@@ -61,15 +63,16 @@ require (
|
|||||||
github.com/pkg/term v1.1.0 // indirect
|
github.com/pkg/term v1.1.0 // indirect
|
||||||
github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect
|
github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect
|
||||||
github.com/pulumi/esc v0.6.2 // indirect
|
github.com/pulumi/esc v0.6.2 // indirect
|
||||||
|
github.com/pulumi/pulumi/sdk v0.0.0-20200324171821-8ce10e1dfe54 // indirect
|
||||||
github.com/rivo/uniseg v0.4.4 // indirect
|
github.com/rivo/uniseg v0.4.4 // indirect
|
||||||
github.com/rogpeppe/go-internal v1.11.0 // indirect
|
github.com/rogpeppe/go-internal v1.11.0 // indirect
|
||||||
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect
|
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect
|
||||||
github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 // indirect
|
github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 // indirect
|
||||||
github.com/sergi/go-diff v1.3.1 // indirect
|
github.com/sergi/go-diff v1.3.1 // indirect
|
||||||
github.com/skeema/knownhosts v1.2.1 // indirect
|
github.com/skeema/knownhosts v1.2.1 // indirect
|
||||||
github.com/spf13/cast v1.4.1 // indirect
|
|
||||||
github.com/spf13/cobra v1.7.0 // indirect
|
github.com/spf13/cobra v1.7.0 // indirect
|
||||||
github.com/spf13/pflag v1.0.5 // indirect
|
github.com/spf13/pflag v1.0.5 // indirect
|
||||||
|
github.com/src-d/gcfg v1.4.0 // indirect
|
||||||
github.com/texttheater/golang-levenshtein v1.0.1 // indirect
|
github.com/texttheater/golang-levenshtein v1.0.1 // indirect
|
||||||
github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7 // indirect
|
github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7 // indirect
|
||||||
github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect
|
github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect
|
||||||
@@ -89,7 +92,12 @@ require (
|
|||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130 // indirect
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130 // indirect
|
||||||
google.golang.org/grpc v1.57.1 // indirect
|
google.golang.org/grpc v1.57.1 // indirect
|
||||||
google.golang.org/protobuf v1.31.0 // indirect
|
google.golang.org/protobuf v1.31.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/warnings.v0 v0.1.2 // indirect
|
||||||
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
|
k8s.io/klog v1.0.0 // indirect
|
||||||
lukechampine.com/frand v1.4.2 // indirect
|
lukechampine.com/frand v1.4.2 // indirect
|
||||||
|
sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,7 @@ func main() {
|
|||||||
if err := monitoring.NewMonitoring(ctx, "prod"); err != nil {
|
if err := monitoring.NewMonitoring(ctx, "prod"); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := networking.NewMonitoring(ctx, "prod"); err != nil {
|
if err := networking.NewNetworking(ctx, "prod"); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
27
pulumi/k3s-prod-1/monitoring/monitoring.go
Normal file
27
pulumi/k3s-prod-1/monitoring/monitoring.go
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
package monitoring
|
||||||
|
|
||||||
|
import (
|
||||||
|
v1 "github.com/pulumi/pulumi-kubernetes/sdk/go/kubernetes/core/v1"
|
||||||
|
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
|
)
|
||||||
|
|
||||||
|
func NewMonitoring(ctx *pulumi.Context, env string) error {
|
||||||
|
// Create a Kubernetes Namespace
|
||||||
|
namespaceName := "monitoring"
|
||||||
|
namespace, err := v1.NewNamespace(ctx, namespaceName, &v1.NamespaceArgs{
|
||||||
|
Metadata: &v1.ObjectMetaArgs{
|
||||||
|
Name: pulumi.String(namespaceName),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Export the name of the namespace
|
||||||
|
ctx.Export("monitoringNamespaceName", namespace.Metadata.Name())
|
||||||
|
|
||||||
|
if err := NewVictoriaMetrics(ctx, env); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewMonitoring(ctx *pulumi.Context, env string) error {
|
func NewVictoriaMetrics(ctx *pulumi.Context, env string) error {
|
||||||
// https://github.com/VictoriaMetrics/helm-charts/tree/master/charts/victoria-metrics-k8s-stack
|
// https://github.com/VictoriaMetrics/helm-charts/tree/master/charts/victoria-metrics-k8s-stack
|
||||||
_, err := helm.NewChart(ctx, "victoria-metrics-k8s-stack", helm.ChartArgs{
|
_, err := helm.NewChart(ctx, "victoria-metrics-k8s-stack", helm.ChartArgs{
|
||||||
Chart: pulumi.String("victoria-metrics-k8s-stack"),
|
Chart: pulumi.String("victoria-metrics-k8s-stack"),
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewMonitoring(ctx *pulumi.Context, env string) error {
|
func NewCertManager(ctx *pulumi.Context, env string) error {
|
||||||
_, err := helm.NewChart(ctx, "cert-manager", helm.ChartArgs{
|
_, err := helm.NewChart(ctx, "cert-manager", helm.ChartArgs{
|
||||||
Chart: pulumi.String("cert-manager"),
|
Chart: pulumi.String("cert-manager"),
|
||||||
Version: pulumi.String("v1.14.2 "),
|
Version: pulumi.String("v1.14.2 "),
|
||||||
|
|||||||
27
pulumi/k3s-prod-1/networking/networking.go
Normal file
27
pulumi/k3s-prod-1/networking/networking.go
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
package networking
|
||||||
|
|
||||||
|
import (
|
||||||
|
v1 "github.com/pulumi/pulumi-kubernetes/sdk/go/kubernetes/core/v1"
|
||||||
|
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
|
)
|
||||||
|
|
||||||
|
func NewNetworking(ctx *pulumi.Context, env string) error {
|
||||||
|
// Create a Kubernetes Namespace
|
||||||
|
namespaceName := "networking"
|
||||||
|
namespace, err := v1.NewNamespace(ctx, namespaceName, &v1.NamespaceArgs{
|
||||||
|
Metadata: &v1.ObjectMetaArgs{
|
||||||
|
Name: pulumi.String(namespaceName),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Export the name of the namespace
|
||||||
|
ctx.Export("networkingNamespaceName", namespace.Metadata.Name())
|
||||||
|
|
||||||
|
if err := NewCertManager(ctx, env); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user