scope

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Overview

Package scope implements scope types.

Index

Constants

View Source
const (
	// APIServerPort is the port of the GKE api server.
	APIServerPort = 443
)
View Source
const (
	// ConfigFileEnvVar is the name of the environment variable
	// that contains the path to the credentials file.
	ConfigFileEnvVar = "GOOGLE_APPLICATION_CREDENTIALS"
)

Variables

View Source
var (
	// ErrEmptyProviderID means that the provider id is empty.
	//
	// Deprecated: This var is going to be removed in a future release.
	ErrEmptyProviderID = errors.New("providerID is empty")

	// ErrInvalidProviderID means that the provider id has an invalid form.
	//
	// Deprecated: This var is going to be removed in a future release.
	ErrInvalidProviderID = errors.New("providerID must be of the form <cloudProvider>://<optional>/<segments>/<provider id>")
)

Copied from https://github.com/kubernetes-sigs/cluster-api/blob/bda002f52575eeaff68da1ba33c8ef27d5b1014c/controllers/noderefutil/providerid.go As this is removed by https://github.com/kubernetes-sigs/cluster-api/pull/9136

Functions

func ConvertToSdkNodePool added in v1.3.0

func ConvertToSdkNodePool(nodePool infrav1exp.GCPManagedMachinePool, machinePool clusterv1exp.MachinePool, regional bool, clusterName string) *containerpb.NodePool

ConvertToSdkNodePool converts a node pool to format that is used by GCP SDK.

func ConvertToSdkNodePools added in v1.3.0

func ConvertToSdkNodePools(nodePools []infrav1exp.GCPManagedMachinePool, machinePools []clusterv1exp.MachinePool, regional bool, clusterName string) []*containerpb.NodePool

ConvertToSdkNodePools converts node pools to format that is used by GCP SDK.

func NodePoolResourceLabels added in v1.6.0

func NodePoolResourceLabels(additionalLabels infrav1.Labels, clusterName string) infrav1.Labels

NodePoolResourceLabels returns the resource labels of the node pool.

Types

type ClusterScope

type ClusterScope struct {
	Cluster    *clusterv1.Cluster
	GCPCluster *infrav1.GCPCluster
	GCPServices
	// contains filtered or unexported fields
}

ClusterScope defines the basic context for an actuator to operate upon.

func NewClusterScope

func NewClusterScope(ctx context.Context, params ClusterScopeParams) (*ClusterScope, error)

NewClusterScope creates a new Scope from the supplied parameters. This is meant to be called for each reconcile iteration.

func (*ClusterScope) AdditionalLabels added in v0.4.0

func (s *ClusterScope) AdditionalLabels() infrav1.Labels

AdditionalLabels returns the cluster additional labels.

func (*ClusterScope) AddressSpec added in v0.4.0

func (s *ClusterScope) AddressSpec(lbname string) *compute.Address

AddressSpec returns google compute address spec.

func (*ClusterScope) BackendServiceSpec added in v0.4.0

func (s *ClusterScope) BackendServiceSpec(lbname string) *compute.BackendService

BackendServiceSpec returns google compute backend-service spec.

func (*ClusterScope) Close

func (s *ClusterScope) Close() error

Close closes the current scope persisting the cluster configuration and status.

func (*ClusterScope) Cloud added in v0.4.0

func (s *ClusterScope) Cloud() cloud.Cloud

Cloud returns initialized cloud.

func (*ClusterScope) ControlPlaneEndpoint added in v0.4.0

func (s *ClusterScope) ControlPlaneEndpoint() clusterv1.APIEndpoint

ControlPlaneEndpoint returns the cluster control-plane endpoint.

func (*ClusterScope) FailureDomains added in v0.4.0

func (s *ClusterScope) FailureDomains() clusterv1.FailureDomains

FailureDomains returns the cluster failure domains.

func (*ClusterScope) FirewallRulesSpec added in v0.4.0

func (s *ClusterScope) FirewallRulesSpec() []*compute.Firewall

FirewallRulesSpec returns google compute firewall spec.

func (*ClusterScope) ForwardingRuleSpec added in v0.4.0

