Google Cloud Compute Engine (GCE) Driver

Selecting the gce driver adds the following options to the providers section of the configuration.

providers.[gce]
Type: list

A GCE provider’s resources are partitioned into groups called pool (see providers.[gce].pools for details), and within a pool, the node types which are to be made available are listed (see providers.[gce].pools.labels for details).

See Application Default Credentials for information on how to configure credentials and other settings for GCE access in Nodepool’s runtime environment.

Note

For documentation purposes the option names are prefixed providers.[gce] to disambiguate from other drivers, but [gce] is not required in the configuration (e.g. below providers.[gce].pools refers to the pools key in the providers section when the gce driver is selected).

Example:

- name: gce-uscentral1
  driver: gce
  project: nodepool-123456
  region: us-central1
  zone: us-central1-a
  cloud-images:
    - name: debian-stretch
      image-project: debian-cloud
      image-family: debian-9
      username: zuul
      key: ssh-rsa ...
  pools:
    - name: main
      max-servers: 8
      labels:
        - name: debian-stretch
          instance-type: f1-micro
          cloud-image: debian-stretch
          volume-type: standard
          volume-size: 10
providers.[gce].name (required)

A unique name for this provider configuration.

providers.[gce].region (required)

Name of the region to use; see GCE regions and zones.

providers.[gce].zone (required)

Name of the zone to use; see GCE regions and zones.

providers.[gce].boot-timeout
Default: 60
Type: int seconds

Once an instance is active, how long to try connecting to the image via SSH. If the timeout is exceeded, the node launch is aborted and the instance deleted.

providers.[gce].launch-timeout
Default: 3600
Type: int seconds

The time to wait from issuing the command to create a new instance until that instance is reported as “active”. If the timeout is exceeded, the node launch is aborted and the instance deleted.

providers.[gce].launch-retries
Default: 3

The number of times to retry launching a node before considering the job failed.

providers.[gce].cloud-images
Type: list

Each entry in this section must refer to an entry in the labels section.

cloud-images:
  - name: debian-stretch
    image-project: debian-cloud
    image-family: debian-9
    username: zuul
    key: ssh-rsa ...

Each entry is a dictionary with the following keys:

providers.[gce].cloud-images.name (required)
Type: string

Identifier to refer this cloud-image from providers.[gce].pools.labels section.

providers.[gce].cloud-images.image-id
Type: str

If this is provided, it is used to select the image from the cloud provider by ID.

providers.[gce].cloud-images.image-project
Type: str

If providers.[gce].cloud-images.image-id is not provided, this is used along with providers.[gce].cloud-images.image-family to find an image.

providers.[gce].cloud-images.image-family
Type: str

If providers.[gce].cloud-images.image-id is not provided, this is used along with providers.[gce].cloud-images.image-project to find an image.

providers.[gce].cloud-images.username
Type: str

The username that a consumer should use when connecting to the node.

providers.[gce].cloud-images.key
Type: str

An SSH public key to add to the instance (project global keys are added automatically).

providers.[gce].cloud-images.python-path
Default: auto
Type: str

The path of the default python interpreter. Used by Zuul to set ansible_python_interpreter. The special value auto will direct Zuul to use inbuilt Ansible logic to select the interpreter on Ansible >=2.8, and default to /usr/bin/python2 for earlier versions.

providers.[gce].cloud-images.shell-type
Default: sh
Type: str

The shell type of the node’s default shell executable. Used by Zuul to set ansible_shell_type. This setting should only be used

  • For a windows image with the experimental connection-type ssh in which case cmd or powershell should be set and reflect the node’s DefaultShell configuration.

  • If the default shell is not Bourne compatible (sh), but instead e.g. csh or fish, and the user is aware that there is a long-standing issue with ansible_shell_type in combination with become

providers.[gce].cloud-images.connection-type
Type: str

The connection type that a consumer should use when connecting to the node. For most images this is not necessary. However when creating Windows images this could be ‘winrm’ to enable access via ansible.

providers.[gce].cloud-images.connection-port
Default: 22/ 5986
Type: int

The port that a consumer should use when connecting to the node. For most diskimages this is not necessary. This defaults to 22 for ssh and 5986 for winrm.

providers.[gce].pools
Type: list

A pool defines a group of resources from an GCE provider. Each pool has a maximum number of nodes which can be launched from it, along with a number of cloud-related attributes used when launching nodes.

providers.[gce].pools.name (required)

A unique name within the provider for this pool of resources.

providers.[gce].pools.priority
Default: 100
Type: int

The priority of this provider pool (a lesser number is a higher priority). Nodepool launchers will yield requests to other provider pools with a higher priority as long as they are not paused. This means that in general, higher priority pools will reach quota first before lower priority pools begin to be used.

This setting may be specified at the provider level in order to apply to all pools within that provider, or it can be overridden here for a specific pool.

providers.[gce].pools.node-attributes
Type: dict

A dictionary of key-value pairs that will be stored with the node data in ZooKeeper. The keys and values can be any arbitrary string.

providers.[gce].pools.host-key-checking
Default: True
Type: bool

Whether to validate SSH host keys. When true, this helps ensure that nodes are ready to receive SSH connections before they are supplied to the requestor. When set to false, nodepool-launcher will not attempt to ssh-keyscan nodes after they are booted. Disable this if nodepool-launcher and the nodes it launches are on different networks, where the launcher is unable to reach the nodes directly, or when using Nodepool with non-SSH node platforms. The default value is true.

providers.[gce].pools.use-internal-ip
Default: False

Whether to access the instance with the internal or external IP address.

providers.[gce].pools.labels
Type: list

Each entry in a pool’s labels section indicates that the corresponding label is available for use in this pool. When creating nodes for a label, the flavor-related attributes in that label’s section will be used.

labels:
  - name: debian
    instance-type: f1-micro
    cloud-image: debian-stretch

Each entry is a dictionary with the following keys

providers.[gce].pools.labels.name (required)
Type: str

Identifier to refer this label.

providers.[gce].pools.labels.cloud-image (required)
Type: str

Refers to the name of an externally managed image in the cloud that already exists on the provider. The value of cloud-image should match the name of a previously configured entry from the cloud-images section of the provider. See providers.[gce].cloud-images.

providers.[gce].pools.labels.instance-type (required)
Type: str

Name of the flavor to use. See GCE machine types.

providers.[gce].pools.labels.volume-type
Type: string

If given, the root volume type (pd-standard or pd-ssd).

providers.[gce].pools.labels.volume-size
Type: int

If given, the size of the root volume, in GiB.