Compare commits

...

20 Commits
v1.3.4 ... main

Author SHA1 Message Date
Renovate Bot 5f3440b172 chore(deps): update module github.com/pulumi/pulumi-kubernetes/sdk/v4 to v4.10.0 2024-04-13 00:08:11 +00:00
RouxAntoine 35aa3a7560
feature: upgrade version 2024-04-12 00:38:03 +02:00
Renovate Bot 8877562f45
chore(deps): update module github.com/pulumi/pulumi/sdk/v3 to v3.112.0 2024-04-12 00:34:56 +02:00
Renovate Bot 554e8ea517 chore(deps): update dependency go to v1.22.2 2024-04-11 22:32:23 +00:00
Renovate Bot da01ea8c34 chore(deps): update module github.com/pulumi/pulumi-kubernetes/sdk/v4 to v4.9.1 2024-04-11 22:31:28 +00:00
Renovate Bot 713ad7bed1 chore(deps): update dependency go to v1.22.1 2024-03-20 00:08:48 +00:00
Renovate Bot 2c50de6308 chore(deps): update module github.com/pulumi/pulumi/sdk/v3 to v3.105.0 2024-02-13 22:17:39 +00:00
Renovate Bot f4d93e019a chore(deps): update dependency go to v1.22.0 2024-02-07 00:05:54 +00:00
Renovate Bot c68e7251f3
chore(deps): update module github.com/pulumi/pulumi/sdk/v3 to v3.104.2 2024-02-03 13:55:52 +01:00
Renovate Bot af191eec64 chore(deps): update module github.com/pulumi/pulumi/sdk/v3 to v3.104.2 2024-02-03 12:46:11 +00:00
Renovate Bot d65611184d chore(deps): update dependency go to v1.21.6 2024-01-10 00:12:01 +00:00
Renovate Bot 17d2e093ea chore(deps): update module github.com/pulumi/pulumi/sdk/v3 to v3.96.2 2023-12-09 00:14:36 +00:00
Renovate Bot 85586c381c
chore(deps): update module github.com/pulumi/pulumi-kubernetes/sdk/v4 to v4.5.5 2023-12-06 21:26:00 +01:00
Renovate Bot 29b649678e chore(deps): update module github.com/pulumi/pulumi/sdk/v3 to v3.95.0 2023-12-06 20:20:02 +00:00
Renovate Bot 9bc8531db1 chore(deps): update dependency go to v1.21.5 2023-12-05 22:49:18 +00:00
RouxAntoine 41b299fc27
chore: refactoring split on package 2023-11-18 22:08:22 +01:00
Renovate Bot 4919d4be98 chore(deps): update module github.com/pulumi/pulumi/sdk/v3 to v3.94.2 2023-11-18 00:06:11 +00:00
Renovate Bot 7ec3c8bc16
chore(deps): update module github.com/pulumi/pulumi-kubernetes/sdk/v4 to v4.5.4 2023-11-17 19:47:11 +01:00
Renovate Bot 36afa873c1 chore(deps): update module github.com/pulumi/pulumi/sdk/v3 to v3.94.0 2023-11-16 23:40:39 +00:00
Renovate Bot 5e622a7548 chore(deps): update dependency go to v1.21.4 2023-11-15 00:10:54 +00:00
19 changed files with 3884 additions and 1171 deletions

View File

@ -31,6 +31,8 @@ func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi
r = &Middleware{}
case "kubernetes:traefik.io/v1alpha1:MiddlewareTCP":
r = &MiddlewareTCP{}
case "kubernetes:traefik.io/v1alpha1:ServersTransport":
r = &ServersTransport{}
case "kubernetes:traefik.io/v1alpha1:ServersTransportTCP":
r = &ServersTransportTCP{}
case "kubernetes:traefik.io/v1alpha1:TLSOption":

View File

@ -13,7 +13,8 @@ import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
)
// Middleware is the CRD implementation of a Traefik Middleware. More info: https://doc.traefik.io/traefik/v2.10/middlewares/http/overview/
// Middleware is the CRD implementation of a Traefik Middleware.
// More info: https://doc.traefik.io/traefik/v2.11/middlewares/http/overview/
type Middleware struct {
pulumi.CustomResourceState

View File

@ -13,7 +13,8 @@ import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
)
// MiddlewareTCP is the CRD implementation of a Traefik TCP middleware. More info: https://doc.traefik.io/traefik/v2.10/middlewares/overview/
// MiddlewareTCP is the CRD implementation of a Traefik TCP middleware.
// More info: https://doc.traefik.io/traefik/v2.11/middlewares/overview/
type MiddlewareTCP struct {
pulumi.CustomResourceState

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,157 @@
// Code generated by crd2pulumi DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package v1alpha1
import (
"context"
"reflect"
"antoine-roux.tk/projects/go/pulumi-library/crds/kubernetes/internal"
v1 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/meta/v1"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
)
// ServersTransport is the CRD implementation of a ServersTransport.
// If no serversTransport is specified, the default@internal will be used.
// The default@internal serversTransport is created from the static configuration.
// More info: https://doc.traefik.io/traefik/v2.11/routing/services/#serverstransport_1
type ServersTransport struct {
pulumi.CustomResourceState
ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
Kind pulumi.StringPtrOutput `pulumi:"kind"`
Metadata v1.ObjectMetaOutput `pulumi:"metadata"`
// ServersTransportSpec defines the desired state of a ServersTransport.
Spec ServersTransportSpecOutput `pulumi:"spec"`
}
// NewServersTransport registers a new resource with the given unique name, arguments, and options.
func NewServersTransport(ctx *pulumi.Context,
name string, args *ServersTransportArgs, opts ...pulumi.ResourceOption) (*ServersTransport, error) {
if args == nil {
args = &ServersTransportArgs{}
}
args.ApiVersion = pulumi.StringPtr("traefik.io/v1alpha1")
args.Kind = pulumi.StringPtr("ServersTransport")
opts = internal.PkgResourceDefaultOpts(opts)
var resource ServersTransport
err := ctx.RegisterResource("kubernetes:traefik.io/v1alpha1:ServersTransport", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetServersTransport gets an existing ServersTransport resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetServersTransport(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ServersTransportState, opts ...pulumi.ResourceOption) (*ServersTransport, error) {
var resource ServersTransport
err := ctx.ReadResource("kubernetes:traefik.io/v1alpha1:ServersTransport", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ServersTransport resources.
type serversTransportState struct {
}
type ServersTransportState struct {
}
func (ServersTransportState) ElementType() reflect.Type {
return reflect.TypeOf((*serversTransportState)(nil)).Elem()
}
type serversTransportArgs struct {
ApiVersion *string `pulumi:"apiVersion"`
Kind *string `pulumi:"kind"`
Metadata *v1.ObjectMeta `pulumi:"metadata"`
// ServersTransportSpec defines the desired state of a ServersTransport.
Spec *ServersTransportSpec `pulumi:"spec"`
}
// The set of arguments for constructing a ServersTransport resource.
type ServersTransportArgs struct {
ApiVersion pulumi.StringPtrInput
Kind pulumi.StringPtrInput
Metadata v1.ObjectMetaPtrInput
// ServersTransportSpec defines the desired state of a ServersTransport.
Spec ServersTransportSpecPtrInput
}
func (ServersTransportArgs) ElementType() reflect.Type {
return reflect.TypeOf((*serversTransportArgs)(nil)).Elem()
}
type ServersTransportInput interface {
pulumi.Input
ToServersTransportOutput() ServersTransportOutput
ToServersTransportOutputWithContext(ctx context.Context) ServersTransportOutput
}
func (*ServersTransport) ElementType() reflect.Type {
return reflect.TypeOf((**ServersTransport)(nil)).Elem()
}
func (i *ServersTransport) ToServersTransportOutput() ServersTransportOutput {
return i.ToServersTransportOutputWithContext(context.Background())
}
func (i *ServersTransport) ToServersTransportOutputWithContext(ctx context.Context) ServersTransportOutput {
return pulumi.ToOutputWithContext(ctx, i).(ServersTransportOutput)
}
func (i *ServersTransport) ToOutput(ctx context.Context) pulumix.Output[*ServersTransport] {
return pulumix.Output[*ServersTransport]{
OutputState: i.ToServersTransportOutputWithContext(ctx).OutputState,
}
}
type ServersTransportOutput struct{ *pulumi.OutputState }
func (ServersTransportOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ServersTransport)(nil)).Elem()
}
func (o ServersTransportOutput) ToServersTransportOutput() ServersTransportOutput {
return o
}
func (o ServersTransportOutput) ToServersTransportOutputWithContext(ctx context.Context) ServersTransportOutput {
return o
}
func (o ServersTransportOutput) ToOutput(ctx context.Context) pulumix.Output[*ServersTransport] {
return pulumix.Output[*ServersTransport]{
OutputState: o.OutputState,
}
}
func (o ServersTransportOutput) ApiVersion() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ServersTransport) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
}
func (o ServersTransportOutput) Kind() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ServersTransport) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
}
func (o ServersTransportOutput) Metadata() v1.ObjectMetaOutput {
return o.ApplyT(func(v *ServersTransport) v1.ObjectMetaOutput { return v.Metadata }).(v1.ObjectMetaOutput)
}
// ServersTransportSpec defines the desired state of a ServersTransport.
func (o ServersTransportOutput) Spec() ServersTransportSpecOutput {
return o.ApplyT(func(v *ServersTransport) ServersTransportSpecOutput { return v.Spec }).(ServersTransportSpecOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ServersTransportInput)(nil)).Elem(), &ServersTransport{})
pulumi.RegisterOutputType(ServersTransportOutput{})
}