func (s *ClusterScope) ForwardingRuleSpec(lbname string) *compute.ForwardingRule

ForwardingRuleSpec returns google compute forwarding-rule spec.

func (*ClusterScope) HealthCheckSpec added in v0.4.0

func (s *ClusterScope) HealthCheckSpec(lbname string) *compute.HealthCheck

HealthCheckSpec returns google compute health-check spec.

func (*ClusterScope) InstanceGroupSpec added in v0.4.0

func (s *ClusterScope) InstanceGroupSpec(zone string) *compute.InstanceGroup

InstanceGroupSpec returns google compute instance-group spec.

func (*ClusterScope) IsSharedVpc added in v1.7.0

func (s *ClusterScope) IsSharedVpc() bool

IsSharedVpc returns true If sharedVPC used else , returns false.

func (*ClusterScope) LoadBalancer added in v1.7.0

func (s *ClusterScope) LoadBalancer() infrav1.LoadBalancerSpec

LoadBalancer returns the LoadBalancer configuration.

func (*ClusterScope) Name

func (s *ClusterScope) Name() string

Name returns the cluster name.

func (*ClusterScope) Namespace

func (s *ClusterScope) Namespace() string

Namespace returns the cluster namespace.

func (*ClusterScope) NatRouterSpec added in v0.4.0

func (s *ClusterScope) NatRouterSpec() *compute.Router

NatRouterSpec returns google compute nat router spec.

func (*ClusterScope) Network

func (s *ClusterScope) Network() *infrav1.Network

Network returns the cluster network object.

func (*ClusterScope) NetworkCloud added in v1.7.0

func (s *ClusterScope) NetworkCloud() cloud.Cloud

NetworkCloud returns initialized cloud.

func (s *ClusterScope) NetworkLink() string

NetworkLink returns the partial URL for the network.

func (*ClusterScope) NetworkMtu added in v1.8.0

func (s *ClusterScope) NetworkMtu() int64

NetworkMtu returns the Network MTU of 1440 which is the default, otherwise returns back what is being set. Mtu: Maximum Transmission Unit in bytes. The minimum value for this field is 1300 and the maximum value is 8896. The suggested value is 1500, which is the default MTU used on the Internet, or 8896 if you want to use Jumbo frames. If unspecified, the value defaults to 1460. More info - https://pkg.go.dev/google.golang.org/api/compute/v1#Network - https://cloud.google.com/vpc/docs/mtu

func (*ClusterScope) NetworkName

func (s *ClusterScope) NetworkName() string

NetworkName returns the cluster network unique identifier.

func (*ClusterScope) NetworkProject added in v1.7.0

func (s *ClusterScope) NetworkProject() string

NetworkProject returns the project name where network resources should exist. The network project defaults to the Project when one is not supplied.

func (*ClusterScope) NetworkSpec added in v0.4.0

func (s *ClusterScope) NetworkSpec() *compute.Network

NetworkSpec returns google compute network spec.

func (*ClusterScope) PatchObject

func (s *ClusterScope) PatchObject() error

PatchObject persists the cluster configuration and status.

func (*ClusterScope) Project

func (s *ClusterScope) Project() string

Project returns the current project name.

func (*ClusterScope) Region

func (s *ClusterScope) Region() string

Region returns the cluster region.

func (*ClusterScope) ResourceManagerTags added in v1.6.0

func (s *ClusterScope) ResourceManagerTags() infrav1.ResourceManagerTags

ResourceManagerTags returns ResourceManagerTags from the scope's GCPCluster. The returned value will never be nil.

func (*ClusterScope) SetControlPlaneEndpoint added in v0.4.0

func (s *ClusterScope) SetControlPlaneEndpoint(endpoint clusterv1.APIEndpoint)

SetControlPlaneEndpoint sets cluster control-plane endpoint.

func (*ClusterScope) SetFailureDomains added in v0.4.0

func (s *ClusterScope) SetFailureDomains(fd clusterv1.FailureDomains)

SetFailureDomains sets cluster failure domains.

func (*ClusterScope) SetReady added in v0.4.0

