Documentation ¶
Index ¶
- func GetRegion(defaultRegion string) (string, error)
- func GetZone(region string, defaultZone string) (string, error)
- func IsKnownRegion(region string) bool
- func IsKnownZone(region string, zone string) bool
- func Platform() (*powervs.Platform, error)
- func Validate(config *types.InstallConfig) error
- func ValidateCustomVPCSetup(client API, ic *types.InstallConfig) error
- func ValidatePERAvailability(client API, ic *types.InstallConfig) error
- func ValidatePreExistingDNS(client API, ic *types.InstallConfig, metadata MetadataAPI) error
- func ValidateResourceGroup(client API, ic *types.InstallConfig) error
- func ValidateServiceInstance(client API, ic *types.InstallConfig) error
- func ValidateSystemTypeForRegion(client API, ic *types.InstallConfig) error
- type API
- type BxClient
- type Client
- func (c *Client) AddIPToLoadBalancerPool(ctx context.Context, lbID string, poolName string, port int64, ip string) error
- func (c *Client) AddSecurityGroupRule(ctx context.Context, securityGroupID string, ...) error
- func (c *Client) AddVPCToPermittedNetworks(ctx context.Context, vpcCRN string, dnsID string, dnsZone string) error
- func (c *Client) CreateDNSCustomResolver(ctx context.Context, name string, dnsID string, vpcID string) (*dnssvcsv1.CustomResolver, error)
- func (c *Client) CreateDNSRecord(ctx context.Context, publish types.PublishingStrategy, crnstr string, ...) error
- func (c *Client) CreateSSHKey(ctx context.Context, serviceInstance string, zone string, sshKeyName string, ...) error
- func (c *Client) EnableDNSCustomResolver(ctx context.Context, dnsID string, resolverID string) (*dnssvcsv1.CustomResolver, error)
- func (c *Client) GetAPIKey() string
- func (c *Client) GetAttachedTransitGateway(ctx context.Context, svcInsID string) (string, error)
- func (c *Client) GetAuthenticatorAPIKeyDetails(ctx context.Context) (*iamidentityv1.APIKey, error)
- func (c *Client) GetDNSCustomResolverIP(ctx context.Context, dnsID string, vpcID string) (string, error)
- func (c *Client) GetDNSInstancePermittedNetworks(ctx context.Context, dnsID string, dnsZone string) ([]string, error)
- func (c *Client) GetDNSRecordsByName(ctx context.Context, crnstr string, zoneID string, recordName string, ...) ([]DNSRecordResponse, error)
- func (c *Client) GetDNSZoneIDByName(ctx context.Context, name string, publish types.PublishingStrategy) (string, error)
- func (c *Client) GetDNSZones(ctx context.Context, publish types.PublishingStrategy) ([]DNSZoneResponse, error)
- func (c *Client) GetDatacenterCapabilities(ctx context.Context, region string) (map[string]bool, error)
- func (c *Client) GetInstanceCRNByName(ctx context.Context, name string, publish types.PublishingStrategy) (string, error)
- func (c *Client) GetPublicGatewayByVPC(ctx context.Context, vpcName string) (*vpcv1.PublicGateway, error)
- func (c *Client) GetSubnetByName(ctx context.Context, subnetName string, region string) (*vpcv1.Subnet, error)
- func (c *Client) GetTGConnectionVPC(ctx context.Context, gatewayID string, vpcSubnetID string) (string, error)
- func (c *Client) GetVPCByName(ctx context.Context, vpcName string) (*vpcv1.VPC, error)
- func (c *Client) GetVPCSubnets(ctx context.Context, vpcID string) ([]vpcv1.Subnet, error)
- func (c *Client) GetVPCs(ctx context.Context, region string) ([]vpcv1.VPC, error)
- func (c *Client) ListResourceGroups(ctx context.Context) (*resourcemanagerv2.ResourceGroupList, error)
- func (c *Client) ListSecurityGroupRules(ctx context.Context, securityGroupID string) (*vpcv1.SecurityGroupRuleCollection, error)
- func (c *Client) ListServiceInstances(ctx context.Context) ([]string, error)
- func (c *Client) ServiceInstanceGUIDToName(ctx context.Context, id string) (string, error)
- func (c *Client) ServiceInstanceNameToGUID(ctx context.Context, name string) (string, error)
- func (c *Client) SetVPCServiceURLForRegion(ctx context.Context, region string) error
- type DNSRecordResponse
- type DNSZoneResponse
- type Metadata
- func (m *Metadata) APIKey(ctx context.Context) (string, error)
- func (m *Metadata) AccountID(ctx context.Context) (string, error)
- func (m *Metadata) AddSecurityGroupRule(ctx context.Context, rule *vpcv1.SecurityGroupRulePrototype, vpcID string) error
- func (m *Metadata) CISInstanceCRN(ctx context.Context) (string, error)
- func (m *Metadata) CreateDNSRecord(ctx context.Context, hostname string, destHostname string) error
- func (m *Metadata) DNSInstanceCRN(ctx context.Context) (string, error)
- func (m *Metadata) EnsureVPCIsPermittedNetwork(ctx context.Context, vpcName string) error
- func (m *Metadata) GetDNSServerIP(ctx context.Context, vpcName string) (string, error)
- func (m *Metadata) GetExistingVPCGateway(ctx context.Context, vpcName string, vpcSubnet string) (string, bool, error)
- func (m *Metadata) GetSubnetID(ctx context.Context, subnetName string, vpcRegion string) (string, error)
- func (m *Metadata) GetVPCSubnets(ctx context.Context, vpcName string) ([]vpcv1.Subnet, error)
- func (m *Metadata) IsVPCPermittedNetwork(ctx context.Context, vpcName string, baseDomain string) (bool, error)
- func (m *Metadata) ListSecurityGroupRules(ctx context.Context, vpcID string) (*vpcv1.SecurityGroupRuleCollection, error)
- func (m *Metadata) SetCISInstanceCRN(crn string)
- func (m *Metadata) SetDNSInstanceCRN(crn string)
- func (m *Metadata) SetVPCServiceURLForRegion(ctx context.Context, vpcRegion string) error
- type MetadataAPI
- type SessionStore
- type SessionVars
- type User
- type Zone
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsKnownRegion ¶
IsKnownRegion return true is a specified region is Known to the installer.
func IsKnownZone ¶
IsKnownZone return true is a specified zone is Known to the installer.
func Validate ¶
func Validate(config *types.InstallConfig) error
Validate executes platform specific validation/
func ValidateCustomVPCSetup ¶
func ValidateCustomVPCSetup(client API, ic *types.InstallConfig) error
ValidateCustomVPCSetup ensures optional VPC settings, if specified, are all legit.
func ValidatePERAvailability ¶ added in v0.9.153
func ValidatePERAvailability(client API, ic *types.InstallConfig) error
ValidatePERAvailability ensures the target datacenter has PER enabled.
func ValidatePreExistingDNS ¶
func ValidatePreExistingDNS(client API, ic *types.InstallConfig, metadata MetadataAPI) error
ValidatePreExistingDNS ensures no pre-existing DNS record exists in the CIS DNS zone or IBM DNS zone for cluster's Kubernetes API.
func ValidateResourceGroup ¶
func ValidateResourceGroup(client API, ic *types.InstallConfig) error
ValidateResourceGroup validates the resource group in our install config.
func ValidateServiceInstance ¶
func ValidateServiceInstance(client API, ic *types.InstallConfig) error
ValidateServiceInstance validates the optional service instance GUID in our install config.
func ValidateSystemTypeForRegion ¶ added in v0.9.153
func ValidateSystemTypeForRegion(client API, ic *types.InstallConfig) error
ValidateSystemTypeForRegion checks if the specified sysType is available in the target region.
Types ¶
type API ¶
type API interface { // DNS GetDNSRecordsByName(ctx context.Context, crnstr string, zoneID string, recordName string, publish types.PublishingStrategy) ([]DNSRecordResponse, error) GetDNSZoneIDByName(ctx context.Context, name string, publish types.PublishingStrategy) (string, error) GetDNSZones(ctx context.Context, publish types.PublishingStrategy) ([]DNSZoneResponse, error) GetDNSInstancePermittedNetworks(ctx context.Context, dnsID string, dnsZone string) ([]string, error) GetDNSCustomResolverIP(ctx context.Context, dnsID string, vpcID string) (string, error) CreateDNSCustomResolver(ctx context.Context, name string, dnsID string, vpcID string) (*dnssvcsv1.CustomResolver, error) EnableDNSCustomResolver(ctx context.Context, dnsID string, resolverID string) (*dnssvcsv1.CustomResolver, error) CreateDNSRecord(ctx context.Context, publish types.PublishingStrategy, crnstr string, baseDomain string, hostname string, cname string) error AddVPCToPermittedNetworks(ctx context.Context, vpcCRN string, dnsID string, dnsZone string) error // VPC GetVPCByName(ctx context.Context, vpcName string) (*vpcv1.VPC, error) GetPublicGatewayByVPC(ctx context.Context, vpcName string) (*vpcv1.PublicGateway, error) SetVPCServiceURLForRegion(ctx context.Context, region string) error GetVPCs(ctx context.Context, region string) ([]vpcv1.VPC, error) GetVPCSubnets(ctx context.Context, vpcID string) ([]vpcv1.Subnet, error) // TG GetTGConnectionVPC(ctx context.Context, gatewayID string, vpcSubnetID string) (string, error) GetAttachedTransitGateway(ctx context.Context, svcInsID string) (string, error) // Data Center GetDatacenterCapabilities(ctx context.Context, region string) (map[string]bool, error) // API GetAuthenticatorAPIKeyDetails(ctx context.Context) (*iamidentityv1.APIKey, error) GetAPIKey() string // Subnet GetSubnetByName(ctx context.Context, subnetName string, region string) (*vpcv1.Subnet, error) // Resource Groups ListResourceGroups(ctx context.Context) (*resourcemanagerv2.ResourceGroupList, error) // Service Instance ListServiceInstances(ctx context.Context) ([]string, error) ServiceInstanceGUIDToName(ctx context.Context, id string) (string, error) ServiceInstanceNameToGUID(ctx context.Context, name string) (string, error) // Security Group ListSecurityGroupRules(ctx context.Context, securityGroupID string) (*vpcv1.SecurityGroupRuleCollection, error) AddSecurityGroupRule(ctx context.Context, securityGroupID string, rule *vpcv1.SecurityGroupRulePrototype) error // SSH CreateSSHKey(ctx context.Context, serviceInstance string, zone string, sshKeyName string, sshKey string) error // Load Balancer AddIPToLoadBalancerPool(ctx context.Context, lbID string, poolName string, port int64, ip string) error }
API represents the calls made to the API.
type BxClient ¶
type BxClient struct { APIKey string Region string Zone string PISession *ibmpisession.IBMPISession User *User PowerVSResourceGroup string }
BxClient is struct which provides bluemix session details
func NewBxClient ¶
NewBxClient func returns bluemix client
func (*BxClient) FilterServiceEndpoints ¶ added in v0.90.17
FilterServiceEndpoints drops service endpoint overrides that are not supported by PowerVS CAPI provider.
func (*BxClient) GetBxClientAPIKey ¶
GetBxClientAPIKey returns the API key used by the Blue Mix Client.
func (*BxClient) NewPISession ¶
NewPISession updates pisession details, return error on fail.
type Client ¶
Client makes calls to the PowerVS API.
func (*Client) AddIPToLoadBalancerPool ¶ added in v0.90.0
func (c *Client) AddIPToLoadBalancerPool(ctx context.Context, lbID string, poolName string, port int64, ip string) error
AddIPToLoadBalancerPool adds a server to a load balancer pool for the specified port. @TODO Remove once https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/issues/1679 is fixed.
func (*Client) AddSecurityGroupRule ¶ added in v0.90.0
func (c *Client) AddSecurityGroupRule(ctx context.Context, securityGroupID string, rule *vpcv1.SecurityGroupRulePrototype) error
AddSecurityGroupRule adds a security group rule to an existing security group.
func (*Client) AddVPCToPermittedNetworks ¶ added in v0.90.17
func (c *Client) AddVPCToPermittedNetworks(ctx context.Context, vpcCRN string, dnsID string, dnsZone string) error
AddVPCToPermittedNetworks adds the specified VPC to the specified DNS zone.
func (*Client) CreateDNSCustomResolver ¶ added in v0.90.17
func (c *Client) CreateDNSCustomResolver(ctx context.Context, name string, dnsID string, vpcID string) (*dnssvcsv1.CustomResolver, error)
CreateDNSCustomResolver creates a custom resolver associated with the specified VPC in the specified DNS zone.
func (*Client) CreateDNSRecord ¶ added in v0.90.0
func (c *Client) CreateDNSRecord(ctx context.Context, publish types.PublishingStrategy, crnstr string, baseDomain string, hostname string, cname string) error
CreateDNSRecord Creates a DNS CNAME record in the given base domain and CRN.
func (*Client) CreateSSHKey ¶ added in v0.90.0
func (c *Client) CreateSSHKey(ctx context.Context, serviceInstance string, zone string, sshKeyName string, sshKey string) error
CreateSSHKey creates a SSH key in the PowerVS Workspace for the workers to use.
func (*Client) EnableDNSCustomResolver ¶ added in v0.90.17
func (c *Client) EnableDNSCustomResolver(ctx context.Context, dnsID string, resolverID string) (*dnssvcsv1.CustomResolver, error)
EnableDNSCustomResolver enables a specified custom resolver.
func (*Client) GetAttachedTransitGateway ¶ added in v0.9.153
GetAttachedTransitGateway finds an existing Transit Gateway attached to the provided PowerVS cloud instance.
func (*Client) GetAuthenticatorAPIKeyDetails ¶
GetAuthenticatorAPIKeyDetails gets detailed information on the API key used for authentication to the IBM Cloud APIs.
func (*Client) GetDNSCustomResolverIP ¶ added in v0.90.0
func (c *Client) GetDNSCustomResolverIP(ctx context.Context, dnsID string, vpcID string) (string, error)
GetDNSCustomResolverIP gets the DNS Server IP of a custom resolver associated with the specified VPC subnet in the specified DNS zone.
func (*Client) GetDNSInstancePermittedNetworks ¶
func (c *Client) GetDNSInstancePermittedNetworks(ctx context.Context, dnsID string, dnsZone string) ([]string, error)
GetDNSInstancePermittedNetworks gets the permitted VPC networks for a DNS Services instance.
func (*Client) GetDNSRecordsByName ¶
func (c *Client) GetDNSRecordsByName(ctx context.Context, crnstr string, zoneID string, recordName string, publish types.PublishingStrategy) ([]DNSRecordResponse, error)
GetDNSRecordsByName gets DNS records in specific Cloud Internet Services instance by its CRN, zone ID, and DNS record name.
func (*Client) GetDNSZoneIDByName ¶
func (c *Client) GetDNSZoneIDByName(ctx context.Context, name string, publish types.PublishingStrategy) (string, error)
GetDNSZoneIDByName gets the CIS zone ID from its domain name.
func (*Client) GetDNSZones ¶
func (c *Client) GetDNSZones(ctx context.Context, publish types.PublishingStrategy) ([]DNSZoneResponse, error)
GetDNSZones returns all of the active DNS zones managed by CIS.
func (*Client) GetDatacenterCapabilities ¶ added in v0.9.153
func (c *Client) GetDatacenterCapabilities(ctx context.Context, region string) (map[string]bool, error)
GetDatacenterCapabilities retrieves the capabilities of the specified datacenter.
func (*Client) GetInstanceCRNByName ¶
func (c *Client) GetInstanceCRNByName(ctx context.Context, name string, publish types.PublishingStrategy) (string, error)
GetInstanceCRNByName finds the CRN of the instance with the specified name.
func (*Client) GetPublicGatewayByVPC ¶
func (c *Client) GetPublicGatewayByVPC(ctx context.Context, vpcName string) (*vpcv1.PublicGateway, error)
GetPublicGatewayByVPC gets all PublicGateways in a region
func (*Client) GetSubnetByName ¶
func (c *Client) GetSubnetByName(ctx context.Context, subnetName string, region string) (*vpcv1.Subnet, error)
GetSubnetByName gets a VPC Subnet by its name and region.
func (*Client) GetTGConnectionVPC ¶ added in v0.9.153
func (c *Client) GetTGConnectionVPC(ctx context.Context, gatewayID string, vpcSubnetID string) (string, error)
GetTGConnectionVPC checks if the VPC subnet is attached to the provided Transit Gateway.
func (*Client) GetVPCByName ¶
GetVPCByName gets a VPC by its name.
func (*Client) GetVPCSubnets ¶ added in v0.90.0
GetVPCSubnets retrieves all subnets in the given VPC.
func (*Client) ListResourceGroups ¶
func (c *Client) ListResourceGroups(ctx context.Context) (*resourcemanagerv2.ResourceGroupList, error)
ListResourceGroups returns a list of resource groups.
func (*Client) ListSecurityGroupRules ¶ added in v0.90.0
func (c *Client) ListSecurityGroupRules(ctx context.Context, securityGroupID string) (*vpcv1.SecurityGroupRuleCollection, error)
ListSecurityGroupRules returns a list of the security group rules.
func (*Client) ListServiceInstances ¶
ListServiceInstances lists all service instances in the cloud.
func (*Client) ServiceInstanceGUIDToName ¶ added in v0.9.153
ServiceInstanceGUIDToName returns the name of the matching service instance GUID which was passed in.
func (*Client) ServiceInstanceNameToGUID ¶ added in v0.90.0
ServiceInstanceNameToGUID returns the name of the matching service instance GUID which was passed in.
type DNSRecordResponse ¶
DNSRecordResponse represents a DNS record response.
type DNSZoneResponse ¶
type DNSZoneResponse struct { // Name is the domain name of the zone. Name string // ID is the zone's ID. ID string // CISInstanceCRN is the IBM Cloud Resource Name for the CIS instance where // the DNS zone is managed. InstanceCRN string // CISInstanceName is the display name of the CIS instance where the DNS zone // is managed. InstanceName string // ResourceGroupID is the resource group ID of the CIS instance. ResourceGroupID string }
DNSZoneResponse represents a DNS zone response.
type Metadata ¶
type Metadata struct { BaseDomain string PublishStrategy types.PublishingStrategy // contains filtered or unexported fields }
Metadata holds additional metadata for InstallConfig resources that do not need to be user-supplied (e.g. because it can be retrieved from external APIs).
func NewMetadata ¶
func NewMetadata(config *types.InstallConfig) *Metadata
NewMetadata initializes a new Metadata object.
func (*Metadata) APIKey ¶
APIKey returns the IBM Cloud account API Key associated with the authentication credentials.
func (*Metadata) AccountID ¶
AccountID returns the IBM Cloud account ID associated with the authentication credentials.
func (*Metadata) AddSecurityGroupRule ¶ added in v0.90.0
func (m *Metadata) AddSecurityGroupRule(ctx context.Context, rule *vpcv1.SecurityGroupRulePrototype, vpcID string) error
AddSecurityGroupRule adds a security group rule to the specified VPC.
func (*Metadata) CISInstanceCRN ¶
CISInstanceCRN returns the Cloud Internet Services instance CRN that is managing the DNS zone for the base domain.
func (*Metadata) CreateDNSRecord ¶ added in v0.90.0
CreateDNSRecord creates a CNAME record for the specified hostname and destination hostname.
func (*Metadata) DNSInstanceCRN ¶
DNSInstanceCRN returns the IBM DNS Service instance CRN that is managing the DNS zone for the base domain.
func (*Metadata) EnsureVPCIsPermittedNetwork ¶ added in v0.90.17
EnsureVPCIsPermittedNetwork checks if a VPC is permitted to the DNS zone and adds it if it is not.
func (*Metadata) GetDNSServerIP ¶ added in v0.90.0
GetDNSServerIP gets the IP of a custom resolver for DNS use.
func (*Metadata) GetExistingVPCGateway ¶
func (m *Metadata) GetExistingVPCGateway(ctx context.Context, vpcName string, vpcSubnet string) (string, bool, error)
GetExistingVPCGateway checks if the VPC is a Permitted Network for the DNS Zone
func (*Metadata) GetSubnetID ¶ added in v0.90.0
func (m *Metadata) GetSubnetID(ctx context.Context, subnetName string, vpcRegion string) (string, error)
GetSubnetID gets the ID of a VPC subnet by name and region.
func (*Metadata) GetVPCSubnets ¶ added in v0.90.0
GetVPCSubnets gets a list of subnets in a VPC.
func (*Metadata) IsVPCPermittedNetwork ¶
func (m *Metadata) IsVPCPermittedNetwork(ctx context.Context, vpcName string, baseDomain string) (bool, error)
IsVPCPermittedNetwork checks if the VPC is a Permitted Network for the DNS Zone
func (*Metadata) ListSecurityGroupRules ¶ added in v0.90.0
func (m *Metadata) ListSecurityGroupRules(ctx context.Context, vpcID string) (*vpcv1.SecurityGroupRuleCollection, error)
ListSecurityGroupRules lists the rules created in the specified VPC.
func (*Metadata) SetCISInstanceCRN ¶
SetCISInstanceCRN sets Cloud Internet Services instance CRN to a string value.
func (*Metadata) SetDNSInstanceCRN ¶
SetDNSInstanceCRN sets IBM DNS Service instance CRN to a string value.
type MetadataAPI ¶
type MetadataAPI interface { AccountID(ctx context.Context) (string, error) APIKey(ctx context.Context) (string, error) CISInstanceCRN(ctx context.Context) (string, error) DNSInstanceCRN(ctx context.Context) (string, error) }
MetadataAPI represents functions that eventually call out to the API
type SessionStore ¶
type SessionStore struct { ID string `json:"id,omitempty"` APIKey string `json:"apikey,omitempty"` DefaultRegion string `json:"region,omitempty"` DefaultZone string `json:"zone,omitempty"` PowerVSResourceGroup string `json:"resourcegroup,omitempty"` }
SessionStore is an object and store that holds credentials and variables required to create a SessionVars object.
type SessionVars ¶
type SessionVars struct { ID string APIKey string Region string Zone string PowerVSResourceGroup string }
SessionVars is an object that holds the variables required to create an ibmpisession object.
type User ¶
User is struct with user details
func FetchUserDetails ¶ added in v0.9.153
FetchUserDetails returns User details from the given API key.