Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b33ca86
Fix catalog apps generation and validation.
patrickdappollonio Jan 13, 2025
07567f1
AWS credential handling: pick local configuration then assume a role.
patrickdappollonio Jan 13, 2025
482fbbb
Fix calls to flag parsing. Adds possibly needed AWS checker.
patrickdappollonio Jan 13, 2025
a028e85
Check if user can create clusters.
patrickdappollonio Jan 13, 2025
ad0089f
Typo in comment
patrickdappollonio Jan 13, 2025
ef294ac
Avoid stutter.
patrickdappollonio Jan 13, 2025
09c1116
Add creating a new role ARN if one isn't specified.
patrickdappollonio Jan 14, 2025
1fcb8f1
Merge branch 'main' into aws-auth
patrickdappollonio Jan 15, 2025
014e5c6
Merge branch 'aws-auth' of github.com:konstructio/kubefirst into aws-…
patrickdappollonio Jan 15, 2025
50d87d3
Fix evaluation engine.
patrickdappollonio Jan 15, 2025
5730a80
Fix tests. Update code to return true if all pass.
patrickdappollonio Jan 15, 2025
03ce55b
Add additional test for missing action.
patrickdappollonio Jan 15, 2025
fb62a95
Update tests to comply with the new flow.
patrickdappollonio Jan 15, 2025
d0b5ac1
Pre-checks before operating.
patrickdappollonio Jan 16, 2025
b9011ea
Pre-checks before operating.
patrickdappollonio Jan 16, 2025
52b9a25
Update with checks.
patrickdappollonio Jan 16, 2025
6d83d83
Update with checks.
patrickdappollonio Jan 16, 2025
4f2b84e
Update with checks.
patrickdappollonio Jan 16, 2025
f29a6bf
fix: errpr validation
jokestax Jan 16, 2025
caf3e02
check is user has permission to assume roles
muse-sisay Jan 16, 2025
07595e7
feat: add extra permissions to create a succesfull cluster
jokestax Jan 27, 2025
4f0adf7
fix: unit test cases
jokestax Jan 27, 2025
699f076
fix: lint issues
jokestax Jan 27, 2025
88700c9
fix: lint issues
jokestax Jan 27, 2025
027a84e
fix: increase session duration
jokestax Jan 27, 2025
6c2005b
fix: add retries
jokestax Jan 29, 2025
b95180a
fix: tests
jokestax Jan 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cmd/akamai/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ import (
)