func (s *ClusterScope) SetReady()

SetReady sets cluster ready status.

func (*ClusterScope) SubnetSpecs added in v1.2.0

func (s *ClusterScope) SubnetSpecs() []*compute.Subnetwork

SubnetSpecs returns google compute subnets spec.

func (*ClusterScope) TargetTCPProxySpec added in v0.4.0

func (s *ClusterScope) TargetTCPProxySpec() *compute.TargetTcpProxy

TargetTCPProxySpec returns google compute target-tcp-proxy spec.

type ClusterScopeGetter

type ClusterScopeGetter interface {
	ClusterScope(params ClusterScopeParams) (*ClusterScope, error)
}

ClusterScopeGetter is a Service which knows how to retrieve the scope for a cluster.

type ClusterScopeGetterFunc

type ClusterScopeGetterFunc func(params ClusterScopeParams) (*ClusterScope, error)

ClusterScopeGetterFunc ...

func (ClusterScopeGetterFunc) ClusterScope

func (f ClusterScopeGetterFunc) ClusterScope(params ClusterScopeParams) (*ClusterScope, error)

ClusterScope returns the cluster scope.

type ClusterScopeParams

type ClusterScopeParams struct {
	GCPServices
	Client     client.Client
	Cluster    *clusterv1.Cluster
	GCPCluster *infrav1.GCPCluster
}

ClusterScopeParams defines the input parameters used to create a new Scope.

type Credential added in v1.3.0

type Credential struct {
	Type        string `json:"type"`
	ProjectID   string `json:"project_id"`
	ClientEmail string `json:"client_email"`
	ClientID    string `json:"client_id"`
}

Credential is a struct to hold GCP credential data.

type GCPRateLimiter added in v0.4.0

type GCPRateLimiter struct{}

GCPRateLimiter implements cloud.RateLimiter.

func (*GCPRateLimiter) Accept added in v0.4.0

func (rl *GCPRateLimiter) Accept(ctx context.Context, key *cloud.RateLimitKey) error

Accept blocks until the operation can be performed.

func (*GCPRateLimiter) Observe added in v1.3.0

Observe does nothing.

type GCPServices added in v0.4.0

type GCPServices struct {
	Compute *compute.Service
}

GCPServices contains all the gcp services used by the scopes.

type MachineScope

type MachineScope struct {
	ClusterGetter cloud.ClusterGetter
	Machine       *clusterv1.Machine
	GCPMachine    *infrav1.GCPMachine
	// contains filtered or unexported fields
}

MachineScope defines a scope defined around a machine and its cluster.

func NewMachineScope

func NewMachineScope(params MachineScopeParams) (*MachineScope, error)

NewMachineScope creates a new MachineScope from the supplied parameters. This is meant to be called for each reconcile iteration.

func (*MachineScope) Close

func (m *MachineScope) Close() error

Close closes the current scope persisting the cluster configuration and status.

func (*MachineScope) Cloud added in v0.4.0

func (m *MachineScope) Cloud() cloud.Cloud

Cloud returns initialized cloud.

func (*MachineScope) ControlPlaneGroupName added in v0.4.0

func (m *MachineScope) ControlPlaneGroupName() string

ControlPlaneGroupName returns the control-plane instance group name.

func (*MachineScope) GetBootstrapData

func (m *MachineScope) GetBootstrapData() (string, error)

GetBootstrapData returns the bootstrap data from the secret in the Machine's bootstrap.dataSecretName.

func (*MachineScope) GetInstanceID

func (m *MachineScope) GetInstanceID() *string

GetInstanceID returns the GCPMachine instance id by parsing Spec.ProviderID.

func (*MachineScope) GetInstanceStatus

func (m *MachineScope) GetInstanceStatus() *infrav1.InstanceStatus

GetInstanceStatus returns the GCPMachine instance status.

func (*MachineScope) GetProviderID

func (m *MachineScope) GetProviderID() string

GetProviderID returns the GCPMachine providerID from the spec.

func (*MachineScope) InstanceAdditionalDiskSpec added in v0.4.0

