utils

package
v0.0.0-...-318058a Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureInstanceProfile

func EnsureInstanceProfile(svc *iam.IAM, instanceProfileName string, roleName string) error

func EnsureRole

func EnsureRole(svc *iam.IAM, roleName string) error

func FetchConfigureScript

func FetchConfigureScript(userDataFile string, replace func(string) string) (string, error)

func FetchKubeadmInitYaml

func FetchKubeadmInitYaml(kubeadmInitFile string, replace func(string) string) (string, error)

func FetchKubeadmJoinYaml

func FetchKubeadmJoinYaml(kubeadmJoinFile string, replace func(string) string) (string, error)

func FetchRunKubeadmSH

func FetchRunKubeadmSH(replace func(string) string) (string, error)

func FetchRunPostInstallSH

func FetchRunPostInstallSH(replace func(string) string) (string, error)

func GetInstanceProfileArn

func GetInstanceProfileArn(svc *iam.IAM, instanceProfileName string) (string, error)

func GetSSMImage

func GetSSMImage(ssmService *ssm.SSM, path string) (string, error)

func LaunchNewInstance

func LaunchNewInstance(ec2Service *ec2.EC2, iamService *iam.IAM,
	clusterID string, controlPlaneIP string, img InternalAWSImage) (*ec2.Instance, error)

func RandomFixedLengthString

func RandomFixedLengthString(length int) string

func RandomHexEncodedBytes

func RandomHexEncodedBytes(n int) string

func SourceVersion

func SourceVersion(kubeRoot string) (string, error)

SourceVersion the kubernetes git version based on hack/print-workspace-status.sh the raw version is also returned

func ValidateS3Bucket

func ValidateS3Bucket(s3Service *s3.S3, stageLocation string, stageVersion string, version string) error

func WaitForInstanceToRun

func WaitForInstanceToRun(ec2Service *ec2.EC2, instance *ec2.Instance) *ec2.Instance

Types

type InternalAWSImage

type InternalAWSImage struct {
	AmiID string
	// The instance type (e.g. t3a.medium)
	InstanceType string
	UserData     string
	ImageDesc    string
	// name of the instance profile
	InstanceProfile string
}

type TemporarySSHKey

type TemporarySSHKey struct {
	Public  []byte
	Private []byte
	Signer  ssh.Signer
}

func GenerateSSHKeypair

func GenerateSSHKeypair() (*TemporarySSHKey, error)

Jump to

Keyboard shortcuts

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