clusterspec

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: Apache-2.0 Imports: 7 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{
		"capi":   true,
		"xplane": true,
	}
	ValidCloudProviders = map[string]bool{
		"aws":   true,
		"gcp":   true,
		"azure": true,
	}
	ValidClusterTypesByCloud = map[string]map[string]bool{
		"aws":   {"kubeadm": true, "eks": true},
		"gcp":   {"kubeadm": true, "gke": true},
		"azure": {"kubeadm": true, "aks": true},
	}
	KubeconfigSecretKeyNameByApiProvider = map[string]string{
		"capi":   "value",
		"xplane": "kubeconfig",
	}
)

Functions

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,
	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

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