func (m *MachineScope) InstanceAdditionalDiskSpec() []*compute.AttachedDisk

InstanceAdditionalDiskSpec returns compute instance additional attched-disk spec.

func (*MachineScope) InstanceAdditionalMetadataSpec added in v0.4.0

func (m *MachineScope) InstanceAdditionalMetadataSpec() *compute.Metadata

InstanceAdditionalMetadataSpec returns additional metadata spec.

func (*MachineScope) InstanceImageSpec added in v0.4.0

func (m *MachineScope) InstanceImageSpec() *compute.AttachedDisk

InstanceImageSpec returns compute instance image attched-disk spec.

func (*MachineScope) InstanceNetworkInterfaceSpec added in v0.4.0

func (m *MachineScope) InstanceNetworkInterfaceSpec() *compute.NetworkInterface

InstanceNetworkInterfaceSpec returns compute network interface spec.

func (*MachineScope) InstanceServiceAccountsSpec added in v0.4.0

func (m *MachineScope) InstanceServiceAccountsSpec() *compute.ServiceAccount

InstanceServiceAccountsSpec returns service-account spec.

func (*MachineScope) InstanceSpec added in v0.4.0

func (m *MachineScope) InstanceSpec(log logr.Logger) *compute.Instance

InstanceSpec returns instance spec.

func (*MachineScope) IsControlPlane

func (m *MachineScope) IsControlPlane() bool

IsControlPlane returns true if the machine is a control plane.

func (*MachineScope) Name

func (m *MachineScope) Name() string

Name returns the GCPMachine name.

func (*MachineScope) Namespace

func (m *MachineScope) Namespace() string

Namespace returns the namespace name.

func (*MachineScope) NetworkCloud added in v1.7.0

func (m *MachineScope) NetworkCloud() cloud.Cloud

NetworkCloud returns initialized network cloud.

func (*MachineScope) PatchObject

func (m *MachineScope) PatchObject() error

PatchObject persists the cluster configuration and status.

func (*MachineScope) Project added in v1.1.0

func (m *MachineScope) Project() string

Project return the project for the GCPMachine's cluster.

func (*MachineScope) ResourceManagerTags added in v1.6.0

func (m *MachineScope) ResourceManagerTags() infrav1.ResourceManagerTags

ResourceManagerTags merges ResourceManagerTags from the scope's GCPCluster and GCPMachine. If the same key is present in both, the value from GCPMachine takes precedence. The returned ResourceManagerTags will never be nil.

func (*MachineScope) Role

func (m *MachineScope) Role() string

Role returns the machine role from the labels.

func (*MachineScope) SetAddresses

func (m *MachineScope) SetAddresses(addressList []corev1.NodeAddress)

SetAddresses sets the addresses field on the GCPMachine.

func (*MachineScope) SetAnnotation

func (m *MachineScope) SetAnnotation(key, value string)

SetAnnotation sets a key value annotation on the GCPMachine.

func (*MachineScope) SetFailureMessage

func (m *MachineScope) SetFailureMessage(v error)

SetFailureMessage sets the GCPMachine status failure message.

func (*MachineScope) SetFailureReason

func (m *MachineScope) SetFailureReason(v capierrors.MachineStatusError)

SetFailureReason sets the GCPMachine status failure reason.

func (*MachineScope) SetInstanceStatus

func (m *MachineScope) SetInstanceStatus(v infrav1.InstanceStatus)

SetInstanceStatus sets the GCPMachine instance status.

func (*MachineScope) SetProviderID

func (m *MachineScope) SetProviderID()

SetProviderID sets the GCPMachine providerID in spec.

func (*MachineScope) SetReady

func (m *MachineScope) SetReady()

SetReady sets the GCPMachine Ready Status.

func (*MachineScope) Zone

func (m *MachineScope) Zone() string

Zone returns the FailureDomain for the GCPMachine.

type MachineScopeGetter

type MachineScopeGetter interface {
	MachineScope(params MachineScopeParams) (*MachineScope, error)
}

MachineScopeGetter ...

type MachineScopeGetterFunc

