civo

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 29 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.

Index

Constants

View Source
const (
	CloudProvider          = "civo"
	GithubHost             = "github.com"
	GitlabHost             = "gitlab.com"
	KubectlClientVersion   = "v1.25.7"
	LocalhostOS            = runtime.GOOS
	LocalhostArch          = runtime.GOARCH
	TerraformClientVersion = "1.3.8"
	ArgocdHelmChartVersion = "4.10.5"

	ArgocdPortForwardURL = pkg.ArgocdPortForwardURL
	VaultPortForwardURL  = pkg.VaultPortForwardURL
)

Variables

This section is empty.

Functions

func AdjustGitopsRepo

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

func AdjustMetaphorRepo

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

func BootstrapCivoMgmtCluster

func BootstrapCivoMgmtCluster(kubeconfigPath string, gitProvider string, gitUser string) error

func CreateStorageBucket

func CreateStorageBucket(accessKeyId, bucketName, region string) (civogo.ObjectStore, error)

func DeleteAccessCredentials

func DeleteAccessCredentials(credentialName, region string) error

func DetokenizeAdditionalPath

func DetokenizeAdditionalPath(path string, tokens *GitOpsDirectoryValues) error

DetokenizeCivoAdditionalPath - Translate tokens by values on a given path

func DetokenizeGitGitops

func DetokenizeGitGitops(path string, tokens *GitOpsDirectoryValues) error

DetokenizeGitGitops - Translate tokens by values on a given path

func DetokenizeGitMetaphor

func DetokenizeGitMetaphor(path string, tokens *MetaphorTokenValues) error

DetokenizeGithubMetaphor - Translate tokens by values on a given path

func DownloadTools

func DownloadTools(kubectlClientPath, kubectlClientVersion, localOs, localArchitecture, terraformClientVersion, toolsDirPath string) error

func GetAccessCredentials

func GetAccessCredentials(credentialName, region string) (civogo.ObjectStoreCredential, error)

todo refactor or remove this internal library and use the native client. functionality. see next todo client.

func GetCivoTerraformEnvs

func GetCivoTerraformEnvs(envs map[string]string) map[string]string

func GetDNSInfo

func GetDNSInfo(domainName, region string) (string, error)

GetDNSInfo try to reach the provided domain

func GetDomainApexContent

func GetDomainApexContent(domainName string) bool

GetDomainApexContent determines whether or not a target domain features a host responding at zone apex

func GetGithubTerraformEnvs

func GetGithubTerraformEnvs(envs map[string]string) map[string]string

func GetGitlabTerraformEnvs

func GetGitlabTerraformEnvs(envs map[string]string, gid int) map[string]string

func GetUsersTerraformEnvs

func GetUsersTerraformEnvs(clientset *kubernetes.Clientset, config *CivoConfig, envs map[string]string) map[string]string

func GetVaultTerraformEnvs

func GetVaultTerraformEnvs(clientset *kubernetes.Clientset, config *CivoConfig, envs map[string]string) map[string]string

func PrepareGitRepositories

func PrepareGitRepositories(
	gitProvider string,
	clusterName string,
	clusterType string,
	destinationGitopsRepoGitURL string,
	gitopsDir string,
	gitopsTemplateBranch string,
	gitopsTemplateURL string,
	destinationMetaphorRepoGitURL string,
	k1Dir string,
	gitopsTokens *GitOpsDirectoryValues,
	metaphorDir string,
	metaphorTokens *MetaphorTokenValues,
	apexContentExists bool,
) error

func TestDomainLiveness

func TestDomainLiveness(domainName string, domainId string, region string) bool

TestDomainLiveness checks Civo DNS for the liveness test record

Types

type CivoConfig

type CivoConfig struct {
	CivoToken   string `env:"CIVO_TOKEN"`
	GithubToken string `env:"GITHUB_TOKEN"`
	GitlabToken string `env:"GITLAB_TOKEN"`

	ArgoWorkflowsDir                string
	DestinationGitopsRepoHttpsURL   string
	DestinationGitopsRepoGitURL     string
	DestinationMetaphorRepoHttpsURL string
	DestinationMetaphorRepoGitURL   string
	GitopsDir                       string
	GitProvider                     string
	K1Dir                           string
	Kubeconfig                      string
	KubectlClient                   string
	KubefirstBotSSHPrivateKey       string
	KubefirstConfig                 string
	LogsDir                         string
	MetaphorDir                     string
	RegistryAppName                 string
	RegistryYaml                    string
	SSLBackupDir                    string
	TerraformClient                 string
	ToolsDir                        string
}

func GetConfig

func GetConfig(clusterName string, domainName string, gitProvider string, gitOwner string) *CivoConfig

GetConfig - load default values from kubefirst installer

type GitOpsDirectoryValues

type GitOpsDirectoryValues struct {
	AlertsEmail               string
	AtlantisAllowList         string
	CloudProvider             string
	CloudRegion               string
	ClusterId                 string
	ClusterName               string
	ClusterType               string
	DomainName                string
	KubeconfigPath            string
	KubefirstStateStoreBucket string
	KubefirstTeam             string
	KubefirstVersion          string

	ArgoCDIngressURL               string
	ArgoCDIngressNoHTTPSURL        string
	ArgoWorkflowsIngressURL        string
	ArgoWorkflowsIngressNoHTTPSURL string
	ArgoWorkflowsDir               string
	AtlantisIngressURL             string
	AtlantisIngressNoHTTPSURL      string
	ChartMuseumIngressURL          string
	VaultIngressURL                string
	VaultIngressNoHTTPSURL         string
	VouchIngressURL                string

	GitDescription       string
	GitNamespace         string
	GitProvider          string
	GitRunner            string
	GitRunnerDescription string
	GitRunnerNS          string
	GitURL               string

	GitHubHost  string
	GitHubOwner string
	GitHubUser  string

	GitlabHost         string
	GitlabOwner        string
	GitlabOwnerGroupID int
	GitlabUser         string

	GitOpsRepoAtlantisWebhookURL string
	GitOpsRepoGitURL             string
	GitOpsRepoNoHTTPSURL         string

	UseTelemetry string
}

type MetaphorTokenValues

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

Jump to

Keyboard shortcuts

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