Documentation
¶
Index ¶
- type API
- type Client
- func (c *Client) Close() error
- func (c *Client) RetrieveInstance(ctx context.Context, project, zone, instanceName string) (metadata.InstanceMetadata, error)
- func (c *Client) RetrieveInstanceMetadata(attr string) (string, error)
- func (c *Client) RetrieveInstanceName() (string, error)
- func (c *Client) RetrieveInstances(ctx context.Context, project, zone string) ([]metadata.InstanceMetadata, error)
- func (c *Client) RetrieveLoadBalancerEndpoint(ctx context.Context, project string) (string, error)
- func (c *Client) RetrieveProjectID() (string, error)
- func (c *Client) RetrieveSubnetworkAliasCIDR(ctx context.Context, project, zone, instanceName string) (string, error)
- func (c *Client) RetrieveZone() (string, error)
- func (c *Client) SetInstanceMetadata(ctx context.Context, project, zone, instanceName, key, value string) error
- func (c *Client) UID(ctx context.Context) (string, error)
- func (c *Client) UnsetInstanceMetadata(ctx context.Context, project, zone, instanceName, key string) error
- type CloudControllerManager
- func (c *CloudControllerManager) ConfigMaps() (kubernetes.ConfigMaps, error)
- func (c *CloudControllerManager) Env() []k8s.EnvVar
- func (c *CloudControllerManager) ExtraArgs() []string
- func (c *CloudControllerManager) Image(k8sVersion versions.ValidK8sVersion) (string, error)
- func (c *CloudControllerManager) Name() string
- func (c *CloudControllerManager) Path() string
- func (c *CloudControllerManager) Secrets(_ context.Context, _ string, cloudServiceAccountURI string) (kubernetes.Secrets, error)
- func (c *CloudControllerManager) Supported() bool
- func (c *CloudControllerManager) VolumeMounts() []k8s.VolumeMount
- func (c *CloudControllerManager) Volumes() []k8s.Volume
- type CloudNodeManager
- type ForwardingRuleIterator
- type InstanceIterator
- type Logger
- type Metadata
- func (m *Metadata) GetInstance(ctx context.Context, providerID string) (metadata.InstanceMetadata, error)
- func (m *Metadata) GetLoadBalancerEndpoint(ctx context.Context) (string, error)
- func (m *Metadata) List(ctx context.Context) ([]metadata.InstanceMetadata, error)
- func (m *Metadata) Self(ctx context.Context) (metadata.InstanceMetadata, error)
- func (m *Metadata) Supported() bool
- func (m *Metadata) SupportsLoadBalancer() bool
- func (m *Metadata) UID(ctx context.Context) (string, error)
- type Operation
- type SubnetworkIterator
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { // UID retrieves the current instances uid. UID(context.Context) (string, error) // RetrieveInstances retrieves a list of all accessible GCP instances with their metadata. RetrieveInstances(ctx context.Context, project, zone string) ([]metadata.InstanceMetadata, error) // RetrieveInstances retrieves a single GCP instances with its metadata. RetrieveInstance(ctx context.Context, project, zone, instanceName string) (metadata.InstanceMetadata, error) // RetrieveInstanceMetadata retrieves the GCP instance metadata of the current instance. RetrieveInstanceMetadata(attr string) (string, error) // RetrieveProjectID retrieves the GCP projectID containing the current instance. RetrieveProjectID() (string, error) // RetrieveZone retrieves the GCP zone containing the current instance. RetrieveZone() (string, error) // RetrieveInstanceName retrieves the instance name of the current instance. RetrieveInstanceName() (string, error) // RetrieveSubnetworkAliasCIDR retrieves the subnetwork CIDR of the current instance. RetrieveSubnetworkAliasCIDR(ctx context.Context, project, zone, instanceName string) (string, error) // RetrieveLoadBalancerEndpoint retrieves the load balancer endpoint of the current instance. RetrieveLoadBalancerEndpoint(ctx context.Context, project string) (string, error) // SetInstanceMetadata sets metadata key: value of the instance specified by project, zone and instanceName. SetInstanceMetadata(ctx context.Context, project, zone, instanceName, key, value string) error // UnsetInstanceMetadata removes a metadata key-value pair of the instance specified by project, zone and instanceName. UnsetInstanceMetadata(ctx context.Context, project, zone, instanceName, key string) error }
API handles all GCP API requests.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements the gcp.API interface.
func (*Client) RetrieveInstance ¶
func (c *Client) RetrieveInstance(ctx context.Context, project, zone, instanceName string) (metadata.InstanceMetadata, error)
RetrieveInstance returns a an instance including ips and metadata.
func (*Client) RetrieveInstanceMetadata ¶
func (*Client) RetrieveInstanceName ¶
func (*Client) RetrieveInstances ¶
func (c *Client) RetrieveInstances(ctx context.Context, project, zone string) ([]metadata.InstanceMetadata, error)
RetrieveInstances returns list of instances including their ips and metadata.
func (*Client) RetrieveLoadBalancerEndpoint ¶
RetrieveLoadBalancerEndpoint returns the endpoint of the load balancer with the constellation-uid tag.
func (*Client) RetrieveProjectID ¶
RetrieveProjectID retrieves the GCP projectID containing the current instance.
func (*Client) RetrieveSubnetworkAliasCIDR ¶
func (c *Client) RetrieveSubnetworkAliasCIDR(ctx context.Context, project, zone, instanceName string) (string, error)
RetrieveSubnetworkAliasCIDR returns the alias CIDR of the subnetwork specified by project, zone and subnetworkName.
func (*Client) RetrieveZone ¶
RetrieveZone retrieves the GCP zone containing the current instance.
func (*Client) SetInstanceMetadata ¶
func (c *Client) SetInstanceMetadata(ctx context.Context, project, zone, instanceName, key, value string) error
SetInstanceMetadata modifies a key value pair of metadata for the instance specified by project, zone and instanceName.
type CloudControllerManager ¶
type CloudControllerManager struct {
// contains filtered or unexported fields
}
CloudControllerManager holds the gcp cloud-controller-manager configuration.
func NewCloudControllerManager ¶
func NewCloudControllerManager(ctx context.Context, metadata *Metadata) (*CloudControllerManager, error)
NewCloudControllerManager returns an initialized cloud controller manager configuration struct for GCP.
func (*CloudControllerManager) ConfigMaps ¶
func (c *CloudControllerManager) ConfigMaps() (kubernetes.ConfigMaps, error)
ConfigMaps returns a list of ConfigMaps to deploy together with the k8s cloud-controller-manager Reference: https://kubernetes.io/docs/concepts/configuration/configmap/ .
func (*CloudControllerManager) Env ¶
func (c *CloudControllerManager) Env() []k8s.EnvVar
Env returns a list of k8s environment key-value pairs to deploy together with the k8s cloud-controller-manager.
func (*CloudControllerManager) ExtraArgs ¶
func (c *CloudControllerManager) ExtraArgs() []string
ExtraArgs returns a list of arguments to append to the cloud-controller-manager command.
func (*CloudControllerManager) Image ¶
func (c *CloudControllerManager) Image(k8sVersion versions.ValidK8sVersion) (string, error)
Image returns the container image used to provide cloud-controller-manager for the cloud-provider.
func (*CloudControllerManager) Name ¶
func (c *CloudControllerManager) Name() string
Name returns the cloud-provider name as used by k8s cloud-controller-manager (k8s.gcr.io/cloud-controller-manager).
func (*CloudControllerManager) Path ¶
func (c *CloudControllerManager) Path() string
Path returns the path used by cloud-controller-manager executable within the container image.
func (*CloudControllerManager) Secrets ¶
func (c *CloudControllerManager) Secrets(_ context.Context, _ string, cloudServiceAccountURI string) (kubernetes.Secrets, error)
Secrets returns a list of secrets to deploy together with the k8s cloud-controller-manager. Reference: https://kubernetes.io/docs/concepts/configuration/secret/ .
func (*CloudControllerManager) Supported ¶
func (c *CloudControllerManager) Supported() bool
Supported is used to determine if cloud controller manager is implemented for this cloud provider.
func (*CloudControllerManager) VolumeMounts ¶
func (c *CloudControllerManager) VolumeMounts() []k8s.VolumeMount
VolumeMounts returns a list of volume mounts to deploy together with the k8s cloud-controller-manager.
func (*CloudControllerManager) Volumes ¶
func (c *CloudControllerManager) Volumes() []k8s.Volume
Volumes returns a list of volumes to deploy together with the k8s cloud-controller-manager. Reference: https://kubernetes.io/docs/concepts/storage/volumes/ .
type CloudNodeManager ¶
type CloudNodeManager struct{}
CloudNodeManager holds the GCP cloud-node-manager configuration.
func (*CloudNodeManager) ExtraArgs ¶
func (c *CloudNodeManager) ExtraArgs() []string
ExtraArgs returns a list of arguments to append to the cloud-node-manager command. Not used on GCP.
func (*CloudNodeManager) Image ¶
func (c *CloudNodeManager) Image(k8sVersion versions.ValidK8sVersion) (string, error)
Image returns the container image used to provide cloud-node-manager for the cloud-provider. Not used on GCP.
func (*CloudNodeManager) Path ¶
func (c *CloudNodeManager) Path() string
Path returns the path used by cloud-node-manager executable within the container image. Not used on GCP.
func (*CloudNodeManager) Supported ¶
func (c *CloudNodeManager) Supported() bool
Supported is used to determine if cloud node manager is implemented for this cloud provider.
type ForwardingRuleIterator ¶
type ForwardingRuleIterator interface {
Next() (*computepb.ForwardingRule, error)
}
type InstanceIterator ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func NewLogger ¶
NewLogger creates a new Cloud Logger for GCP. https://cloud.google.com/logging/docs/setup/go
type Metadata ¶
type Metadata struct {
// contains filtered or unexported fields
}
Metadata implements core.ProviderMetadata interface.
func (*Metadata) GetInstance ¶
func (m *Metadata) GetInstance(ctx context.Context, providerID string) (metadata.InstanceMetadata, error)
GetInstance retrieves an instance using its providerID.
func (*Metadata) GetLoadBalancerEndpoint ¶
GetLoadBalancerEndpoint returns the endpoint of the load balancer.
func (*Metadata) Supported ¶
Supported is used to determine if metadata API is implemented for this cloud provider.
func (*Metadata) SupportsLoadBalancer ¶
SupportsLoadBalancer returns true if the cloud provider supports load balancers.
type SubnetworkIterator ¶
type SubnetworkIterator interface {
Next() (*computepb.Subnetwork, error)
}