View File

@ -13,7 +13,10 @@ import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
)
// ServersTransportTCP is the CRD implementation of a TCPServersTransport. If no tcpServersTransport is specified, a default one named default@internal will be used. The default@internal tcpServersTransport can be configured in the static configuration. More info: https://doc.traefik.io/traefik/v3.0/routing/services/#serverstransport_3
// ServersTransportTCP is the CRD implementation of a TCPServersTransport.
// If no tcpServersTransport is specified, a default one named default@internal will be used.
// The default@internal tcpServersTransport can be configured in the static configuration.
// More info: https://doc.traefik.io/traefik/v3.0/routing/services/#serverstransport_3
type ServersTransportTCP struct {
pulumi.CustomResourceState

View File

@ -13,7 +13,8 @@ import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
)
// TLSOption is the CRD implementation of a Traefik TLS Option, allowing to configure some parameters of the TLS connection. More info: https://doc.traefik.io/traefik/v2.10/https/tls/#tls-options
// TLSOption is the CRD implementation of a Traefik TLS Option, allowing to configure some parameters of the TLS connection.
// More info: https://doc.traefik.io/traefik/v2.11/https/tls/#tls-options
type TLSOption struct {
pulumi.CustomResourceState

View File

@ -13,7 +13,10 @@ import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
)
// TLSStore is the CRD implementation of a Traefik TLS Store. For the time being, only the TLSStore named default is supported. This means that you cannot have two stores that are named default in different Kubernetes namespaces. More info: https://doc.traefik.io/traefik/v2.10/https/tls/#certificates-stores
// TLSStore is the CRD implementation of a Traefik TLS Store.
// For the time being, only the TLSStore named default is supported.
// This means that you cannot have two stores that are named default in different Kubernetes namespaces.
// More info: https://doc.traefik.io/traefik/v2.11/https/tls/#certificates-stores
type TLSStore struct {
pulumi.CustomResourceState

View File

@ -13,7 +13,11 @@ import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
)
// TraefikService is the CRD implementation of a Traefik Service. TraefikService object allows to: - Apply weight to Services on load-balancing - Mirror traffic on services More info: https://doc.traefik.io/traefik/v2.10/routing/providers/kubernetes-crd/#kind-traefikservice
// TraefikService is the CRD implementation of a Traefik Service.
// TraefikService object allows to:
// - Apply weight to Services on load-balancing
// - Mirror traffic on services
// More info: https://doc.traefik.io/traefik/v2.11/routing/providers/kubernetes-crd/#kind-traefikservice
type TraefikService struct {
pulumi.CustomResourceState

55
go.mod
View File

@ -1,18 +1,17 @@
module antoine-roux.tk/projects/go/pulumi-library
go 1.21.0
go 1.22.2
require (
github.com/blang/semver v3.5.1+incompatible
github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.5.3
github.com/pulumi/pulumi/sdk/v3 v3.92.0
github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.10.0
github.com/pulumi/pulumi/sdk/v3 v3.112.0
)
require (
dario.cat/mergo v1.0.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // 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/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
@ -22,18 +21,19 @@ require (
github.com/charmbracelet/bubbletea v0.24.2 // indirect
github.com/charmbracelet/lipgloss v0.7.1 // indirect
github.com/cheggaaa/pb v1.0.29 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/djherbis/times v1.5.0 // indirect
github.com/emirpasic/gods v1.18.1 // 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-git/v5 v5.9.0 // indirect
github.com/go-git/go-git/v5 v5.11.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.1.0 // indirect
github.com/golang/glog v1.1.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
@ -42,28 +42,30 @@ require (
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-isatty v0.0.18 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mitchellh/go-ps v1.0.0 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/muesli/termenv v0.15.1 // indirect
github.com/muesli/termenv v0.15.2 // indirect
github.com/opentracing/basictracer-go v1.1.0 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pgavlin/fx v0.1.6 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/term v1.1.0 // indirect
github.com/pulumi/esc v0.5.6 // indirect
github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect
github.com/pulumi/esc v0.6.2 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect
github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/skeema/knownhosts v1.2.0 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/skeema/knownhosts v1.2.1 // indirect
github.com/spf13/cobra v1.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/texttheater/golang-levenshtein v1.0.1 // indirect
github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7 // indirect
@ -72,20 +74,19 @@ require (
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/zclconf/go-cty v1.13.2 // indirect
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sync v0.4.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/tools v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130 // indirect
google.golang.org/grpc v1.57.1 // indirect
google.golang.org/protobuf v1.31.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.15.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
lukechampine.com/frand v1.4.2 // indirect
sourcegraph.com/sourcegraph/appdash v0.0.0-20211028080628-e2786a622600 // indirect
)

129
go.sum
View File

@ -7,8 +7,6 @@ github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migc
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg=
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0=
github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ=
github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4=
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY=
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da/go.mod h1:eHEWzANqSiWQsof+nXEI9bUVUyV6F53Fp89EuCh2EAA=
github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo=
@ -34,11 +32,12 @@ github.com/charmbracelet/lipgloss v0.7.1 h1:17WMwi7N1b1rVWOjMT+rCh7sQkvDU75B2hbZ
github.com/charmbracelet/lipgloss v0.7.1/go.mod h1:yG0k3giv8Qj8edTCbbg6AlQ5e8KNWpFujkNawKNhE2c=
github.com/cheggaaa/pb v1.0.29 h1:FckUN5ngEk2LpvuG0fw1GEFx6LtyY2pWI/Z2QgCnEYo=
github.com/cheggaaa/pb v1.0.29/go.mod h1:W40334L7FMC5JKWldsTWbdGjLo0RxUKK73K+TuPxX30=
github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs=
github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU=
github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA=
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY=
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@ -51,31 +50,33 @@ github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/El
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY=
github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4=
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic=
github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU=
github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow=
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20230305113008-0c11038e723f h1:Pz0DHeFij3XFhoBRGUDPzSJ+w2UcK5/0JvF8DRI58r8=
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20230305113008-0c11038e723f/go.mod h1:8LHG1a3SRW71ettAD/jW13h8c6AqjVSeL11RAdgaqpo=
github.com/go-git/go-git/v5 v5.9.0 h1:cD9SFA7sHVRdJ7AYck1ZaAa/yeuBvGPxwXDL8cxrObY=
github.com/go-git/go-git/v5 v5.9.0/go.mod h1:RKIqga24sWdMGZF+1Ekv9kylsDz6LzdTSI2s/OsZWE0=
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4=
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII=
github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4=
github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE=
github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ=
github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo=
github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4=
github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU=
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
@ -103,33 +104,31 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A=
github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40=
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98=
github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4=
github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88=
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc=
github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg=
github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0=
github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0=
github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b h1:1XF24mVaiu7u+CFywTdcDo2ie1pzzhwjt6RHqzpMU34=
github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b/go.mod h1:fQuZ0gauxyBcmsdE3ZT4NasjaRdxmbCS0jRHsrWu3Ho=
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI=
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo=
github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA=
github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo=
github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s=
github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8=
github.com/muesli/termenv v0.15.1 h1:UzuTb/+hhlBugQz28rpzey4ZuKcZ03MeKsoG7IJZIxs=
github.com/muesli/termenv v0.15.1/go.mod h1:HeAQPTzpfs016yGtA4g00CsdYnVLJvxsS4ANqrZs2sQ=
github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo=
github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8=
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
github.com/opentracing/basictracer-go v1.1.0 h1:Oa1fTSBvAl8pa3U+IJYqrKm0NALwH9OsgwOqDv4xJW0=
@ -137,6 +136,8 @@ github.com/opentracing/basictracer-go v1.1.0/go.mod h1:V2HZueSJEp879yv285Aap1BS6
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
github.com/pgavlin/fx v0.1.6 h1:r9jEg69DhNoCd3Xh0+5mIbdbS3PqWrVWujkY76MFRTU=
github.com/pgavlin/fx v0.1.6/go.mod h1:KWZJ6fqBBSh8GxHYqwYCf3rYE7Gp2p0N8tJp8xv9u9M=
github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4=
github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
@ -145,12 +146,14 @@ github.com/pkg/term v1.1.0 h1:xIAAdCMh3QIAy+5FrE8Ad8XoDhEU4ufwbaSozViP9kk=
github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pulumi/esc v0.5.6 h1:4WV3X7OEVcChIwbSG+JxhZDdmq/q7lFPaSjHRYlPwmI=
github.com/pulumi/esc v0.5.6/go.mod h1:wpwNfVS5fV7Kd51j4dJ6FWYlKfxdqyppgp0gtkzqH04=
github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.5.3 h1:MhZGl2pjcwCCwwnSEoX00OPz8I0Uzolk+KdWlG8yIZc=
github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.5.3/go.mod h1:BhjXcVCnVinPRWO/KV6P1frjwSYHIZLqKD+OrB9fARY=
github.com/pulumi/pulumi/sdk/v3 v3.92.0 h1:vlcIp3lWUK/5ayRbi+nevEntQneez2FcE65dF98ICDY=
github.com/pulumi/pulumi/sdk/v3 v3.92.0/go.mod h1:zeqyIODqbb6GrEyhFV6aJET/xBSXSnF7Bw/EjbYZUnU=
github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 h1:vkHw5I/plNdTr435cARxCW6q9gc0S/Yxz7Mkd38pOb0=
github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231/go.mod h1:murToZ2N9hNJzewjHBgfFdXhZKjY3z5cYC1VXk+lbFE=
github.com/pulumi/esc v0.6.2 h1:+z+l8cuwIauLSwXQS0uoI3rqB+YG4SzsZYtHfNoXBvw=
github.com/pulumi/esc v0.6.2/go.mod h1:jNnYNjzsOgVTjCp0LL24NsCk8ZJxq4IoLQdCT0X7l8k=
github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.10.0 h1:xHEFQ/k2fzFp3TADpE/US28Ri4WZfzEAcT99fiDZ1+U=
github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.10.0/go.mod h1:9SKR5gTWY4FP9XnSNWd+HSeQt9lffrNCe+zbKvezI/o=
github.com/pulumi/pulumi/sdk/v3 v3.112.0 h1:cq2x5N6iuYhSLdeOdRs+LIq0EneB0Cb54WOlD/VaX3E=
github.com/pulumi/pulumi/sdk/v3 v3.112.0/go.mod h1:JWSzKBoHd8rlncC1DhXLf7YdV+Bk/Qf+hSZOOQh0WwQ=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
@ -165,10 +168,10 @@ github.com/santhosh-tekuri/jsonschema/v5 v5.0.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/skeema/knownhosts v1.2.0 h1:h9r9cf0+u7wSE+M183ZtMGgOJKiL96brpaz5ekfJCpM=
github.com/skeema/knownhosts v1.2.0/go.mod h1:g4fPeYpque7P0xefxtGzV81ihjC8sX2IqpAoNkjxbMo=
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ=
github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo=
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
@ -204,18 +207,18 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY=
golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@ -227,15 +230,15 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ=
golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@ -256,15 +259,15 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
@ -272,8 +275,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
@ -282,20 +285,20 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc=
golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg=
golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8=
golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130 h1:2FZP5XuJY9zQyGM5N0rtovnoXjiMUEIUMvw0m9wlpLc=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:8mL13HKkDa+IuJ8yruA3ci0q+0vsUz4m//+ottjwS5o=
google.golang.org/grpc v1.57.1 h1:upNTNqv0ES+2ZOOqACwVtS3Il8M12/+Hz41RCPzAjQg=
google.golang.org/grpc v1.57.1/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f h1:ultW7fxlIvee4HYrtnaRPon9HpEgFk5zYpmfMgtKB5I=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc=
google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk=
google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
@ -310,7 +313,5 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
lukechampine.com/frand v1.4.2 h1:RzFIpOvkMXuPMBb9maa4ND4wjBn71E1Jpf8BzJHMaVw=
lukechampine.com/frand v1.4.2/go.mod h1:4S/TM2ZgrKejMcKMbeLjISpJMO+/eZ1zu3vYX9dtj3s=
pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA=
pgregory.net/rapid v0.5.5/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04=
sourcegraph.com/sourcegraph/appdash v0.0.0-20211028080628-e2786a622600 h1:hfyJ5ku9yFtLVOiSxa3IN+dx5eBQT9mPmKFypAmg8XM=
sourcegraph.com/sourcegraph/appdash v0.0.0-20211028080628-e2786a622600/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU=
pgregory.net/rapid v0.6.1 h1:4eyrDxyht86tT4Ztm+kvlyNBLIk071gR+ZQdhphc9dQ=
pgregory.net/rapid v0.6.1/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04=

View File

@ -31,7 +31,7 @@ func main() {
return err
}
ctx.Export("name", nginxApplication.DeploymentName)
ctx.Export("name", nginxApplication.ApplicationName)
return nil
})

View File

@ -2,29 +2,16 @@ package application
import (
v1 "antoine-roux.tk/projects/go/pulumi-library/crds/kubernetes/certmanager/v1"
dnsv1alpha1 "antoine-roux.tk/projects/go/pulumi-library/crds/kubernetes/externaldns/v1alpha1"
traefikv1alpha1 "antoine-roux.tk/projects/go/pulumi-library/crds/kubernetes/traefik/v1alpha1"
"antoine-roux.tk/projects/go/pulumi-library/pkg/exposition"
"antoine-roux.tk/projects/go/pulumi-library/pkg/meta"
"antoine-roux.tk/projects/go/pulumi-library/pkg/workload"
"errors"
"fmt"
appsv1 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/apps/v1"
corev1 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/core/v1"
metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/meta/v1"
netv1 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/networking/v1"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"slices"
)
const (
loadBalancerAddressName = "internal-lb.localdomain"
defaultRecordTTL = 180
)
type ImagesConfiguration struct {
Image string
Path string
Health string
}
type Configuration struct {
Name string
Namespace string
@ -35,160 +22,182 @@ type Configuration struct {
AllowAllOrigin bool
}
type configuration struct {
Name string
Namespace string
Images []ImagesConfiguration
Dns string
Replicas int
Env map[string]string
ShouldCreateDns bool
ShouldCreateCertificate bool
ShouldCreateIngress bool
ResponseHeaders *traefikv1alpha1.MiddlewareSpecHeadersArgs
type ImagesConfiguration struct {
Image string
Path string
Health string
}
type deploymentConfiguration struct {
Env map[string]string
Name string
Replicas int
ImageReference ImagesConfiguration
type CreatedApplication struct {
ApplicationName pulumi.StringOutput `pulumi:"application"`
DeploymentName []pulumi.StringOutput `pulumi:"deployment"`
}
type serviceConfiguration struct {
Name string
}
type ingressConfiguration struct {
Service *corev1.Service
ImageReference ImagesConfiguration
}
type Application struct {
type application struct {
pulumi.ResourceState
DeploymentName pulumi.StringOutput `pulumi:"deployment"`
Name string
Namespace string
Services []service
Dns string
Replicas int
Env map[string]string
AllowAllOrigin bool
shouldCreateDns bool
shouldCreateCertificate bool
shouldCreateIngress bool
}
func NewApplication(ctx *pulumi.Context, publicConfiguration *Configuration) (*Application, error) {
type service struct {
Image string
Path string
Health string
}
if publicConfiguration.Name != "" && len(publicConfiguration.Images) > 0 {
localConfiguration := &configuration{
Name: publicConfiguration.Name,
Namespace: publicConfiguration.Namespace,
Env: publicConfiguration.Env,
func NewApplication(ctx *pulumi.Context, configuration *Configuration) (*CreatedApplication, error) {
if configuration.Name != "" && len(configuration.Images) > 0 {
application := &application{
Name: configuration.Name,
Namespace: configuration.Namespace,
Env: configuration.Env,
AllowAllOrigin: configuration.AllowAllOrigin,
}
var preventDuplicatePath []string
for _, publicImageConfiguration := range publicConfiguration.Images {
localImagesConfiguration := ImagesConfiguration{
Image: publicImageConfiguration.Image,
Path: publicImageConfiguration.Path,
Health: publicImageConfiguration.Health,
for _, image := range configuration.Images {
serviceConfiguration := service{
Image: image.Image,
Path: image.Path,
Health: image.Health,
}
if publicImageConfiguration.Path == "" {
localImagesConfiguration.Path = "/"
if image.Path == "" {
serviceConfiguration.Path = "/"
}
if publicImageConfiguration.Health == "" {
localImagesConfiguration.Health = "/"
if image.Health == "" {
serviceConfiguration.Health = "/"
}
if slices.Contains(preventDuplicatePath, localImagesConfiguration.Path) {
return nil, errors.New("duplicate path in ingress configuration")
if slices.Contains(preventDuplicatePath, serviceConfiguration.Path) {
return nil, errors.New("duplicate path in ingress applicationConfiguration")
}
localConfiguration.Images = append(localConfiguration.Images, localImagesConfiguration)
preventDuplicatePath = append(preventDuplicatePath, localImagesConfiguration.Path)
application.Services = append(application.Services, serviceConfiguration)
preventDuplicatePath = append(preventDuplicatePath, serviceConfiguration.Path)
}
if publicConfiguration.Replicas != nil {
localConfiguration.Replicas = *publicConfiguration.Replicas
if configuration.Replicas != nil {
application.Replicas = *configuration.Replicas
} else {
localConfiguration.Replicas = 1
application.Replicas = 1
}
if publicConfiguration.Dns != nil {
localConfiguration.Dns = *publicConfiguration.Dns
localConfiguration.ShouldCreateIngress = true
localConfiguration.ShouldCreateDns = true
localConfiguration.ShouldCreateCertificate = true
if configuration.Dns != nil {
application.Dns = *configuration.Dns
application.shouldCreateDns = true
application.shouldCreateCertificate = true
application.shouldCreateIngress = true
}
if publicConfiguration.AllowAllOrigin {
localConfiguration.ResponseHeaders = &traefikv1alpha1.MiddlewareSpecHeadersArgs{
AccessControlAllowOriginList: toPulumiStringArray([]string{"*"}),
}
err := ctx.RegisterComponentResource("pkg:application:CreatedApplication", configuration.Name, application)
if err != nil {
return nil, err
}
return createResources(ctx, localConfiguration)
return application.createResources(ctx)
} else {
return nil, errors.New("missing required value Name or Image during generic application construction")
return nil, errors.New("missing required value ApplicationName or Image during generic application construction")
}
}
func createResources(ctx *pulumi.Context, configuration *configuration, opts ...pulumi.ResourceOption) (*Application, error) {
application := &Application{}
err := ctx.RegisterComponentResource("pkg:application:Application", configuration.Name, application)
func (application *application) createResources(ctx *pulumi.Context) (*CreatedApplication, error) {
createdApplication := &CreatedApplication{
ApplicationName: pulumi.String(application.Name).ToStringOutput(),
}
namespaceConfiguration := &meta.NamespaceConfiguration{
Name: application.Name,
Namespace: application.Namespace,
}
namespace, err := namespaceConfiguration.CreateNamespace(ctx)
if err != nil {
return nil, err
}
namespace, err := createNamespace(ctx, configuration)
if err != nil {
return nil, err
}
var ingressesParameter []ingressConfiguration
var deployments []*appsv1.Deployment
for index, image := range configuration.Images {
indexedName := fmt.Sprintf("%s-%d", configuration.Name, index)
var ingressServices []exposition.IngressServices
for index, service := range application.Services {
indexedName := fmt.Sprintf("%s-%d", application.Name, index)
appLabels := pulumi.StringMap{
"app.kubernetes.io/name": pulumi.String(indexedName),
}
deploymentParameter := &deploymentConfiguration{
Name: indexedName,
Env: configuration.Env,
Replicas: configuration.Replicas,
ImageReference: image,
deploymentConfiguration := &workload.DeploymentConfiguration{
Name: indexedName,
Env: application.Env,
Replicas: application.Replicas,
ImageReference: &workload.ImageReference{
Image: service.Image,
Health: service.Health,
},
}
deployment, err := createDeployment(ctx, deploymentParameter, namespace, appLabels, application)
deployment, err := deploymentConfiguration.CreateDeployment(ctx, namespace, application, appLabels)
if err != nil {
return nil, err
}
application.DeploymentName = deployment.Metadata.Name().Elem()
createdApplication.DeploymentName = append(createdApplication.DeploymentName, deployment.Metadata.Name().Elem())
serviceParameter := serviceConfiguration{
serviceConfiguration := exposition.ServiceConfiguration{
Name: indexedName,
}
service, err := createService(ctx, serviceParameter, namespace, appLabels, application)
createdService, err := serviceConfiguration.CreateService(ctx, namespace, application, appLabels)
if err != nil {
return nil, err
}
ingressesParameter = append(ingressesParameter, ingressConfiguration{
Service: service,
ImageReference: image,
})
ingressServices = append(ingressServices,
exposition.IngressServices{
Service: createdService,
Path: service.Path,
})
deployments = append(deployments, deployment)
}
certificate, err := createCertificate(ctx, configuration, namespace, application)
if err != nil {
return nil, err
}
if application.shouldCreateDns {
dnsConfiguration := &exposition.DnsConfiguration{
Name: application.Name,
Dns: application.Dns,
}
_, err = dnsConfiguration.CreateDNSRecord(ctx, namespace, application)
if err != nil {
return nil, err
}
headerMiddleware, err := createMiddlewareAddResponseHeader(ctx, configuration, namespace, application)
if err != nil {
return nil, err
}
_, err = createIngress(ctx, configuration, namespace, certificate, ingressesParameter, application, headerMiddleware)
if err != nil {
return nil, err
var certificate *v1.Certificate
if application.shouldCreateCertificate {
certificateConfiguration := &meta.CertificateConfiguration{
Name: application.Name,
Dns: application.Dns,
}
certificate, err = certificateConfiguration.CreateCertificate(ctx, namespace, application)
if err != nil {
return nil, err
}
}
if application.shouldCreateIngress {
ingressConfiguration := exposition.NewIngressConfiguration(
application.Name,
application.Dns,
application.AllowAllOrigin,
ingressServices,
)
_, err = createDNSRecord(ctx, configuration, namespace, application)
if err != nil {
return nil, err
err = ingressConfiguration.CreateIngress(ctx, namespace, application, certificate)
if err != nil {
return nil, err
}
}
outs := pulumi.Map{}
@ -201,247 +210,5 @@ func createResources(ctx *pulumi.Context, configuration *configuration, opts ...
return nil, err
}
return application, nil
}
func toPulumiStringArray(values []string) pulumi.StringArray {
array := pulumi.StringArray{}
for _, value := range values {
array = append(array, pulumi.String(value))
}
return array
}
func createMiddlewareAddResponseHeader(
ctx *pulumi.Context,
configuration *configuration,
namespace *corev1.Namespace,
application *Application,
) (*traefikv1alpha1.Middleware, error) {
if configuration.ResponseHeaders != nil {
middlewareName := fmt.Sprintf("%s-response-header-middleware", configuration.Name)
return traefikv1alpha1.NewMiddleware(ctx, middlewareName, &traefikv1alpha1.MiddlewareArgs{
Metadata: &metav1.ObjectMetaArgs{
Namespace: namespace.Metadata.Name(),
Labels: pulumi.StringMap{
"app.kubernetes.io/part-of": pulumi.String(configuration.Name),
"app.kubernetes.io/managed-by": pulumi.String("pulumi"),
},
},
Spec: &traefikv1alpha1.MiddlewareSpecArgs{
Headers: configuration.ResponseHeaders,
},
}, pulumi.Parent(application))
}
return nil, nil
}
func createIngress(ctx *pulumi.Context, configuration *configuration, namespace *corev1.Namespace, certificate *v1.Certificate, ingressConfiguration []ingressConfiguration, application *Application, responseHeaderMiddleware *traefikv1alpha1.Middleware) (*netv1.Ingress, error) {
if configuration.ShouldCreateIngress {
host := pulumi.String(configuration.Dns)
var middlewares pulumi.StringInput
if configuration.ResponseHeaders != nil {
middlewares = pulumi.All(namespace.Metadata.Name().Elem(), responseHeaderMiddleware.Metadata.Name().Elem()).ApplyT(func(args []interface{}) string {
return fmt.Sprintf("kube-ingress-gzip-compress@kubernetescrd,%s-%s@kubernetescrd", args[0], args[1])
}).(pulumi.StringOutput)
} else {
middlewares = pulumi.String("kube-ingress-gzip-compress@kubernetescrd")
}
ingressAnnotations := pulumi.StringMap{
"traefik.ingress.kubernetes.io/router.middlewares": middlewares,
"traefik.ingress.kubernetes.io/router.entrypoints": pulumi.String("websecure"),
}
var ingressPaths netv1.HTTPIngressPathArray
for _, service := range ingressConfiguration {
ingressPaths = append(ingressPaths, netv1.HTTPIngressPathArgs{
Path: pulumi.String(service.ImageReference.Path),
PathType: pulumi.String("Prefix"),
Backend: &netv1.IngressBackendArgs{
Service: &netv1.IngressServiceBackendArgs{
Name: service.Service.Metadata.Name().Elem(),
Port: &netv1.ServiceBackendPortArgs{
Name: pulumi.String("exposed-port"),
},
},
},
})
}
return netv1.NewIngress(ctx, configuration.Name, &netv1.IngressArgs{
Metadata: &metav1.ObjectMetaArgs{
Namespace: namespace.Metadata.Name(),
Labels: pulumi.StringMap{
"app.kubernetes.io/part-of": pulumi.String(configuration.Name),
"app.kubernetes.io/managed-by": pulumi.String("pulumi"),
},
Annotations: ingressAnnotations,
},
Spec: &netv1.IngressSpecArgs{
IngressClassName: nil,
Rules: &netv1.IngressRuleArray{
netv1.IngressRuleArgs{
Host: host,
Http: &netv1.HTTPIngressRuleValueArgs{
Paths: ingressPaths,
},
},
},
Tls: &netv1.IngressTLSArray{
netv1.IngressTLSArgs{
Hosts: pulumi.StringArray{host},
SecretName: certificate.Spec.SecretName(),
},
},
},
}, pulumi.Parent(application))
}
return nil, nil
}
func createCertificate(
ctx *pulumi.Context, configuration *configuration, namespace *corev1.Namespace, application *Application,
) (*v1.Certificate, error) {
if configuration.ShouldCreateCertificate {
return v1.NewCertificate(ctx, configuration.Name, &v1.CertificateArgs{
Metadata: &metav1.ObjectMetaArgs{
Namespace: namespace.Metadata.Name(),
Labels: pulumi.StringMap{
"app.kubernetes.io/part-of": pulumi.String(configuration.Name),
"app.kubernetes.io/managed-by": pulumi.String("pulumi"),
},
},
Spec: &v1.CertificateSpecArgs{
SecretName: pulumi.String(fmt.Sprintf("%s-certificate", configuration.Name)),
DnsNames: pulumi.StringArray{
pulumi.String(configuration.Dns),
},
IssuerRef: &v1.CertificateSpecIssuerRefArgs{
Name: pulumi.String("localdomain-issuer"),
Kind: pulumi.String("ClusterIssuer"),
Group: pulumi.String("cfssl-issuer.wikimedia.org"),
},
},
}, pulumi.Parent(application))
}
return nil, nil
}
func createDNSRecord(ctx *pulumi.Context, configuration *configuration, namespace *corev1.Namespace, application *Application) (*dnsv1alpha1.DNSEndpoint, error) {
if configuration.ShouldCreateDns {
return dnsv1alpha1.NewDNSEndpoint(ctx, fmt.Sprintf("%s-record", configuration.Name), &dnsv1alpha1.DNSEndpointArgs{
Metadata: &metav1.ObjectMetaArgs{
Namespace: namespace.Metadata.Name(),
Labels: pulumi.StringMap{
"app.kubernetes.io/part-of": pulumi.String(configuration.Name),
"app.kubernetes.io/managed-by": pulumi.String("pulumi"),
},
},
Spec: &dnsv1alpha1.DNSEndpointSpecArgs{
Endpoints: &dnsv1alpha1.DNSEndpointSpecEndpointsArray{
&dnsv1alpha1.DNSEndpointSpecEndpointsArgs{
DnsName: pulumi.String(configuration.Dns),
RecordTTL: pulumi.Int(defaultRecordTTL),
RecordType: pulumi.String("CNAME"),
Targets: pulumi.StringArray{
pulumi.String(loadBalancerAddressName),
},
},
},
},
}, pulumi.Parent(application))
}
return nil, nil
}
func createService(ctx *pulumi.Context, configuration serviceConfiguration, namespace *corev1.Namespace, appLabels pulumi.StringMap, application *Application) (*corev1.Service, error) {
return corev1.NewService(ctx, fmt.Sprintf("%s-service", configuration.Name), &corev1.ServiceArgs{
Metadata: &metav1.ObjectMetaArgs{
Namespace: namespace.Metadata.Name(),
Labels: pulumi.StringMap{
"app.kubernetes.io/part-of": pulumi.String(configuration.Name),
"app.kubernetes.io/managed-by": pulumi.String("pulumi"),
},
},
Spec: &corev1.ServiceSpecArgs{
Type: pulumi.String("ClusterIP"),
Selector: appLabels,
Ports: corev1.ServicePortArray{
corev1.ServicePortArgs{
Name: pulumi.String("exposed-port"),
Port: pulumi.Int(8090),
TargetPort: pulumi.String("http"),
Protocol: pulumi.String("TCP"),
},
},
},
}, pulumi.Parent(application))
}
func createDeployment(
ctx *pulumi.Context, configuration *deploymentConfiguration, namespace *corev1.Namespace, appLabels pulumi.StringMap, application *Application,
) (*appsv1.Deployment, error) {
env := corev1.EnvVarArray{}
for key, value := range configuration.Env {
env = append(env, &corev1.EnvVarArgs{
Name: pulumi.String(key),
Value: pulumi.String(value),
})
}
return appsv1.NewDeployment(ctx, fmt.Sprintf("%s-deployment", configuration.Name), &appsv1.DeploymentArgs{
Metadata: &metav1.ObjectMetaArgs{
Namespace: namespace.Metadata.Name(),
Labels: pulumi.StringMap{
"app.kubernetes.io/part-of": pulumi.String(configuration.Name),
"app.kubernetes.io/managed-by": pulumi.String("pulumi"),
},
},
Spec: appsv1.DeploymentSpecArgs{
Selector: &metav1.LabelSelectorArgs{
MatchLabels: appLabels,
},
Replicas: pulumi.Int(configuration.Replicas),
Template: &corev1.PodTemplateSpecArgs{
Metadata: &metav1.ObjectMetaArgs{
Labels: appLabels,
},
Spec: &corev1.PodSpecArgs{
Containers: corev1.ContainerArray{
corev1.ContainerArgs{
Name: pulumi.String(configuration.Name),
Image: pulumi.String(configuration.ImageReference.Image),
Ports: corev1.ContainerPortArray{
corev1.ContainerPortArgs{
Name: pulumi.String("http"),
ContainerPort: pulumi.Int(80),
Protocol: pulumi.String("TCP"),
},
},
Env: env,
LivenessProbe: &corev1.ProbeArgs{
HttpGet: &corev1.HTTPGetActionArgs{
Path: pulumi.String(configuration.ImageReference.Health),
Port: pulumi.Int(80),
},
},
},
},
},
},
},
}, pulumi.Parent(application))
}
func createNamespace(ctx *pulumi.Context, configuration *configuration) (*corev1.Namespace, error) {
return corev1.NewNamespace(ctx, fmt.Sprintf("%s-namespace", configuration.Name), &corev1.NamespaceArgs{
Metadata: &metav1.ObjectMetaArgs{
Name: pulumi.String(configuration.Namespace),
Labels: pulumi.StringMap{
"app.kubernetes.io/managed-by": pulumi.String("pulumi"),
},
},
})
return createdApplication, nil
}

48
pkg/exposition/dns.go Normal file
View File

@ -0,0 +1,48 @@
package exposition
import (
"antoine-roux.tk/projects/go/pulumi-library/crds/kubernetes/externaldns/v1alpha1"
"fmt"
"github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/core/v1"
v12 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/meta/v1"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
const (
loadBalancerAddressName = "internal-lb.localdomain"
defaultRecordTTL = 180
)
type DnsConfiguration struct {
Name string
Dns string
}
func (dns *DnsConfiguration) CreateDNSRecord(
ctx *pulumi.Context,
namespace *v1.Namespace,
parentApplication pulumi.Resource,
) (*v1alpha1.DNSEndpoint, error) {
return v1alpha1.NewDNSEndpoint(ctx, fmt.Sprintf("%s-record", dns.Name), &v1alpha1.DNSEndpointArgs{
Metadata: &v12.ObjectMetaArgs{
Namespace: namespace.Metadata.Name(),
Labels: pulumi.StringMap{
"app.kubernetes.io/part-of": pulumi.String(dns.Name),
"app.kubernetes.io/managed-by": pulumi.String("pulumi"),
},
},
Spec: &v1alpha1.DNSEndpointSpecArgs{
Endpoints: &v1alpha1.DNSEndpointSpecEndpointsArray{
&v1alpha1.DNSEndpointSpecEndpointsArgs{
DnsName: pulumi.String(dns.Dns),
RecordTTL: pulumi.Int(defaultRecordTTL),
RecordType: pulumi.String("CNAME"),
Targets: pulumi.StringArray{
pulumi.String(loadBalancerAddressName),
},
},
},
},
}, pulumi.Parent(parentApplication))
}

188
pkg/exposition/ingress.go Normal file
View File

@ -0,0 +1,188 @@
package exposition
import (
certManager "antoine-roux.tk/projects/go/pulumi-library/crds/kubernetes/certmanager/v1"
traefik "antoine-roux.tk/projects/go/pulumi-library/crds/kubernetes/traefik/v1alpha1"
"fmt"
"github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/core/v1"
meta "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/meta/v1"
networking "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/networking/v1"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type IngressConfiguration struct {
Name string
Dns string
ResponseHeaders *traefik.MiddlewareSpecHeadersArgs
services []IngressServices
}
type IngressServices struct {
Service *v1.Service
Path string
}
func NewIngressConfiguration(name string, dns string, allowAllOrigin bool, services []IngressServices) *IngressConfiguration {
ingressConfiguration := &IngressConfiguration{
Name: name,
Dns: dns,
services: services,
}
if allowAllOrigin {
ingressConfiguration.ResponseHeaders = &traefik.MiddlewareSpecHeadersArgs{
AccessControlAllowOriginList: toPulumiStringArray([]string{"*"}),
}
}
return ingressConfiguration
}
func toPulumiStringArray(values []string) pulumi.StringArray {
array := pulumi.StringArray{}
for _, value := range values {
array = append(array, pulumi.String(value))
}
return array
}
func (ingress *IngressConfiguration) CreateIngress(
ctx *pulumi.Context,
namespace *v1.Namespace,
parentApplication pulumi.Resource,
certificate *certManager.Certificate,
) error {
var middlewares pulumi.StringInput
if ingress.ResponseHeaders != nil {
headerMiddleware, err := ingress.createMiddlewareAddResponseHeader(ctx, namespace, parentApplication)
if err != nil {
return err
}
middlewares = pulumi.All(namespace.Metadata.Name().Elem(), headerMiddleware.Metadata.Name().Elem()).ApplyT(func(args []interface{}) string {
return fmt.Sprintf("kube-ingress-gzip-compress@kubernetescrd,%s-%s@kubernetescrd", args[0], args[1])
}).(pulumi.StringOutput)
} else {
middlewares = pulumi.String("kube-ingress-gzip-compress@kubernetescrd")
}
ingressAnnotations := pulumi.StringMap{
"traefik.ingress.kubernetes.io/router.middlewares": middlewares,
"traefik.ingress.kubernetes.io/router.entrypoints": pulumi.String("websecure"),
}
// https routing
var ingressPaths networking.HTTPIngressPathArray
for _, service := range ingress.services {
ingressPaths = append(ingressPaths, networking.HTTPIngressPathArgs{
Path: pulumi.String(service.Path),
PathType: pulumi.String("Prefix"),
Backend: &networking.IngressBackendArgs{
Service: &networking.IngressServiceBackendArgs{
Name: service.Service.Metadata.Name().Elem(),
Port: &networking.ServiceBackendPortArgs{
Name: pulumi.String("exposed-port"),
},
},
},
})
}
// create http redirect to https
err := ingress.createHttpRedirectIngress(ctx, namespace, parentApplication, ingressPaths)
if err != nil {
return err
}
_, err = networking.NewIngress(ctx, fmt.Sprintf("%s-https", ingress.Name), &networking.IngressArgs{
Metadata: &meta.ObjectMetaArgs{
Namespace: namespace.Metadata.Name(),
Labels: pulumi.StringMap{
"app.kubernetes.io/part-of": pulumi.String(ingress.Name),
"app.kubernetes.io/managed-by": pulumi.String("pulumi"),
},
Annotations: ingressAnnotations,
},
Spec: &networking.IngressSpecArgs{
IngressClassName: pulumi.String("traefik-internal"),
Rules: &networking.IngressRuleArray{
networking.IngressRuleArgs{
Host: pulumi.StringPtr(ingress.Dns),
Http: &networking.HTTPIngressRuleValueArgs{
Paths: ingressPaths,
},
},
},
Tls: &networking.IngressTLSArray{
networking.IngressTLSArgs{
Hosts: pulumi.StringArray{
pulumi.String(ingress.Dns),
},
SecretName: certificate.Spec.SecretName(),
},
},
},
}, pulumi.Parent(parentApplication))
return err
}
func (ingress *IngressConfiguration) createHttpRedirectIngress(
ctx *pulumi.Context,
namespace *v1.Namespace,
parentApplication pulumi.Resource,
paths networking.HTTPIngressPathArray,
) error {
ingressAnnotations := pulumi.StringMap{
"traefik.ingress.kubernetes.io/router.middlewares": pulumi.String("kube-ingress-gzip-compress@kubernetescrd,kube-ingress-redirect-scheme-https@kubernetescrd"),
"traefik.ingress.kubernetes.io/router.entrypoints": pulumi.String("web"),
}
_, err := networking.NewIngress(ctx, fmt.Sprintf("%s-http", ingress.Name), &networking.IngressArgs{
Metadata: &meta.ObjectMetaArgs{
Namespace: namespace.Metadata.Name(),
Labels: pulumi.StringMap{
"app.kubernetes.io/part-of": pulumi.String(ingress.Name),
"app.kubernetes.io/managed-by": pulumi.String("pulumi"),
},
Annotations: ingressAnnotations,
},
Spec: &networking.IngressSpecArgs{
IngressClassName: pulumi.String("traefik-internal"),
Rules: &networking.IngressRuleArray{
networking.IngressRuleArgs{
Host: pulumi.String(ingress.Dns),
Http: &networking.HTTPIngressRuleValueArgs{
Paths: paths,
},
},
},
},
}, pulumi.Parent(parentApplication))
if err != nil {
return err
}
return nil
}
func (ingress *IngressConfiguration) createMiddlewareAddResponseHeader(
ctx *pulumi.Context,
namespace *v1.Namespace,
parentApplication pulumi.Resource,
) (*traefik.Middleware, error) {
middlewareName := fmt.Sprintf("%s-response-header-middleware", ingress.Name)
return traefik.NewMiddleware(ctx, middlewareName, &traefik.MiddlewareArgs{
Metadata: &meta.ObjectMetaArgs{
Namespace: namespace.Metadata.Name(),
Labels: pulumi.StringMap{
"app.kubernetes.io/part-of": pulumi.String(ingress.Name),
"app.kubernetes.io/managed-by": pulumi.String("pulumi"),
},
},
Spec: &traefik.MiddlewareSpecArgs{
Headers: ingress.ResponseHeaders,
},
}, pulumi.Parent(parentApplication))
}

41
pkg/exposition/service.go Normal file
View File

@ -0,0 +1,41 @@
package exposition
import (
"fmt"
"github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/core/v1"
v12 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/meta/v1"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type ServiceConfiguration struct {
Name string
}
func (service *ServiceConfiguration) CreateService(
ctx *pulumi.Context,
namespace *v1.Namespace,
parentApplication pulumi.Resource,
appLabels pulumi.StringMap,
) (*v1.Service, error) {
return v1.NewService(ctx, fmt.Sprintf("%s-service", service.Name), &v1.ServiceArgs{
Metadata: &v12.ObjectMetaArgs{
Namespace: namespace.Metadata.Name(),
Labels: pulumi.StringMap{
"app.kubernetes.io/part-of": pulumi.String(service.Name),
"app.kubernetes.io/managed-by": pulumi.String("pulumi"),
},
},
Spec: &v1.ServiceSpecArgs{
Type: pulumi.String("ClusterIP"),
Selector: appLabels,
Ports: v1.ServicePortArray{
v1.ServicePortArgs{
Name: pulumi.String("exposed-port"),
Port: pulumi.Int(8090),
TargetPort: pulumi.String("http"),
Protocol: pulumi.String("TCP"),
},
},
},
}, pulumi.Parent(parentApplication))
}

41
pkg/meta/certificate.go Normal file
View File

@ -0,0 +1,41 @@
package meta
import (
certManager "antoine-roux.tk/projects/go/pulumi-library/crds/kubernetes/certmanager/v1"
"fmt"
"github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/core/v1"
meta "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/meta/v1"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type CertificateConfiguration struct {
Name string
Dns string
}
func (certificate *CertificateConfiguration) CreateCertificate(
ctx *pulumi.Context,
namespace *v1.Namespace,
parentApplication pulumi.Resource,
) (*certManager.Certificate, error) {
return certManager.NewCertificate(ctx, certificate.Name, &certManager.CertificateArgs{
Metadata: &meta.ObjectMetaArgs{
Namespace: namespace.Metadata.Name(),
Labels: pulumi.StringMap{
"app.kubernetes.io/part-of": pulumi.String(certificate.Name),
"app.kubernetes.io/managed-by": pulumi.String("pulumi"),
},
},
Spec: &certManager.CertificateSpecArgs{
SecretName: pulumi.String(fmt.Sprintf("%s-certificate", certificate.Name)),
DnsNames: pulumi.StringArray{
pulumi.String(certificate.Dns),
},
IssuerRef: &certManager.CertificateSpecIssuerRefArgs{
Name: pulumi.String("localdomain-issuer"),
Kind: pulumi.String("ClusterIssuer"),
Group: pulumi.String("cfssl-issuer.wikimedia.org"),
},
},
}, pulumi.Parent(parentApplication))
}

24
pkg/meta/namespace.go Normal file
View File

@ -0,0 +1,24 @@
package meta
import (
"fmt"
"github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/core/v1"
v12 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/meta/v1"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type NamespaceConfiguration struct {
Name string
Namespace string
}
func (namespace *NamespaceConfiguration) CreateNamespace(ctx *pulumi.Context) (*v1.Namespace, error) {
return v1.NewNamespace(ctx, fmt.Sprintf("%s-namespace", namespace.Name), &v1.NamespaceArgs{
Metadata: &v12.ObjectMetaArgs{
Name: pulumi.String(namespace.Namespace),
Labels: pulumi.StringMap{
"app.kubernetes.io/managed-by": pulumi.String("pulumi"),
},
},
})
}

View File

@ -0,0 +1,79 @@
package workload
import (
"fmt"
v12 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/apps/v1"
"github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/core/v1"
v13 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/meta/v1"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type DeploymentConfiguration struct {
Env map[string]string
Name string
Replicas int
ImageReference *ImageReference
}
type ImageReference struct {
Image string
Health string
}
func (deployment *DeploymentConfiguration) CreateDeployment(
ctx *pulumi.Context,
namespace *v1.Namespace,
parentApplication pulumi.Resource,
appLabels pulumi.StringMap,
) (*v12.Deployment, error) {
env := v1.EnvVarArray{}
for key, value := range deployment.Env {
env = append(env, &v1.EnvVarArgs{
Name: pulumi.String(key),
Value: pulumi.String(value),
})
}
return v12.NewDeployment(ctx, fmt.Sprintf("%s-deployment", deployment.Name), &v12.DeploymentArgs{
Metadata: &v13.ObjectMetaArgs{
Namespace: namespace.Metadata.Name(),
Labels: pulumi.StringMap{
"app.kubernetes.io/part-of": pulumi.String(deployment.Name),
"app.kubernetes.io/managed-by": pulumi.String("pulumi"),
},
},
Spec: v12.DeploymentSpecArgs{
Selector: &v13.LabelSelectorArgs{
MatchLabels: appLabels,
},
Replicas: pulumi.Int(deployment.Replicas),
Template: &v1.PodTemplateSpecArgs{
Metadata: &v13.ObjectMetaArgs{
Labels: appLabels,
},
Spec: &v1.PodSpecArgs{
Containers: v1.ContainerArray{
v1.ContainerArgs{
Name: pulumi.String(deployment.Name),
Image: pulumi.String(deployment.ImageReference.Image),
Ports: v1.ContainerPortArray{
v1.ContainerPortArgs{
Name: pulumi.String("http"),
ContainerPort: pulumi.Int(80),
Protocol: pulumi.String("TCP"),
},
},
Env: env,
LivenessProbe: &v1.ProbeArgs{
HttpGet: &v1.HTTPGetActionArgs{
Path: pulumi.String(deployment.ImageReference.Health),
Port: pulumi.Int(80),
},
},
},
},
},
},
},
}, pulumi.Parent(parentApplication))
}