demo

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const A8sSystemName = "a8s Postgres Control Plane"
View Source
const A8sSystemNamespace = "a8s-system"

Variables

View Source
var A8sPGBackup pg.Backup
View Source
var A8sPGRestore pg.Restore
View Source
var A8sPGServiceBinding pg.ServiceBinding
View Source
var A8sPGServiceInstance pg.ServiceInstance
View Source
var BackupInfrastructureBucket string // e.g. a8s-backups
View Source
var BackupInfrastructureProvider string // e.g. AWS

TODO This is a poor man's struct!

View Source
var BackupInfrastructureRegion string // e.g. us-east-1
View Source
var ClusterMemory string
View Source
var ClusterNrOfNodes string
View Source
var DeleteA8sPGInstanceName string
View Source
var DemoClusterName string

TODO Why not merge some of these settings into DemoConfig? TODO Maybe DemoConfig or the entire demo package should be renamed a8s-demo or become less a8s specific

View Source
var DeploymentVersion string // e.g. v0.3.0
View Source
var DoNotApply bool // e.g. yes --> do not execute kubectl apply -f ...
View Source
var KubernetesTool string // e.g. "minikube" or "kind"
View Source
var NoPreCheck bool // e.g. false -> Perform prechecks
View Source
var UnattendedMode bool // Ask yes-no questions or assume "yes"

Functions

func A8sDeploymentExamplesPath

func A8sDeploymentExamplesPath() string

func A8sDeploymentLocalPath

func A8sDeploymentLocalPath() string

func ApplyA8sManifests

func ApplyA8sManifests()

Applies the manifests of the a8s-deployment repository and thus installs a8s PG.

func BackupConfigAccessKeyIdFilePath

func BackupConfigAccessKeyIdFilePath() string

func BackupConfigBasePath

func BackupConfigBasePath() string

func BackupConfigEncryptionPasswordFilePath

func BackupConfigEncryptionPasswordFilePath() string

func BackupConfigSecretAccessKeyFilePath

func BackupConfigSecretAccessKeyFilePath() string

func BuildKubernetesClusterManager

func BuildKubernetesClusterManager() k8s.ClusterManager

Builds a cluster manager without params by using shared package variables.

func BuildKubernetesClusterSpec

func BuildKubernetesClusterSpec() creator.KubernetesClusterSpec

func CheckCommandAvailability

func CheckCommandAvailability()

func CheckIfFileExists

func CheckIfFileExists(filePath string) bool

func CheckPrerequisites

func CheckPrerequisites(createClusterIfNotExists bool)

func CheckoutDemoAppGitRepository

func CheckoutDemoAppGitRepository()

func CheckoutDeploymentGitRepository

func CheckoutDeploymentGitRepository()

func CheckoutGitRepository

func CheckoutGitRepository(repositoryURL, localDirectory string, tag string) error

func CountPodsInDemoNamespace

func CountPodsInDemoNamespace() int

func CreatePGServiceBinding

func CreatePGServiceBinding()

func CreatePGServiceInstance

func CreatePGServiceInstance()

TODO Move to pg package

func CreatePGServiceInstanceBackup

func CreatePGServiceInstanceBackup()

TODO Move to pg package

func CreatePGServiceInstanceRestore

func CreatePGServiceInstanceRestore()

TODO Reduce code duplicity with CreatePGServiceInstanceBackup

func DeletePGServiceBinding

func DeletePGServiceBinding()

func DeletePGServiceInstance

func DeletePGServiceInstance(namespace, serviceInstanceName string)

TODO Move to pg package Refactor to DRY with Create ... > CRUDPGServiceInstance

func EnsureConfigIsLoaded

func EnsureConfigIsLoaded()

Execute this at the beginning of every command that requires a config to be present.

func EstablishAccessKeyId

func EstablishAccessKeyId()

Checks if there's an access key id file. If not it prompts to read the access key id from STDIN. Skips if the access key id file is already present

func EstablishBackupStoreCredentials

func EstablishBackupStoreCredentials()

func EstablishConfig

func EstablishConfig()

func EstablishConfigFilePath

func EstablishConfigFilePath()

func EstablishEncryptionPasswordFile

func EstablishEncryptionPasswordFile()

Generates an encryption password file for backups if it doesnt exist. Does nothing if the file already exists.

func EstablishWorkingDir

func EstablishWorkingDir()

func GetUserManifestPath

func GetUserManifestPath(filename string) string

Returns a filepath located in the user manifests path.

func IsCommandAvailable

func IsCommandAvailable(cmdName string) bool

func LoadConfig

func LoadConfig() bool

func PrintDemoSummary

func PrintDemoSummary()

func ReadStringFromFileOrConsole

func ReadStringFromFileOrConsole(filePath, contentType string, showContent bool)

Checks if there's a file. If not it prompts to read the file content from STDIN. Skips if the file is already present

func RequiredCommands

func RequiredCommands() map[string]map[string]string

func UserManifestsPath

func UserManifestsPath() string

func WaitForA8sSystemToBecomeReady

func WaitForA8sSystemToBecomeReady()

func WaitForServiceInstanceToBecomeReady

func WaitForServiceInstanceToBecomeReady(namespace, serviceInstanceName string, nrOfInstances int)

func WriteYAMLToFile

func WriteYAMLToFile(instanceYAML string, manifestPath string)

Writes the provided YAML string to a YAML file at the given path.

Types

type BlobStore

type BlobStore struct {
	Config BlobStoreConfig `yaml:"config"`
}

type BlobStoreCloudConfiguration

type BlobStoreCloudConfiguration struct {
	Provider  string `yaml:"provider"`
	Container string `yaml:"container"`
	Region    string `yaml:"region"`
}

type BlobStoreConfig

type BlobStoreConfig struct {
	CloudConfig BlobStoreCloudConfiguration `yaml:"cloud_configuration"`
}

type Config

type Config struct {
	WorkingDir string `yaml:"WorkingDir"`
	DemoSpace  string `yaml:"DemoSpace"`
}
var DemoConfig Config

func GetConfig

func GetConfig() Config

Jump to

Keyboard shortcuts

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