type MachineScopeGetterFunc func(params MachineScopeParams) (*MachineScope, error)

MachineScopeGetterFunc ...

func (MachineScopeGetterFunc) MachineScope

func (f MachineScopeGetterFunc) MachineScope(params MachineScopeParams) (*MachineScope, error)

MachineScope returns the machine scope.

type MachineScopeParams

type MachineScopeParams struct {
	Client        client.Client
	ClusterGetter cloud.ClusterGetter
	Machine       *clusterv1.Machine
	GCPMachine    *infrav1.GCPMachine
}

MachineScopeParams defines the input parameters used to create a new MachineScope.

type ManagedClusterScope added in v1.3.0

type ManagedClusterScope struct {
	Cluster                *clusterv1.Cluster
	GCPManagedCluster      *infrav1exp.GCPManagedCluster
	GCPManagedControlPlane *infrav1exp.GCPManagedControlPlane
	GCPServices
	// contains filtered or unexported fields
}

ManagedClusterScope defines the basic context for an actuator to operate upon.

func NewManagedClusterScope added in v1.3.0

func NewManagedClusterScope(ctx context.Context, params ManagedClusterScopeParams) (*ManagedClusterScope, error)

NewManagedClusterScope creates a new Scope from the supplied parameters. This is meant to be called for each reconcile iteration.

func (*ManagedClusterScope) AdditionalLabels added in v1.3.0

func (s *ManagedClusterScope) AdditionalLabels() infrav1.Labels

AdditionalLabels returns the cluster additional labels.

func (*ManagedClusterScope) Close added in v1.3.0

func (s *ManagedClusterScope) Close() error

Close closes the current scope persisting the cluster configuration and status.

func (*ManagedClusterScope) Cloud added in v1.3.0

func (s *ManagedClusterScope) Cloud() cloud.Cloud

Cloud returns initialized cloud.

func (*ManagedClusterScope) ControlPlaneEndpoint added in v1.3.0

func (s *ManagedClusterScope) ControlPlaneEndpoint() clusterv1.APIEndpoint

ControlPlaneEndpoint returns the cluster control-plane endpoint.

func (*ManagedClusterScope) FailureDomains added in v1.3.0

func (s *ManagedClusterScope) FailureDomains() clusterv1.FailureDomains

FailureDomains returns the cluster failure domains.

func (*ManagedClusterScope) FirewallRulesSpec added in v1.3.0

func (s *ManagedClusterScope) FirewallRulesSpec() []*compute.Firewall

FirewallRulesSpec returns google compute firewall spec.

func (*ManagedClusterScope) IsSharedVpc added in v1.7.0

func (s *ManagedClusterScope) IsSharedVpc() bool

IsSharedVpc returns true If sharedVPC used else , returns false.

func (*ManagedClusterScope) LoadBalancer added in v1.7.0

func (s *ManagedClusterScope) LoadBalancer() infrav1.LoadBalancerSpec

LoadBalancer returns the LoadBalancer configuration.

func (*ManagedClusterScope) Name added in v1.3.0

func (s *ManagedClusterScope) Name() string

Name returns the cluster name.

func (*ManagedClusterScope) Namespace added in v1.3.0

func (s *ManagedClusterScope) Namespace() string

Namespace returns the cluster namespace.

func (*ManagedClusterScope) NatRouterSpec added in v1.3.0

func (s *ManagedClusterScope) NatRouterSpec() *compute.Router

NatRouterSpec returns google compute nat router spec.

func (*ManagedClusterScope) Network added in v1.3.0

func (s *ManagedClusterScope) Network() *infrav1.Network

Network returns the cluster network object.

func (*ManagedClusterScope) NetworkCloud added in v1.7.0

func (s *ManagedClusterScope) NetworkCloud() cloud.Cloud

NetworkCloud returns initialized cloud.

func (s *ManagedClusterScope) NetworkLink() string

NetworkLink returns the partial URL for the network.

func (*ManagedClusterScope) NetworkName added in v1.3.0

func (s *ManagedClusterScope) NetworkName() string

NetworkName returns the cluster network unique identifier.

