Skip to content

Latest commit

 

History

History

gce

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

GCE Plugin

Notes

  • Some of the resources in this plugin have not been tested. See the Supported Resources section for details.
  • Due to the nature and scope of this plugin, not all use cases may be supported as is. Please see the Getting Help section for details on requesting additional functionality.

Overview

The GCE Plugin consumes the Google Compute v1 API and exposes the supported resources to RightScale SelfService. This allows for easy extension of a SelfService Cloud Application to use GCE resources not natively supported in RightScale.

Prerequisites

This plugin uses credentials for connecting to the cloud -- in order to apply this plugin you must have a credential registered in the system that is compatible with this plugin. If there are no credentials listed when you apply the plugin, please contact your cloud admin and ask them to register a credential that is compatible with this plugin. The information below should be consulted when creating the credential.

Requirements

  • A general understanding CAT development and definitions
    • Refer to the guide documentation for details SS Guides
  • Admin rights to a RightScale account with SelfService enabled
    • Admin is needed to set/retrieve the RightScale Credentials for the GCE API.
  • The following packages are also required (See the Installation section for details):

Getting Started

Creating a GCE Service Account

This procedure will create a GCE Service account with the appropriate permissions to use this plugin.

  1. Review the Using OAuth 2.0 for Server to Server Applications documentation.
  2. Follow the section named Creating a service account
    • Roles needs to include:
      • Compute Instance Admin (beta)
      • Compute Network Admin
      • Compute Security Admin
    • Permissions can be restricted but may effect the permissions required to interact with certain resources with this plugin. Doing so is unsupported
    • Enabling G Suite Domain-wide Delegation is not required
    • Furnish a new private key selecting the JSON option
  3. Download the Private Key and record the Service account ID (These will be stored in a RightScale Credential in a future step)

Creating the RightScale Credentials

This procedure will setup the Credentials required for the GCE Plugin to interact with the GCE API

  1. Review the Credentials documentation.
  2. Create a credential in the desired RightScale Account with the name of GCE_PLUGIN_ACCOUNT
  3. Paste the Service Account Id into the value of this credential and save
  4. Extract/Copy the private_key from the JSON downloaded when you created the GCE Service Account
    • You will need to replace "\n" in the private_key with actual line returns to paste into the credential
  5. Create a credential in the desired RightScale Account with the name of GCE_PLUGIN_PRIVATE_KEY
  6. Paste the private_key into the value of the credential making sure to replace "\n" with actual line returns and save

Installation

  1. Be sure your RightScale account is SelfService enabled
  2. Follow the Getting Started section to create a Service Account and RightScale Credentials
  3. Navigate to the appropriate SelfService portal
  4. In the Design section, use the Upload CAT interface to complete the following:
    1. Upload each of packages listed in the Requirements Section
    2. Upload the gce_plugin.rb file located in this repository

How to Use

The GCE Plugin has been packaged as plugin/gce. In order to use this plugin you must import this plugin into a CAT.

import "plugins/gce"

For more information on using packages, please refer to the RightScale online documentation. Importing a Package

GCE resources can now be created by specifying a resource declaration with the desired fields. See the Supported Resources section for a full list. The resulting resource can be manipulated just like the native RightScale resources in RCL and CAT. See the Examples Section for more examples and complete CAT's.

#Creates a globalAddress
resource "my_address", type: "gce.globalAddress" do
  name "gce_plugin_address"
  description "Example address created by the GCE Plugin"
end

Implementation Notes

  • The GCE Plugin makes no attempt to support non-GCE resources. (i.e. Allow the passing the RightScale or other resources as arguments to a GCE resource.)
  • The most common example might be to pass a RightScale instance as an argument to add to a GCE instancePool or similar. Support for this functionality will need to be implemented in the application CAT.

Supported Resources

ResourceName Type Support Level
Addresses gce.addresses Supported
Autoscalers gce.autoscalers Untested
Backendbuckets gce.backendBuckets Untested
Backendservices gce.backendServices Supported
Disktypes gce.diskTypes Untested
Disks gce.disks Untested
Firewalls gce.firewalls Untested
Forwardingrules gce.forwardingRules Supported
Globaladdresses gce.globalAddresses Supported
Globalforwardingrules gce.globalForwardingRules Supported
Globaloperations gce.globalOperations Supported
Healthchecks gce.healthChecks Supported
Httphealthchecks gce.httpHealthChecks Supported
Httpshealthchecks gce.httpsHealthChecks Untested
Images gce.images Untested
Instancegroupmanagers gce.instanceGroupManagers Untested
Instancegroups gce.instanceGroups Untested
Instancetemplates gce.instanceTemplates Untested
Instances gce.instances Tested
Licenses gce.licenses Untested
Machinetypes gce.machineTypes Untested
Networks gce.networks Supported
Globaloperations gce.globalOperations Supported
Projects gce.projects Untested
Regionautoscalers gce.regionAutoscalers Untested
Regionbackendservices gce.regionBackendServices Supported
Regioninstancegroupmanagers gce.regionInstanceGroupManagers Untested
Regioninstancegroups gce.regionInstanceGroups Supported
Regionoperations gce.regionOperations Supported
Regions gce.regions Untested
Routers gce.routers Untested
Routes gce.routes Untested
Snapshots gce.snapshots Untested
Sslcertificates gce.sslCertificates Untested
Subnetworks gce.subnetworks Supported
Targethttpproxies gce.targetHttpProxies Supported
Targethttpsproxies gce.targetHttpsProxies Untested
Targetinstances gce.targetInstances Untested
Targetpools gce.targetPools Supported
Targetsslproxies gce.targetSslProxies Untested
Targetvpngateways gce.targetVpnGateways Untested
Urlmaps gce.urlMaps Untested
Vpntunnels gce.vpnTunnels Untested
Zoneoperations gce.zoneOperations Supported
Zones gce.zones Untested

Examples

Known Issues / Limitations

  • List and AggregatedList actions cause an error when no results are returned.
  • Delete/Provision produce a 404 error if the operation returns an error.
  • actions which return a JSON response that isn't a resource is untested.
  • Outputs support only top level JSON nodes so return responses with JSON subnodes have been removed with the top level node containing the full JSON. (Untested)

License

The GCE Plugin source code is subject to the MIT license, see the LICENSE file.