8.3 KiB
zuul
Google Cloud Compute Engine (GCE) Driver
Selecting the gce driver adds the following options to the providers section of the
configuration.
providers.[gce]
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: 10name
A unique name for this provider configuration.
region
Name of the region to use; see GCE regions and zones.
zone
Name of the zone to use; see GCE regions and zones.
boot-timeout
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.
launch-retries
The number of times to retry launching a node before considering the job failed.
cloud-images
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:
name
Identifier to refer this cloud-image from providers.[gce].pools.labels
section.
image-id
If this is provided, it is used to select the image from the cloud provider by ID.
image-project
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.
image-family
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.
username
The username that a consumer should use when connecting to the node.
key
An SSH public key to add to the instance (project global keys are added automatically).
python-path
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.
shell-type
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
sshin which casecmdorpowershellshould be set and reflect the node'sDefaultShellconfiguration. - If the default shell is not Bourne compatible (sh), but instead e.g.
cshorfish, and the user is aware that there is a long-standing issue withansible_shell_typein combination withbecome
connection-type
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.
connection-port
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.
pools
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.
name
A unique name within the provider for this pool of resources.
node-attributes
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.
host-key-checking
Specify custom behavior of validation of SSH host keys. When set to False, nodepool-launcher will not ssh-keyscan nodes after they are booted. This might be needed if nodepool-launcher and the nodes it launches are on different networks. The default value is True.
use-internal-ip
Whether to access the instance with the internal or external IP address.
labels
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-stretchEach entry is a dictionary with the following keys
name
Identifier to refer this label.
cloud-image
Refers to the name of an externally managed image in the cloud that already exists on the provider. The value of
cloud-imageshould match thenameof a previously configured entry from thecloud-imagessection of the provider. Seeproviders.[gce].cloud-images.instance-type
Name of the flavor to use. See GCE machine types.
volume-type
If given, the root volume type (
pd-standardorpd-ssd).volume-size
If given, the size of the root volume, in GiB.