Skip to content

Commit 122e983

Browse files
authored
add byok for cloud settings (#694)
* add byok for cloud settings * linter
1 parent 22e2db1 commit 122e983

8 files changed

Lines changed: 355 additions & 121 deletions

File tree

cmd/command/up/up.go

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ func (p *Plural) handleUp(c *cli.Context) error {
122122
return err
123123
}
124124

125+
byok := ctx.Provider.Name() == api.BYOK
126+
125127
if c.Bool("cloud") {
126128
id, err := getCluster(cd)
127129
if err != nil {
@@ -130,6 +132,14 @@ func (p *Plural) handleUp(c *cli.Context) error {
130132

131133
ctx.ImportCluster = lo.ToPtr(id)
132134
ctx.CloudCluster = name
135+
if byok {
136+
if err := p.InitConsoleClient("", ""); err != nil {
137+
return err
138+
}
139+
if err := p.ReinstallOperator(c, lo.ToPtr(id), nil, ""); err != nil {
140+
return err
141+
}
142+
}
133143
}
134144

135145
if err := ctx.Backfill(); err != nil {
@@ -148,8 +158,10 @@ func (p *Plural) handleUp(c *cli.Context) error {
148158
return nil
149159
}
150160

151-
if !common.Affirm(common.AffirmUp, "PLURAL_UP_AFFIRM_DEPLOY") {
152-
return fmt.Errorf("cancelled deploy")
161+
if !byok {
162+
if !common.Affirm(common.AffirmUp, "PLURAL_UP_AFFIRM_DEPLOY") {
163+
return fmt.Errorf("cancelled deploy")
164+
}
153165
}
154166

155167
if err := ctx.Deploy(func() error {
@@ -164,6 +176,12 @@ func (p *Plural) handleUp(c *cli.Context) error {
164176
}
165177

166178
utils.Success("Finished setting up your management cluster!\n")
179+
if byok {
180+
utils.Highlight("Since you're using BYOK, be sure to complete setup of your management cluster\n")
181+
utils.Highlight("IMPORTANT: You'll need to configure IAM permissions for the plrl-deploy-operator/stacks service account.\n")
182+
utils.Highlight("This is no longer handled automatically. See the terraform example in the docs for the required IAM policy.\n")
183+
return nil
184+
}
167185
utils.Highlight("Feel free to use terraform as you normally would, and leverage the gitops setup we've generated in the bootstrap/ subfolder\n")
168186
return nil
169187
}

go.mod

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ require (
3030
github.com/chartmuseum/helm-push v0.10.4
3131
github.com/fatih/color v1.18.0
3232
github.com/go-git/go-git/v5 v5.16.0
33-
github.com/gofrs/flock v0.12.1
33+
github.com/gofrs/flock v0.13.0
3434
github.com/google/go-containerregistry v0.20.3
3535
github.com/google/go-github/v45 v45.2.0
3636
github.com/hashicorp/go-bexpr v0.1.14
@@ -51,17 +51,17 @@ require (
5151
github.com/urfave/cli v1.22.16
5252
github.com/yuin/gopher-lua v1.1.1
5353
gitlab.com/gitlab-org/api/client-go v0.128.0
54-
golang.org/x/crypto v0.45.0
54+
golang.org/x/crypto v0.46.0
5555
golang.org/x/oauth2 v0.32.0
5656
google.golang.org/api v0.254.0
5757
google.golang.org/grpc v1.76.0
5858
gopkg.in/yaml.v2 v2.4.0
5959
gopkg.in/yaml.v3 v3.0.1
6060
gotest.tools/v3 v3.5.1
61-
helm.sh/helm/v3 v3.19.3
62-
k8s.io/api v0.34.0
63-
k8s.io/apimachinery v0.34.0
64-
k8s.io/client-go v0.34.0
61+
helm.sh/helm/v3 v3.20.0
62+
k8s.io/api v0.35.0
63+
k8s.io/apimachinery v0.35.0
64+
k8s.io/client-go v0.35.0
6565
sigs.k8s.io/controller-runtime v0.21.0
6666
sigs.k8s.io/yaml v1.6.0
6767
)
@@ -119,15 +119,13 @@ require (
119119
github.com/google/gnostic-models v0.7.0 // indirect
120120
github.com/google/s2a-go v0.1.9 // indirect
121121
github.com/googleapis/enterprise-certificate-proxy v0.3.6 // indirect
122-
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
123122
github.com/hashicorp/errwrap v1.1.0 // indirect
124123
github.com/hashicorp/go-multierror v1.1.1 // indirect
125124
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
126125
github.com/kylelemons/godebug v1.1.0 // indirect
127126
github.com/likexian/gokit v0.25.15 // indirect
128127
github.com/mitchellh/pointerstructure v1.2.1 // indirect
129128
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
130-
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
131129
github.com/osteele/liquid v1.6.0 // indirect
132130
github.com/osteele/tuesday v1.0.3 // indirect
133131
github.com/pjbgf/sha1cd v0.3.2 // indirect
@@ -151,14 +149,14 @@ require (
151149
go.opentelemetry.io/otel/sdk v1.37.0 // indirect
152150
go.opentelemetry.io/otel/sdk/metric v1.37.0 // indirect
153151
go.opentelemetry.io/otel/trace v1.37.0 // indirect
154-
go.yaml.in/yaml/v2 v2.4.2 // indirect
152+
go.yaml.in/yaml/v2 v2.4.3 // indirect
155153
go.yaml.in/yaml/v3 v3.0.4 // indirect
156154
google.golang.org/genproto v0.0.0-20250603155806-513f23925822 // indirect
157155
google.golang.org/genproto/googleapis/api v0.0.0-20250818200422-3122310a409c // indirect
158156
google.golang.org/genproto/googleapis/rpc v0.0.0-20251022142026-3a174f9686a8 // indirect
159157
google.golang.org/protobuf v1.36.10 // indirect
160-
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
161-
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
158+
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
159+
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
162160
oras.land/oras-go/v2 v2.6.0 // indirect
163161
sigs.k8s.io/randfill v1.0.0 // indirect
164162
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
@@ -170,7 +168,7 @@ require (
170168
github.com/Azure/azure-pipeline-go v0.2.3 // indirect
171169
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
172170
github.com/Azure/go-autorest/autorest/adal v0.9.23 // indirect
173-
github.com/BurntSushi/toml v1.5.0 // indirect
171+
github.com/BurntSushi/toml v1.6.0 // indirect
174172
github.com/MakeNowJust/heredoc v1.0.0 // indirect
175173
github.com/Masterminds/goutils v1.1.1 // indirect
176174
github.com/Masterminds/semver/v3 v3.4.0
@@ -184,9 +182,9 @@ require (
184182
github.com/cespare/xxhash/v2 v2.3.0 // indirect
185183
github.com/chai2010/gettext-go v1.0.3 // indirect
186184
github.com/cli/browser v1.3.0 // indirect
187-
github.com/containerd/containerd v1.7.29 // indirect
185+
github.com/containerd/containerd v1.7.30 // indirect
188186
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
189-
github.com/cyphar/filepath-securejoin v0.6.0 // indirect
187+
github.com/cyphar/filepath-securejoin v0.6.1 // indirect
190188
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
191189
github.com/emirpasic/gods v1.18.1 // indirect
192190
github.com/evanphx/json-patch v5.9.11+incompatible
@@ -200,7 +198,6 @@ require (
200198
github.com/go-openapi/jsonreference v0.21.0 // indirect
201199
github.com/go-openapi/swag v0.23.1 // indirect
202200
github.com/gobwas/glob v0.2.3 // indirect
203-
github.com/gogo/protobuf v1.3.2 // indirect
204201
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
205202
github.com/google/btree v1.1.3 // indirect
206203
github.com/google/go-cmp v0.7.0 // indirect
@@ -233,7 +230,6 @@ require (
233230
github.com/mitchellh/copystructure v1.2.0 // indirect
234231
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
235232
github.com/mitchellh/reflectwalk v1.0.2 // indirect
236-
github.com/moby/spdystream v0.5.0 // indirect
237233
github.com/moby/term v0.5.2 // indirect
238234
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
239235
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
@@ -245,42 +241,39 @@ require (
245241
github.com/pkg/errors v0.9.1
246242
github.com/pluralsh/oauth v0.9.2
247243
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
248-
github.com/prometheus/client_model v0.6.2 // indirect
249-
github.com/prometheus/common v0.63.0 // indirect
250-
github.com/prometheus/procfs v0.16.1 // indirect
251244
github.com/rivo/uniseg v0.4.7 // indirect
252-
github.com/rubenv/sql-migrate v1.8.0 // indirect
245+
github.com/rubenv/sql-migrate v1.8.1 // indirect
253246
github.com/russross/blackfriday/v2 v2.1.0 // indirect
254247
github.com/schollz/progressbar/v3 v3.18.0
255248
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
256249
github.com/shopspring/decimal v1.4.0 // indirect
257250
github.com/sirupsen/logrus v1.9.3 // indirect
258251
github.com/spf13/cast v1.7.1 // indirect
259-
github.com/spf13/cobra v1.10.1 // indirect
252+
github.com/spf13/cobra v1.10.2 // indirect
260253
github.com/spf13/pflag v1.0.10 // indirect
261254
github.com/stretchr/testify v1.11.1
262255
github.com/xanzy/ssh-agent v0.3.3 // indirect
263256
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
264257
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
265258
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
266259
github.com/xlab/treeprint v1.2.0 // indirect
267-
golang.org/x/net v0.47.0 // indirect
268-
golang.org/x/sync v0.18.0 // indirect
269-
golang.org/x/sys v0.38.0 // indirect
270-
golang.org/x/term v0.37.0
271-
golang.org/x/text v0.31.0
260+
golang.org/x/net v0.48.0 // indirect
261+
golang.org/x/sync v0.19.0 // indirect
262+
golang.org/x/sys v0.40.0 // indirect
263+
golang.org/x/term v0.39.0
264+
golang.org/x/text v0.33.0
272265
golang.org/x/time v0.14.0 // indirect
273266
gopkg.in/inf.v0 v0.9.1 // indirect
274267
gopkg.in/warnings.v0 v0.1.2 // indirect
275-
k8s.io/apiextensions-apiserver v0.34.0 // indirect
276-
k8s.io/apiserver v0.34.0 // indirect
277-
k8s.io/cli-runtime v0.34.0
278-
k8s.io/component-base v0.34.0 // indirect
268+
k8s.io/apiextensions-apiserver v0.35.0 // indirect
269+
k8s.io/apiserver v0.35.0 // indirect
270+
k8s.io/cli-runtime v0.35.0
271+
k8s.io/component-base v0.35.0 // indirect
279272
k8s.io/helm v2.17.0+incompatible
280273
k8s.io/klog/v2 v2.130.1 // indirect
281-
k8s.io/kubectl v0.34.0
282-
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect
283-
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
274+
k8s.io/kubectl v0.35.0
275+
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect
276+
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
284277
sigs.k8s.io/kustomize/api v0.20.1 // indirect
285278
sigs.k8s.io/kustomize/kyaml v0.20.1 // indirect
286279
)

0 commit comments

Comments
 (0)