Skip to content

Commit

Permalink
WIP. add node type/ node count to cli
Browse files Browse the repository at this point in the history
  • Loading branch information
D-B-Hawk committed Dec 9, 2023
1 parent 4648964 commit 47be492
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 37 deletions.
8 changes: 8 additions & 0 deletions cmd/digitalocean/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ package digitalocean
import (
"fmt"

"github.com/kubefirst/kubefirst-api/pkg/constants"
"github.com/kubefirst/kubefirst/internal/common"
"github.com/kubefirst/kubefirst/internal/progress"

"github.com/spf13/cobra"
)

Expand All @@ -30,6 +32,8 @@ var (
gitopsTemplateURLFlag string
gitopsTemplateBranchFlag string
useTelemetryFlag bool
nodeTypeFlag string
nodeCountFlag string

// RootCredentials
copyArgoCDPasswordToClipboardFlag bool
Expand Down Expand Up @@ -76,13 +80,17 @@ func Create() *cobra.Command {
// PreRun: common.CheckDocker,
}

doDefaults := constants.GetCloudDefaults().DigitalOcean

// todo review defaults and update descriptions
createCmd.Flags().StringVar(&alertsEmailFlag, "alerts-email", "", "email address for let's encrypt certificate notifications (required)")
createCmd.MarkFlagRequired("alerts-email")
createCmd.Flags().BoolVar(&ciFlag, "ci", false, "if running kubefirst in ci, set this flag to disable interactive features")
createCmd.Flags().StringVar(&cloudRegionFlag, "cloud-region", "nyc3", "the DigitalOcean region to provision infrastructure in")
createCmd.Flags().StringVar(&clusterNameFlag, "cluster-name", "kubefirst", "the name of the cluster to create")
createCmd.Flags().StringVar(&clusterTypeFlag, "cluster-type", "mgmt", "the type of cluster to create (i.e. mgmt|workload)")
createCmd.Flags().StringVar(&nodeCountFlag, "node-count", doDefaults.NodeCount, "the node count for the cluster")
createCmd.Flags().StringVar(&nodeTypeFlag, "node-type", doDefaults.InstanceSize, "the instance size of the cluster to create")
createCmd.Flags().StringVar(&dnsProviderFlag, "dns-provider", "digitalocean", fmt.Sprintf("the dns provider - one of: %s", supportedDNSProviders))
createCmd.Flags().StringVar(&domainNameFlag, "domain-name", "", "the DigitalOcean DNS Name to use for DNS records (i.e. your-domain.com|subdomain.your-domain.com) (required)")
createCmd.MarkFlagRequired("domain-name")
Expand Down
18 changes: 6 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ require (
github.com/charmbracelet/bubbles v0.16.1
github.com/charmbracelet/bubbletea v0.24.2
github.com/charmbracelet/lipgloss v0.8.0
github.com/chromedp/chromedp v0.8.7
github.com/civo/civogo v0.3.28
github.com/civo/civogo v0.3.53
github.com/denisbrodbeck/machineid v1.0.1
github.com/dustin/go-humanize v1.0.1
github.com/go-git/go-git/v5 v5.6.1
github.com/hashicorp/vault/api v1.9.0
github.com/kubefirst/kubefirst-api v0.0.4
github.com/kubefirst/metrics-client v0.2.1
github.com/kubefirst/runtime v0.3.28
github.com/kubefirst/kubefirst-api v0.1.8
github.com/kubefirst/metrics-client v0.2.8
github.com/kubefirst/runtime v0.3.35
github.com/rs/zerolog v1.29.1
github.com/segmentio/analytics-go v3.1.0+incompatible
github.com/sirupsen/logrus v1.9.0
github.com/spf13/cobra v1.7.0
github.com/spf13/viper v1.15.0
go.mongodb.org/mongo-driver v1.10.3
k8s.io/api v0.26.2
golang.org/x/exp v0.0.0-20230321023759-10a507213a29
k8s.io/api v0.27.1
k8s.io/apimachinery v0.27.1
k8s.io/client-go v11.0.1-0.20190816222228-6d55c1b1f1ca+incompatible
)
Expand Down Expand Up @@ -80,8 +80,6 @@ require (
github.com/caarlos0/sshmarshal v0.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chai2010/gettext-go v0.1.0 // indirect
github.com/chromedp/cdproto v0.0.0-20230109101555-6b041c6303cc // indirect
github.com/chromedp/sysutil v1.0.0 // indirect
github.com/cloudflare/circl v1.1.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/digitalocean/godo v1.98.0 // indirect
Expand All @@ -106,9 +104,6 @@ require (
github.com/go-test/deep v1.1.0 // indirect
github.com/go-yaml/yaml v2.1.0+incompatible // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/gobwas/httphead v0.1.0 // indirect
github.com/gobwas/pool v0.2.1 // indirect
github.com/gobwas/ws v1.1.0 // indirect
github.com/gofrs/flock v0.7.0 // indirect
github.com/golang-jwt/jwt/v4 v4.4.3 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
Expand Down Expand Up @@ -179,7 +174,6 @@ require (
go.opencensus.io v0.24.0 // indirect
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/tools v0.12.0 // indirect
Expand Down
Loading

0 comments on commit 47be492

Please sign in to comment.