func (*ManagedClusterScope) NetworkProject added in v1.7.0

func (s *ManagedClusterScope) NetworkProject() string

NetworkProject returns the project name where network resources should exist. The network project defaults to the Project when one is not supplied.

func (*ManagedClusterScope) NetworkSpec added in v1.3.0

func (s *ManagedClusterScope) NetworkSpec() *compute.Network

NetworkSpec returns google compute network spec.

func (*ManagedClusterScope) PatchObject added in v1.3.0

func (s *ManagedClusterScope) PatchObject() error

PatchObject persists the cluster configuration and status.

func (*ManagedClusterScope) Project added in v1.3.0

func (s *ManagedClusterScope) Project() string

Project returns the current project name.

func (*ManagedClusterScope) Region added in v1.3.0

func (s *ManagedClusterScope) Region() string

Region returns the cluster region.

func (*ManagedClusterScope) ResourceManagerTags added in v1.6.0

func (s *ManagedClusterScope) ResourceManagerTags() infrav1.ResourceManagerTags

ResourceManagerTags returns ResourceManagerTags from cluster. The returned value will never be nil.

func (*ManagedClusterScope) SetControlPlaneEndpoint added in v1.3.0

func (s *ManagedClusterScope) SetControlPlaneEndpoint(endpoint clusterv1.APIEndpoint)

SetControlPlaneEndpoint sets cluster control-plane endpoint.

func (*ManagedClusterScope) SetFailureDomains added in v1.3.0

func (s *ManagedClusterScope) SetFailureDomains(fd clusterv1.FailureDomains)

SetFailureDomains sets cluster failure domains.

func (*ManagedClusterScope) SetReady added in v1.3.0

func (s *ManagedClusterScope) SetReady()

SetReady sets cluster ready status.

func (*ManagedClusterScope) SubnetSpecs added in v1.3.0

func (s *ManagedClusterScope) SubnetSpecs() []*compute.Subnetwork

SubnetSpecs returns google compute subnets spec.

type ManagedClusterScopeParams added in v1.3.0

type ManagedClusterScopeParams struct {
	GCPServices
	Client                 client.Client
	Cluster                *clusterv1.Cluster
	GCPManagedCluster      *infrav1exp.GCPManagedCluster
	GCPManagedControlPlane *infrav1exp.GCPManagedControlPlane
}

ManagedClusterScopeParams defines the input parameters used to create a new Scope.

type ManagedControlPlaneScope added in v1.3.0

type ManagedControlPlaneScope struct {
	Cluster                *clusterv1.Cluster
	GCPManagedCluster      *infrav1exp.GCPManagedCluster
	GCPManagedControlPlane *infrav1exp.GCPManagedControlPlane

	AllMachinePools        []clusterv1exp.MachinePool
	AllManagedMachinePools []infrav1exp.GCPManagedMachinePool
	// contains filtered or unexported fields
}

ManagedControlPlaneScope defines the basic context for an actuator to operate upon.

func NewManagedControlPlaneScope added in v1.3.0

func NewManagedControlPlaneScope(ctx context.Context, params ManagedControlPlaneScopeParams) (*ManagedControlPlaneScope, error)

NewManagedControlPlaneScope creates a new Scope from the supplied parameters. This is meant to be called for each reconcile iteration.

func (*ManagedControlPlaneScope) Client added in v1.3.0

Client returns a k8s client.

func (*ManagedControlPlaneScope) Close added in v1.3.0

func (s *ManagedControlPlaneScope) Close() error

Close closes the current scope persisting the managed control plane configuration and status.

func (*ManagedControlPlaneScope) ClusterFullName added in v1.3.0

func (s *ManagedControlPlaneScope) ClusterFullName() string

ClusterFullName returns the full name of the cluster.

func (*ManagedControlPlaneScope) ClusterLocation added in v1.3.0

func (s *ManagedControlPlaneScope) ClusterLocation() string

ClusterLocation returns the location of the cluster.

func (*ManagedControlPlaneScope) ClusterName added in v1.3.0

func (s *ManagedControlPlaneScope) ClusterName() string

