clusterspec

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApiProviderKey               = "apiProvider"
	CloudProviderKey             = "cloudProvider"
	NodeTypeKey                  = "nodeType"
	ClusterTypeKey               = "type"
	KubernetesVersionKey         = "kubernetesVersion"
	NodeCountKey                 = "nodeCount"
	MasterNodeCountKey           = "masterNodeCount"
	RegionKey                    = "region"
	PodCidrBlockKey              = "podCidrBlock"
	SshKeyNameKey                = "sshKeyName"
	TagsKey                      = "tags"
	DescriptionKey               = "description"
	ClusterAutoscalerEnabledKey  = "clusterAutoscalerEnabled"
	ClusterAutoscalerMinNodesKey = "clusterAutoscalerMinNodes"
	ClusterAutoscalerMaxNodesKey = "clusterAutoscalerMaxNodes"
)

Variables

View Source
var (
	ValidApiProviders = map[string]bool{
						// contains filtered or unexported fields
	}
	ValidCloudProviders = map[string]bool{
						// contains filtered or unexported fields
	}
	ValidClusterTypesByCloud = map[string]map[string]bool{
								// contains filtered or unexported fields
	}
	KubeconfigSecretKeyNameByApiProvider = map[string]string{
		"capi":   "value",
		"xplane": "kubeconfig",
	}
)
View Source
var (
	ErrInvalidAPIProvider = fmt.Errorf("invalid api provider, the valid values are: %s",
		ValidValues(ValidApiProviders))
	ErrInvalidCloudProvider = fmt.Errorf("invalid cloud provider, the valid values are: %s",
		ValidValues(ValidCloudProviders))
)

Functions

func ClusterAutoscalerSubchartNameFromApiProvider added in v0.9.0

func ClusterAutoscalerSubchartNameFromApiProvider(apiProvider string) string

func ClusterAutoscalerSubchartNameFromClusterSpec

func ClusterAutoscalerSubchartNameFromClusterSpec(cs *ClusterSpec) (string, error)

func Create

func Create(
	kubeClient *kubernetes.Clientset,
	arlonNs string,
	specName string,
	apiProvider string,
	cloudProvider string,
	clusterType string,
	kubernetesVersion string,
	nodeType string,
	nodeCount int,
	masterNodeCount int,
	sshKeyName string,
	region string,
	clusterAutoscalerEnabled bool,
	clusterAutoscalerMinNodes int,
	clusterAutoscalerMaxNodes int,
	desc string,
	tags string,
) error

func Delete

func Delete(
	kubeClient *kubernetes.Clientset,
	ns string,
	clusterspecName string,
) error

func SubchartName

func SubchartName(cm *corev1.ConfigMap) (string, error)

func SubchartNameFromClusterSpec

func SubchartNameFromClusterSpec(cs *ClusterSpec) (string, error)

func ToConfigMap

func ToConfigMap(
	name string,
	apiProvider string,
	cloudProvider string,
	clusterType string,
	kubernetesVersion string,
	nodeType string,
	nodeCount int,
	masterNodeCount int,
	region string,
	podCidrBlock string,
	sshKeyName string,
	clusterAutoscalerEnabled bool,
	clusterAutoscalerMinNodes int,
	clusterAutoscalerMaxNodes int,
	tags string,
	description string,
) *corev1.ConfigMap

func Update

func Update(
	kubeClient *kubernetes.Clientset,
	arlonNs string,
	specName string,
	kubernetesVersion string,
	nodeType string,
	nodeCount int,
	masterNodeCount int,
	clusterAutoscalerEnabledPtr *bool,
	clusterAutoscalerMinNodes int,
	clusterAutoscalerMaxNodes int,
	desc string,
	tags string,
) (dirty bool, err error)

func ValidApiProvider

func ValidApiProvider(apiProvider string) error

func ValidCloudProviderAndClusterType

func ValidCloudProviderAndClusterType(cloudProvider string, clusterType string) error

func ValidValues

func ValidValues(vals map[string]bool) string

func ValidateRegionByProvider added in v0.3.5

func ValidateRegionByProvider(provider string, region string) error

ValidateRegionByProvider checks if a supplied region string is valid or not for the given provider.

Types

type ClusterSpec

type ClusterSpec struct {
	Name                      string
	ApiProvider               string
	CloudProvider             string
	Type                      string
	KubernetesVersion         string
	NodeType                  string
	NodeCount                 int
	MasterNodeCount           int
	Region                    string
	PodCidrBlock              string
	SshKeyName                string
	Tags                      string
	Description               string
	ClusterAutoscalerEnabled  bool
	ClusterAutoscalerMinNodes int
	ClusterAutoscalerMaxNodes int
}

func FromConfigMap

func FromConfigMap(cm *corev1.ConfigMap) (*ClusterSpec, error)

func Get

func Get(
	kubeClient *kubernetes.Clientset,
	arlonNs string,
	specName string,
) (cs *ClusterSpec, err error)

Jump to

Keyboard shortcuts

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