func createAkamai(cmd *cobra.Command, _ []string) error {
cliFlags, err := utilities.GetFlags(cmd, "akamai")
cliFlags, err := utilities.GetFlags(cmd, utilities.CloudProviderAkamai)
if err != nil {
progress.Error(err.Error())
return fmt.Errorf("failed to get flags: %w", err)
}

progress.DisplayLogHints(25)

isValid, catalogApps, err := catalog.ValidateCatalogApps(cliFlags.InstallCatalogApps)
if !isValid {
return fmt.Errorf("catalog validation failed: %w", err)
catalogApps, err := catalog.ValidateCatalogApps(cliFlags.InstallCatalogApps)
if err != nil {
return fmt.Errorf("failed to validate catalog apps: %w", err)
}

err = ValidateProvidedFlags(cliFlags.GitProvider, cliFlags.DNSProvider)
Expand Down
69 changes: 23 additions & 46 deletions cmd/aws/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,6 @@ import (
)

var (
// Create
alertsEmailFlag string
ciFlag bool
cloudRegionFlag string
clusterNameFlag string
clusterTypeFlag string
dnsProviderFlag string
githubOrgFlag string
gitlabGroupFlag string
gitProviderFlag string
gitProtocolFlag string
gitopsTemplateURLFlag string
gitopsTemplateBranchFlag string
domainNameFlag string
subdomainNameFlag string
useTelemetryFlag bool
ecrFlag bool
nodeTypeFlag string
nodeCountFlag string
installCatalogApps string
installKubefirstProFlag bool
amiType string

// Supported argument arrays
supportedDNSProviders = []string{"aws", "cloudflare"}
supportedGitProviders = []string{"github", "gitlab"}
Expand Down Expand Up @@ -70,7 +47,6 @@ func NewCommand() *cobra.Command {

// wire up new commands
awsCmd.AddCommand(Create(), Destroy(), Quota(), RootCredentials())

return awsCmd
}

Expand All @@ -86,29 +62,30 @@ func Create() *cobra.Command {
awsDefaults := constants.GetCloudDefaults().Aws

// todo review defaults and update descriptions
createCmd.Flags().StringVar(&alertsEmailFlag, "alerts-email", "", "email address for let's encrypt certificate notifications (required)")
createCmd.Flags().String("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", "us-east-1", "the aws 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", awsDefaults.NodeCount, "the node count for the cluster")
createCmd.Flags().StringVar(&nodeTypeFlag, "node-type", awsDefaults.InstanceSize, "the instance size of the cluster to create")
createCmd.Flags().StringVar(&dnsProviderFlag, "dns-provider", "aws", fmt.Sprintf("the dns provider - one of: %q", supportedDNSProviders))
createCmd.Flags().StringVar(&subdomainNameFlag, "subdomain", "", "the subdomain to use for DNS records (Cloudflare)")
createCmd.Flags().StringVar(&domainNameFlag, "domain-name", "", "the Route53/Cloudflare hosted zone name to use for DNS records (i.e. your-domain.com|subdomain.your-domain.com) (required)")
createCmd.Flags().Bool("ci", false, "if running kubefirst in ci, set this flag to disable interactive features")
createCmd.Flags().String("cloud-region", "us-east-1", "the aws region to provision infrastructure in")
createCmd.Flags().String("cluster-name", "kubefirst", "the name of the cluster to create")
createCmd.Flags().String("cluster-type", "mgmt", "the type of cluster to create (i.e. mgmt|workload)")
createCmd.Flags().String("node-count", awsDefaults.NodeCount, "the node count for the cluster")
createCmd.Flags().String("node-type", awsDefaults.InstanceSize, "the instance size of the cluster to create")
createCmd.Flags().String("dns-provider", "aws", fmt.Sprintf("the dns provider - one of: %q", supportedDNSProviders))
createCmd.Flags().String("subdomain", "", "the subdomain to use for DNS records (Cloudflare)")
createCmd.Flags().String("domain-name", "", "the Route53/Cloudflare hosted zone name to use for DNS records (i.e. your-domain.com|subdomain.your-domain.com) (required)")
createCmd.MarkFlagRequired("domain-name")
createCmd.Flags().StringVar(&gitProviderFlag, "git-provider", "github", fmt.Sprintf("the git provider - one of: %q", supportedGitProviders))
createCmd.Flags().StringVar(&gitProtocolFlag, "git-protocol", "ssh", fmt.Sprintf("the git protocol - one of: %q", supportedGitProtocolOverride))
createCmd.Flags().StringVar(&githubOrgFlag, "github-org", "", "the GitHub organization for the new gitops and metaphor repositories - required if using github")
createCmd.Flags().StringVar(&gitlabGroupFlag, "gitlab-group", "", "the GitLab group for the new gitops and metaphor projects - required if using gitlab")
createCmd.Flags().StringVar(&gitopsTemplateBranchFlag, "gitops-template-branch", "", "the branch to clone for the gitops-template repository")
createCmd.Flags().StringVar(&gitopsTemplateURLFlag, "gitops-template-url", "https://github.com/konstructio/gitops-template.git", "the fully qualified url to the gitops-template repository to clone")
createCmd.Flags().StringVar(&installCatalogApps, "install-catalog-apps", "", "comma separated values to install after provision")
createCmd.Flags().BoolVar(&useTelemetryFlag, "use-telemetry", true, "whether to emit telemetry")
createCmd.Flags().BoolVar(&ecrFlag, "ecr", false, "whether or not to use ecr vs the git provider")
createCmd.Flags().BoolVar(&installKubefirstProFlag, "install-kubefirst-pro", true, "whether or not to install kubefirst pro")
createCmd.Flags().StringVar(&amiType, "ami-type", "AL2_x86_64", fmt.Sprintf("the ami type for node group - one of: %q", getSupportedAMITypes()))
createCmd.Flags().String("git-provider", "github", fmt.Sprintf("the git provider - one of: %q", supportedGitProviders))
createCmd.Flags().String("git-protocol", "ssh", fmt.Sprintf("the git protocol - one of: %q", supportedGitProtocolOverride))
createCmd.Flags().String("github-org", "", "the GitHub organization for the new gitops and metaphor repositories - required if using github")
createCmd.Flags().String("gitlab-group", "", "the GitLab group for the new gitops and metaphor projects - required if using gitlab")
createCmd.Flags().String("gitops-template-branch", "", "the branch to clone for the gitops-template repository")
createCmd.Flags().String("gitops-template-url", "https://github.com/konstructio/gitops-template.git", "the fully qualified url to the gitops-template repository to clone")
createCmd.Flags().String("install-catalog-apps", "", "comma separated values to install after provision")
createCmd.Flags().Bool("use-telemetry", true, "whether to emit telemetry")
createCmd.Flags().Bool("ecr", false, "whether or not to use ecr vs the git provider")
createCmd.Flags().Bool("install-kubefirst-pro", true, "whether or not to install kubefirst pro")
createCmd.Flags().String("ami-type", "AL2_x86_64", fmt.Sprintf("the ami type for node group - one of: %q", getSupportedAMITypes()))
createCmd.Flags().String("kubernetes-admin-role-arn", "", "the role arn with Kubernetes Admin privileges to use for the creation flow")

return createCmd
}
Expand Down Expand Up @@ -141,7 +118,7 @@ func Quota() *cobra.Command {
RunE: evalAwsQuota,
}

quotaCmd.Flags().StringVar(&cloudRegionFlag, "cloud-region", "us-east-1", "the aws region to provision infrastructure in")
quotaCmd.Flags().String("cloud-region", "us-east-1", "the aws region to provision infrastructure in")

return quotaCmd
}
Expand Down
Loading