Ansible needs to know which shell type the node uses to operate correctly, especially for ssh connections for windows nodes because otherwise ansible defaults to trying bash. Change-Id: I71abfefa57aaafd88f199be19ee7caa64efda538
5.8 KiB
zuul
Kubernetes Driver
Selecting the kubernetes driver adds the following options to the
providers section of
the configuration.
providers.[kubernetes]
A Kubernetes provider's resources are partitioned into groups called
pools (see providers.[kubernetes].pools for details), and within
a pool, the node types which are to be made available are listed (see
providers.[kubernetes].pools.labels for details).
Note
For documentation purposes the option names are prefixed
providers.[kubernetes] to disambiguate from other drivers,
but [kubernetes] is not required in the configuration (e.g.
below providers.[kubernetes].pools refers to the
pools key in the providers section when the
kubernetes driver is selected).
Example:
providers:
- name: kubespray
driver: kubernetes
context: admin-cluster.local
pools:
- name: main
labels:
- name: kubernetes-namespace
type: namespace
- name: pod-fedora
type: pod
image: docker.io/fedora:28context
Name of the context configured in kube/config.
Before using the driver, Nodepool either needs a
kube/config file installed with a cluster admin context, in
which case this setting is required, or if Nodepool is running inside
Kubernetes, this setting and the kube/config file may be
omitted and Nodepool will use a service account loaded from the
in-cluster configuration path.
launch-retries
The number of times to retry launching a node before considering the job failed.
pools
A pool defines a group of resources from a Kubernetes provider.
name
Namespaces are prefixed with the pool's name.
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.
labels
Each entry in a pool`s labels section indicates that the corresponding label is available for use in this pool.
Each entry is a dictionary with the following keys
name
Identifier for this label; references an entry in the labels section.
type
The Kubernetes provider supports two types of labels:
namespace
Namespace labels provide an empty namespace configured with a service account that can create pods, services, configmaps, etc.
pod
Pod labels provide a dedicated namespace with a single pod created
using the providers.[kubernetes].pools.labels.image parameter
and it is configured with a service account that can exec and get the
logs of the pod.
image
Only used by the providers.[kubernetes].pools.labels.type.pod label
type; specifies the image name used by the pod.
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 not be used
unless the default shell is a non-Bourne (sh) compatible shell, e.g.
csh or fish. For a windows image with the
experimental connection-type
ssh, cmd or powershell should be
set and reflect the node's DefaultShell configuration.
cpu
Only used by the providers.[kubernetes].pools.labels.type.pod label
type; specifies the number of cpu to request for the pod.
memory
Only used by the providers.[kubernetes].pools.labels.type.pod label
type; specifies the amount of memory in MB to request for the pod.
env
Only used by the providers.[kubernetes].pools.labels.type.pod label
type; A list of environment variables to pass to the Pod.
name
The name of the environment variable passed to the Pod.
value
The value of the environment variable passed to the Pod.
node-selector
Only used by the providers.[kubernetes].pools.labels.type.pod label
type; A map of key-value pairs to ensure the Kubernetes scheduler places
the Pod on a node with specific node labels.