ClusterName returns the name of the cluster.

func (*ManagedControlPlaneScope) ConditionSetter added in v1.3.0

func (s *ManagedControlPlaneScope) ConditionSetter() conditions.Setter

ConditionSetter return a condition setter (which is GCPManagedControlPlane itself).

func (*ManagedControlPlaneScope) CredentialsClient added in v1.3.0

CredentialsClient returns a client used to interact with IAM.

func (*ManagedControlPlaneScope) GetAllNodePools added in v1.3.0

GetAllNodePools gets all node pools for the control plane.

func (*ManagedControlPlaneScope) GetCredential added in v1.3.0

func (s *ManagedControlPlaneScope) GetCredential() *Credential

GetCredential returns the credential data.

func (*ManagedControlPlaneScope) IsAutopilotCluster added in v1.3.0

func (s *ManagedControlPlaneScope) IsAutopilotCluster() bool

IsAutopilotCluster returns true if this is an autopilot cluster.

func (*ManagedControlPlaneScope) ManagedControlPlaneClient added in v1.3.0

func (s *ManagedControlPlaneScope) ManagedControlPlaneClient() *container.ClusterManagerClient

ManagedControlPlaneClient returns a client used to interact with GKE.

func (*ManagedControlPlaneScope) PatchObject added in v1.3.0

func (s *ManagedControlPlaneScope) PatchObject() error

PatchObject persists the managed control plane configuration and status.

func (*ManagedControlPlaneScope) Region added in v1.3.0

func (s *ManagedControlPlaneScope) Region() string

Region returns the region of the GKE cluster.

func (*ManagedControlPlaneScope) SetEndpoint added in v1.3.0

func (s *ManagedControlPlaneScope) SetEndpoint(host string)

SetEndpoint sets the Endpoint of GCPManagedControlPlane.

func (*ManagedControlPlaneScope) TagBindingsClient added in v1.6.0

TagBindingsClient returns a client used to interact with resource manager tags.

type ManagedControlPlaneScopeParams added in v1.3.0

type ManagedControlPlaneScopeParams struct {
	CredentialsClient      *credentials.IamCredentialsClient
	ManagedClusterClient   *container.ClusterManagerClient
	TagBindingsClient      *resourcemanager.TagBindingsClient
	Client                 client.Client
	Cluster                *clusterv1.Cluster
	GCPManagedCluster      *infrav1exp.GCPManagedCluster
	GCPManagedControlPlane *infrav1exp.GCPManagedControlPlane
}

ManagedControlPlaneScopeParams defines the input parameters used to create a new Scope.

type ManagedMachinePoolScope added in v1.3.0

type ManagedMachinePoolScope struct {
	Cluster                *clusterv1.Cluster
	MachinePool            *clusterv1exp.MachinePool
	GCPManagedCluster      *infrav1exp.GCPManagedCluster
	GCPManagedControlPlane *infrav1exp.GCPManagedControlPlane
	GCPManagedMachinePool  *infrav1exp.GCPManagedMachinePool
	// contains filtered or unexported fields
}

ManagedMachinePoolScope defines the basic context for an actuator to operate upon.

func NewManagedMachinePoolScope added in v1.3.0

func NewManagedMachinePoolScope(ctx context.Context, params ManagedMachinePoolScopeParams) (*ManagedMachinePoolScope, error)

NewManagedMachinePoolScope creates a new Scope from the supplied parameters. This is meant to be called for each reconcile iteration.

func (*ManagedMachinePoolScope) Close added in v1.3.0

func (s *ManagedMachinePoolScope) Close() error

Close closes the current scope persisting the managed control plane configuration and status.

func (*ManagedMachinePoolScope) ConditionSetter added in v1.3.0

func (s *ManagedMachinePoolScope) ConditionSetter() conditions.Setter

ConditionSetter return a condition setter (which is GCPManagedMachinePool itself).

func (*ManagedMachinePoolScope) InstanceGroupManagersClient added in v1.3.0

func (s *ManagedMachinePoolScope) InstanceGroupManagersClient() *compute.InstanceGroupManagersClient

