clusterapi

package
v1.4.17 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddServiceAccountRoles

func AddServiceAccountRoles(ctx context.Context, projectID, serviceAccountID string, roles []string) error

AddServiceAccountRoles adds predefined roles for service account.

func CreateServiceAccount

func CreateServiceAccount(ctx context.Context, infraID, projectID, role string) (string, error)

CreateServiceAccount is used to create a service account for a compute instance.

func EditIgnition

func EditIgnition(ctx context.Context, in clusterapi.IgnitionInput) ([]byte, error)

EditIgnition attempts to edit the contents of the bootstrap ignition when the user has selected a custom DNS configuration. Find the public and private load balancer addresses and fill in the infrastructure file within the ignition struct.

func GetMasterRoles

func GetMasterRoles() []string

GetMasterRoles returns the pre-defined roles for a master node. Roles are described here https://cloud.google.com/iam/docs/understanding-roles#predefined_roles.

func GetWorkerRoles

func GetWorkerRoles() []string

GetWorkerRoles returns the pre-defined roles for a worker node.

func NewComputeService

func NewComputeService() (*compute.Service, error)

NewComputeService wraps the creation of a gcp compute service creation.

func WaitForOperationGlobal

func WaitForOperationGlobal(ctx context.Context, projectID string, operation *compute.Operation) error

WaitForOperationGlobal will attempt to wait for a operation to complete where the operational resource is globally scoped.

func WaitForOperationRegional

func WaitForOperationRegional(ctx context.Context, projectID, region string, operation *compute.Operation) error

WaitForOperationRegional will attempt to wait for a operation to complete where the operational resource is regionally scoped.

Types

type Provider

type Provider struct {
}

Provider implements gcp infrastructure in conjunction with the GCP CAPI provider.

func (Provider) DestroyBootstrap

func (p Provider) DestroyBootstrap(ctx context.Context, in clusterapi.BootstrapDestroyInput) error

DestroyBootstrap destroys the temporary bootstrap resources.

func (Provider) Ignition

func (p Provider) Ignition(ctx context.Context, in clusterapi.IgnitionInput) ([]byte, error)

Ignition provisions the GCP bucket and url that points to the bucket. Bootstrap ignition data cannot populate the metadata field of the bootstrap instance as the data can be too large. Instead, the data is added to a bucket. A signed url is generated to point to the bucket and the ignition data will be updated to point to the url. This is also allows for bootstrap data to be edited after its initial creation.

func (Provider) InfraReady

func (p Provider) InfraReady(ctx context.Context, in clusterapi.InfraReadyInput) error

InfraReady is called once cluster.Status.InfrastructureReady is true, typically after load balancers have been provisioned. It can be used to create DNS records.

func (Provider) Name

func (p Provider) Name() string

Name returns the name for the platform.

func (Provider) PostProvision

func (p Provider) PostProvision(ctx context.Context, in clusterapi.PostProvisionInput) error

PostProvision should be called to add or update and GCP resources after provisioning has completed.

func (Provider) PreProvision

func (p Provider) PreProvision(ctx context.Context, in clusterapi.PreProvisionInput) error

PreProvision is called before provisioning using CAPI controllers has initiated. GCP resources that are not created by CAPG (and are required for other stages of the install) are created here using the gcp sdk.

func (Provider) PublicGatherEndpoint added in v0.90.17

func (Provider) PublicGatherEndpoint() clusterapi.GatherEndpoint

PublicGatherEndpoint indicates that machine ready checks should wait for an ExternalIP in the status and use that when gathering bootstrap log bundles.

Jump to

Keyboard shortcuts

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