config

package
v0.0.0-...-2e1daa9 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGKECluster

func CreateGKECluster(gcpConfig *GcpConfig) error

CreateGKECluster creates the GKE cluster

func DeleteGKECluster

func DeleteGKECluster(gcpConfig *GcpConfig) error

DeleteGKECluster deletes the GKE cluster

func GetVolumeMountPoints

func GetVolumeMountPoints(volumeMount string) (string, string)

GetVolumeMountPoints extracts the source and destination of a volume mount

func HelpGKECluster

func HelpGKECluster() error

HelpGKECluster returns the help.txt for the GKE cluster

func ReadYAMLFile

func ReadYAMLFile(filePath string, cfg *GcpConfig) error

ReadYAMLFile reads YAML-formatted configuration file and de-serializes it to a given object

func ValidateConfigFile

func ValidateConfigFile(config *GcpConfig) error

ValidateConfigFile validates GCP configuration file for the Ephemeral Cluster

Types

type Cluster

type Cluster struct {
	// Kubernetes version to deploy
	K8SVersion string `yaml:"k8sVersion,omitempty"`

	// Google Cloud Compote VM size to use for the cluster
	MachineSize string `yaml:"machineSize,omitempty"`

	// Google Cloud Compote disk size to use for the cluster
	DiskSize uint8 `yaml:"diskSize,omitempty" validate:"gte=1"`

	// Number of nodes to deploy for the cluster
	Replicas uint8 `yaml:"replicas,omitempty" validate:"gte=1,lte=100"`

	// Kubeconfig filename to save
	Kubeconfig string `yaml:"kubeconfig,omitempty"`
}

Cluster struct provides data for the k8s cluster to deploy

type Credentials

type Credentials struct {
	Project    string `yaml:"project" validate:"required"`
	Account    string `yaml:"account" validate:"required"`
	Credential string `yaml:"credential" validate:"required"`
}

Credentials structu provides the credentials to authenticate with Azure Cloud

type GcpConfig

type GcpConfig struct {
	// +optional
	Kind string `yaml:"kind" validate:"required"`

	// +optional
	APIVersion string `yaml:"apiVersion" validate:"required"`

	// Configuration parameters for metadata
	Metadata *Metadata `yaml:"metadata" validate:"required"`

	// Configuration parameters for metadata
	Credentials *Credentials `yaml:"credentials" validate:"required"`

	// Configuration parameters for spec
	Spec *Spec `yaml:"spec"`
}

GcpConfig holds configurations for bootstrap steps

type Metadata

type Metadata struct {
	Name   string   `yaml:"name" validate:"required"`
	Labels []string `yaml:"labels,omitempty"`
}

Metadata structure provides the cluster name to assign and labels to the k8s cluster

type Spec

type Spec struct {
	Region  string  `yaml:"region,omitempty"`
	Zone    string  `yaml:"zone,omitempty"`
	Cluster Cluster `yaml:"cluster"`
}

Spec structure contains the info for the ck8s luster to deploy

Jump to

Keyboard shortcuts

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