InstanceGroupManagersClient returns a client used to interact with GCP MIG.

func (*ManagedMachinePoolScope) ManagedMachinePoolClient added in v1.3.0

func (s *ManagedMachinePoolScope) ManagedMachinePoolClient() *container.ClusterManagerClient

ManagedMachinePoolClient returns a client used to interact with GKE.

func (*ManagedMachinePoolScope) NodePoolFullName added in v1.3.0

func (s *ManagedMachinePoolScope) NodePoolFullName() string

NodePoolFullName returns the full name of the node pool.

func (*ManagedMachinePoolScope) NodePoolLocation added in v1.3.0

func (s *ManagedMachinePoolScope) NodePoolLocation() string

NodePoolLocation returns the location of the node pool.

func (*ManagedMachinePoolScope) NodePoolName added in v1.3.0

func (s *ManagedMachinePoolScope) NodePoolName() string

NodePoolName returns the node pool name.

func (*ManagedMachinePoolScope) NodePoolVersion added in v1.3.0

func (s *ManagedMachinePoolScope) NodePoolVersion() *string

NodePoolVersion returns the k8s version of the node pool.

func (*ManagedMachinePoolScope) PatchObject added in v1.3.0

func (s *ManagedMachinePoolScope) PatchObject() error

PatchObject persists the managed control plane configuration and status.

func (*ManagedMachinePoolScope) Region added in v1.3.0

func (s *ManagedMachinePoolScope) Region() string

Region returns the region of the GKE node pool.

func (*ManagedMachinePoolScope) SetReplicas added in v1.3.0

func (s *ManagedMachinePoolScope) SetReplicas(replicas int32)

SetReplicas sets the replicas count in status.

type ManagedMachinePoolScopeParams added in v1.3.0

type ManagedMachinePoolScopeParams struct {
	ManagedClusterClient        *container.ClusterManagerClient
	InstanceGroupManagersClient *compute.InstanceGroupManagersClient
	Client                      client.Client
	Cluster                     *clusterv1.Cluster
	MachinePool                 *clusterv1exp.MachinePool
	GCPManagedCluster           *infrav1exp.GCPManagedCluster
	GCPManagedControlPlane      *infrav1exp.GCPManagedControlPlane
	GCPManagedMachinePool       *infrav1exp.GCPManagedMachinePool
}

ManagedMachinePoolScopeParams defines the input parameters used to create a new Scope.

type ProviderID added in v1.6.0

type ProviderID struct {
	// contains filtered or unexported fields
}

ProviderID is a struct representation of a Kubernetes ProviderID. Format: cloudProvider://optional/segments/etc/id

func NewProviderID added in v1.6.0

func NewProviderID(id string) (*ProviderID, error)

NewProviderID parses the input string and returns a new ProviderID.

func (*ProviderID) CloudProvider deprecated added in v1.6.0

func (p *ProviderID) CloudProvider() string

CloudProvider returns the cloud provider portion of the ProviderID.

Deprecated: This method is going to be removed in a future release.

func (*ProviderID) Equals deprecated added in v1.6.0

func (p *ProviderID) Equals(o *ProviderID) bool

Equals returns true if this ProviderID string matches another ProviderID string.

Deprecated: This method is going to be removed in a future release.

func (*ProviderID) ID deprecated added in v1.6.0

func (p *ProviderID) ID() string

ID returns the identifier portion of the ProviderID.

Deprecated: This method is going to be removed in a future release.

func (*ProviderID) IndexKey deprecated added in v1.6.0

func (p *ProviderID) IndexKey() string

IndexKey returns the required level of uniqueness to represent and index machines uniquely from their node providerID.

Deprecated: This method is going to be removed in a future release.

func (ProviderID) String deprecated added in v1.6.0

func (p ProviderID) String() string

String returns the string representation of this object.

Deprecated: This method is going to be removed in a future release.

func (*ProviderID) Validate deprecated added in v1.6.0

func (p *ProviderID) Validate() bool

Validate returns true if the provider id is valid.

Deprecated: This method is going to be removed in a future release.

Jump to

Keyboard shortcuts

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