Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertQcow2ToRaw(qcow2 string, raw string) error
- func NewAWSProvisioner(properties map[string]string) (pv.CloudProvisioner, error)
- func NewAwsInstallOverlay(installDir, provider string) (pv.InstallOverlay, error)
- type AMIImage
- type AWSProvisioner
- func (a *AWSProvisioner) CreateCluster(ctx context.Context, cfg *envconf.Config) error
- func (a *AWSProvisioner) CreateVPC(ctx context.Context, cfg *envconf.Config) error
- func (aws *AWSProvisioner) DeleteCluster(ctx context.Context, cfg *envconf.Config) error
- func (a *AWSProvisioner) DeleteVPC(ctx context.Context, cfg *envconf.Config) error
- func (a *AWSProvisioner) GetProperties(ctx context.Context, cfg *envconf.Config) map[string]string
- func (a *AWSProvisioner) UploadPodvm(imagePath string, ctx context.Context, cfg *envconf.Config) error
- type AwsInstallOverlay
- type Cluster
- type EKSCluster
- func (e *EKSCluster) CreateCluster() error
- func (e *EKSCluster) CreateCniAddon(addonTimeout time.Duration) error
- func (e *EKSCluster) CreateEKSClusterRole() (string, error)
- func (e *EKSCluster) CreateEKSNodesRole() (string, error)
- func (e *EKSCluster) DeleteCluster() error
- func (e *EKSCluster) GetKubeconfigFile() (string, error)
- type OnPremCluster
- type S3Bucket
- type Vpc
Constants ¶
const ( EksCniAddonVersion = "v1.12.5-eksbuild.2" EksVersion = "1.26" AwsCredentialsFile = "aws-cred.env" )
Variables ¶
var AWSProps = &AWSProvisioner{}
Functions ¶
func ConvertQcow2ToRaw ¶
ConvertQcow2ToRaw Converts an qcow2 image to raw. Requires `qemu-img` installed.
func NewAWSProvisioner ¶
func NewAWSProvisioner(properties map[string]string) (pv.CloudProvisioner, error)
NewAWSProvisioner instantiates the AWS provisioner
func NewAwsInstallOverlay ¶
func NewAwsInstallOverlay(installDir, provider string) (pv.InstallOverlay, error)
Types ¶
type AMIImage ¶
type AMIImage struct { Client *ec2.Client Description string // Image description DiskDescription string // Disk description DiskFormat string // Disk format EBSSnapshotId string // EBS disk snapshot ID ID string // AMI image ID RootDeviceName string // Root device name }
AMIImage represents an AMI image
type AWSProvisioner ¶
type AWSProvisioner struct { AwsConfig aws.Config Cluster Cluster Disablecvm string Bucket *S3Bucket PauseImage string Image *AMIImage Vpc *Vpc PublicIP string VxlanPort string SshKpName string // contains filtered or unexported fields }
AWSProvisioner implements the CloudProvision interface.
func (*AWSProvisioner) CreateCluster ¶
func (*AWSProvisioner) DeleteCluster ¶
func (*AWSProvisioner) GetProperties ¶
func (*AWSProvisioner) UploadPodvm ¶
type AwsInstallOverlay ¶
type AwsInstallOverlay struct {
Overlay *pv.KustomizeOverlay
}
AwsInstallOverlay implements the InstallOverlay interface
type Cluster ¶
type Cluster interface { CreateCluster() error // Create the Kubernetes cluster DeleteCluster() error // Delete the Kubernetes cluster GetKubeconfigFile() (string, error) // Get the path to the kubeconfig file }
Cluster defines create/delete/access interfaces to Kubernetes clusters
type EKSCluster ¶
type EKSCluster struct { AwsConfig aws.Config Client *eks.Client ClusterRoleName string IamClient *iam.Client Name string NodeGroupName string NodesRoleName string NumWorkers int32 SshKpName string Version string Vpc *Vpc }
EKSCluster represents an EKS cluster
func NewEKSCluster ¶
func NewEKSCluster(cfg aws.Config, vpc *Vpc, SshKpName string) *EKSCluster
NewEKSCluster instantiates a new EKS Cluster struct. It requires a AWS configuration with access and authentication information, a VPC already instantiated and with a public subnet, and an EC2 SSH key-pair used to access the cluster's worker nodes.
func (*EKSCluster) CreateCluster ¶
func (e *EKSCluster) CreateCluster() error
CreateCluster creates a new EKS cluster. It will create needed roles, the cluster itself, nodes group and finally install add-ons. EKS should be created with at least two subnets so a secundary will be created If it does not exist on the VPC already.
func (*EKSCluster) CreateCniAddon ¶
func (e *EKSCluster) CreateCniAddon(addonTimeout time.Duration) error
CreateCniAddon applies the AWS CNI addon
func (*EKSCluster) CreateEKSClusterRole ¶
func (e *EKSCluster) CreateEKSClusterRole() (string, error)
CreateEKSClusterRole creates (if not exist) the needed role for EKS creation.
func (*EKSCluster) CreateEKSNodesRole ¶
func (e *EKSCluster) CreateEKSNodesRole() (string, error)
CreateEKSNodesRole creates (if not exist) the needed role for the managed nodes creation.
func (*EKSCluster) DeleteCluster ¶
func (e *EKSCluster) DeleteCluster() error
func (*EKSCluster) GetKubeconfigFile ¶
func (e *EKSCluster) GetKubeconfigFile() (string, error)
GetKubeconfig returns a kubeconfig for the EKS cluster
type OnPremCluster ¶
type OnPremCluster struct { }
OnPremCluster represents an existing and running cluster
func NewOnPremCluster ¶
func NewOnPremCluster() *OnPremCluster
func (*OnPremCluster) CreateCluster ¶
func (o *OnPremCluster) CreateCluster() error
CreateCluster does nothing as the cluster should exist already.
func (*OnPremCluster) DeleteCluster ¶
func (o *OnPremCluster) DeleteCluster() error
DeleteCluster does nothing.
func (*OnPremCluster) GetKubeconfigFile ¶
func (o *OnPremCluster) GetKubeconfigFile() (string, error)
GetKubeconfigFile looks for the kubeconfig on the default locations