k3d

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 24 Imported by: 1

Documentation

Overview

Copyright (C) 2021-2023, Kubefirst

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

Index

Constants

View Source
const (
	ArgocdPortForwardURL = "http://localhost:8080"
	CloudProvider        = "k3d"
	DomainName           = "kubefirst.dev"
	GithubHost           = "github.com"
	GitlabHost           = "gitlab.com"
	K3dVersion           = "v5.4.6"
	KubectlVersion       = "v1.25.7"
	LocalhostARCH        = runtime.GOARCH
	LocalhostOS          = runtime.GOOS
	MkCertVersion        = "v1.4.4"
	TerraformVersion     = "1.3.8"
	VaultPortForwardURL  = "http://localhost:8200"
)

Variables

View Source
var (
	ArgocdURL              = fmt.Sprintf("https://argocd.%s", DomainName)
	ArgoWorkflowsURL       = fmt.Sprintf("https://argo.%s", DomainName)
	AtlantisURL            = fmt.Sprintf("https://atlantis.%s", DomainName)
	ChartMuseumURL         = fmt.Sprintf("https://chartmuseum.%s", DomainName)
	KubefirstConsoleURL    = fmt.Sprintf("https://kubefirst.%s", DomainName)
	MetaphorDevelopmentURL = fmt.Sprintf("https://metaphor-devlopment.%s", DomainName)
	MetaphorStagingURL     = fmt.Sprintf("https://metaphor-staging.%s", DomainName)
	MetaphorProductionURL  = fmt.Sprintf("https://metaphor-production.%s", DomainName)
	VaultURL               = fmt.Sprintf("https://vault.%s", DomainName)
)

Functions

func AddK3DSecrets

func AddK3DSecrets(
	atlantisWebhookSecret string,
	kbotPublicKey string,
	destinationGitopsRepoURL string,
	kbotPrivateKey string,
	gitProvider string,
	gitUser string,
	gitOwner string,
	kubeconfigPath string,
	tokenValue string,
) error

func AdjustGitopsRepo

func AdjustGitopsRepo(cloudProvider, clusterName, clusterType, gitopsRepoDir, gitProvider, k1Dir string) error

func AdjustMetaphorRepo

func AdjustMetaphorRepo(destinationMetaphorRepoGitURL, gitopsRepoDir, gitProvider, k1Dir string) error

func ClusterCreate

func ClusterCreate(clusterName string, k1Dir string, k3dClient string, kubeconfig string) error

ClusterCreate create an k3d cluster

func ClusterCreateConsoleAPI added in v0.1.31

func ClusterCreateConsoleAPI(clusterName string, k1Dir string, k3dClient string, kubeconfig string) error

ClusterCreate create an k3d cluster for use with console and api

func DeleteK3dCluster

func DeleteK3dCluster(clusterName string, k1Dir string, k3dClient string) error

DeleteK3dCluster delete a k3d cluster

func DownloadTools

func DownloadTools(clusterName string, gitProvider string, gitOwner string, toolsDir string, gitProtocol string) error

func GenerateSingleTLSSecret added in v0.1.56

func GenerateSingleTLSSecret(
	clientset *kubernetes.Clientset,
	config K3dConfig,
	app string,
	ns string,
) error

GenerateSingleTLSSecret creates a single certificate for a host for k3d

func GenerateTLSSecrets

func GenerateTLSSecrets(clientset *kubernetes.Clientset, config K3dConfig) error

GenerateTLSSecrets generates default certificates for k3d

func GetGithubTerraformEnvs

func GetGithubTerraformEnvs(config *K3dConfig, envs map[string]string, githubToken string) map[string]string

func GetUsersTerraformEnvs

func GetUsersTerraformEnvs(config *K3dConfig, envs map[string]string) map[string]string

func GetVaultTerraformEnvs

func GetVaultTerraformEnvs(config *K3dConfig, envs map[string]string) map[string]string

func PostRunPrepareGitopsRepository

func PostRunPrepareGitopsRepository(clusterName string,

	gitopsDir string,

	tokens *GitopsTokenValues,
) error

func PrepareGitRepositories

func PrepareGitRepositories(
	gitProvider string,
	clusterName string,
	clusterType string,
	DestinationGitopsRepoHttpsURL string,
	gitopsDir string,
	gitopsTemplateBranch string,
	gitopsTemplateURL string,
	DestinationMetaphorRepoHttpsURL string,
	k1Dir string,
	gitopsTokens *GitopsTokenValues,
	metaphorDir string,
	metaphorTokens *MetaphorTokenValues,
	gitProtocol string,
) error

should tokens be a *GitopsTokenValues? does it matter

func ResolveMinioLocal

func ResolveMinioLocal(path string) error

ResolveMinioLocal allows resolving minio over a local port forward useful when destroying a local lucster

Types

type GithubTerraformEnvs

type GithubTerraformEnvs struct {
	GithubToken           string
	GithubOwner           string
	AtlantisWebhookSecret string
	KbotSSHPublicKey      string
	AwsAccessKeyId        string
	AwsSecretAccessKey    string
}

type GitopsTokenValues

type GitopsTokenValues struct {
	GithubOwner                   string
	GithubUser                    string
	GitlabOwner                   string
	GitlabOwnerGroupID            int
	GitlabUser                    string
	GitopsRepoGitURL              string
	GitopsRepoHttpsURL            string
	DomainName                    string
	AtlantisAllowList             string
	AlertsEmail                   string
	ClusterName                   string
	ClusterType                   string
	GithubHost                    string
	GitlabHost                    string
	ArgoWorkflowsIngressURL       string
	VaultIngressURL               string
	ArgocdIngressURL              string
	AtlantisIngressURL            string
	MetaphorDevelopmentIngressURL string
	MetaphorStagingIngressURL     string
	MetaphorProductionIngressURL  string
	GitopsRepoURL                 string
	KubefirstVersion              string
	KubefirstTeam                 string
	UseTelemetry                  string
	GitProvider                   string
	CloudProvider                 string
	ClusterId                     string
	KubeconfigPath                string
}

type K3dConfig

type K3dConfig struct {
	GithubToken string
	GitlabToken string

	DestinationGitopsRepoHttpsURL   string
	DestinationGitopsRepoGitURL     string
	DestinationGitopsRepoURL        string
	DestinationMetaphorRepoHttpsURL string
	DestinationMetaphorRepoGitURL   string
	GitopsDir                       string
	GitProvider                     string
	GitProtocol                     string
	K1Dir                           string
	K3dClient                       string
	Kubeconfig                      string
	KubectlClient                   string
	KubefirstConfig                 string
	MetaphorDir                     string
	MkCertClient                    string
	MkCertPemDir                    string
	MkCertSSLSecretDir              string
	TerraformClient                 string
	ToolsDir                        string
}

func GetConfig

func GetConfig(clusterName string, gitProvider string, gitOwner string, gitProtocol string) *K3dConfig

GetConfig - load default values from kubefirst installer

type MetaphorTokenValues

type MetaphorTokenValues struct {
	ClusterName                   string
	CloudRegion                   string
	ContainerRegistryURL          string
	DomainName                    string
	MetaphorDevelopmentIngressURL string
	MetaphorStagingIngressURL     string
	MetaphorProductionIngressURL  string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL