utils

package
v0.15.0-alpha-rc3 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyTerraform

func ApplyTerraform(ctx context.Context, workingDir, terraformExecPath string, credentials aws.Credentials) error

ApplyTerraform just applies the already created terraform files

func BuildCloud

func BuildCloud(kopscluster *kopsapi.Cluster) (_ fi.Cloud, rerr error)

func BuildKarpenterVolumeConfigFromKops

func BuildKarpenterVolumeConfigFromKops(kopsVolume *kopsapi.InstanceRootVolumeSpec) *karpenterv1beta1.BlockDevice

func CleanupTerraformDirectory

func CleanupTerraformDirectory(dir string) error

func CreateAdditionalTerraformFiles

func CreateAdditionalTerraformFiles(tfFiles ...Template) error

CreateAdditionalTerraformFiles create files in the terraform state directory from a template

func CreateEC2NodeClassFromKopsLaunchTemplateInfo

func CreateEC2NodeClassFromKopsLaunchTemplateInfo(kopsCluster *kopsapi.Cluster, kmp *infrastructurev1alpha1.KopsMachinePool, nodePoolName, terraformOutputDir string) (string, error)

func CreateTerraformFilesFromTemplate

func CreateTerraformFilesFromTemplate(terraformTemplateFilePath string, TerraformOutputFileName string, terraformOutputDir string, templateData any) error

CreateTerraformFileFromTemplate populates a Terraform template and create files in the state

func DestroyTerraform

func DestroyTerraform(ctx context.Context, workingDir, terraformExecPath string, credentials aws.Credentials) error

func EnableAutoPublicIPAssignToPublicSubnets

func EnableAutoPublicIPAssignToPublicSubnets(kopsSubnets []kopsapi.ClusterSubnetSpec, clusterName, terraformOutputDir string) error

func EvaluateKopsValidationResult

func EvaluateKopsValidationResult(validation *validation.ValidationCluster) (bool, []string)

func GetAmiNameFromImageSource

func GetAmiNameFromImageSource(image string) (string, error)

func GetBucketName

func GetBucketName(configBase string) (string, error)

func GetKopsClientset

func GetKopsClientset(configBase string) (simple.Clientset, error)

func GetKubeconfigFromKopsState

func GetKubeconfigFromKopsState(ctx context.Context, kopsCluster *kopsapi.Cluster, kopsClientset simple.Clientset) (*rest.Config, error)

func GetUserDataFromTerraformFile

func GetUserDataFromTerraformFile(clusterName, igName, terraformOutputDir string) (string, error)

func KopsClusterValidation

func KopsClusterValidation(object runtime.Object, recorder record.EventRecorder, log logr.Logger, validation *validation.ValidationCluster) bool

func KopsDeleteResources

func KopsDeleteResources(ctx context.Context, cloud fi.Cloud, kopsClientset simple.Clientset, kopsCluster *kopsapi.Cluster) error

func ParseSpotinstFeatureflags

func ParseSpotinstFeatureflags(kopsControlPlane *controlplanev1alpha1.KopsControlPlane) error

func ReconcileKopsSecrets

func ReconcileKopsSecrets(ctx context.Context, k8sClient client.Client, secretStore fi.SecretStore, kopsControlPlane *controlplanev1alpha1.KopsControlPlane, k8sSecretKey client.ObjectKey) error

func ValidateKopsCluster

func ValidateKopsCluster(kubeConfig *rest.Config, kopsCluster *kopsapi.Cluster, cloud fi.Cloud, igs *kopsapi.InstanceGroupList) (*validation.ValidationCluster, error)

Types

type Subnet

type Subnet struct {
	Name        string
	ClusterName string
}

type Template

type Template struct {
	TemplateFilename string
	OutputFilename   string
	EmbeddedFiles    embed.FS
	Data             any
}

Jump to

Keyboard shortcuts

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