Commit Graph

13 Commits

Author SHA1 Message Date
Benjamin Schanzel 4660bb9aa7
Kubernetes/OpenShift drivers: allow setting dynamic k8s labels
Just like for the OpenStack/AWS/Azure drivers, allow to configure
dynamic metadata (labels) for kubernetes resources with information
about the corresponding node request.

Change-Id: I5d174edc6b7a49c2ab579a9a0b1b560389d6de82
2023-09-11 10:49:27 +02:00
James E. Blair eedd6b9d2a Add extra-resources handling to openshift drivers
This adds the extra-resources handling that was just added to the
k8s driver to openshift.

Change-Id: I56e5eaf6ec22d10e88420094e92041c0b39b04e5
2023-06-27 14:06:11 -07:00
James E. Blair 669552f6f9 Add support for specifying pod resource limits
We currently allow users to specify pod resource requests and limits
for cpu, ram, and ephemeral storage.  But if a user specifies one of
these, the value is used for both the request and the limit.

This updates the specification to allow the use of separate request
and limit values.

It also normalizes related behavior across all 3 pod drivers,
including adding resource reporting to the openshift drivers.

Change-Id: I49f918b01f83d6fd0fd07f61c3e9a975aa8e59fb
2023-02-12 07:14:30 -08:00
James E. Blair 9bf44b4a4c Add scheduler, volumes, and labels to k8s/openshift
This adds support for specifying the scheduler name, volumes (and
volume mounts), and additional metadata labels to the Kubernetes
and OpenShift (and OpenShift pods) drivers.

This also extends the k8s and openshift test frameworks so that we
can exercise the new code paths (as well as some previous similar
settings).  Tests and assertions for both a minimal (mostly defaults)
configuration as well as a configuration that uses all the optional
settings are added.

Change-Id: I648e88a518c311b53c8ee26013a324a5013f3be3
2023-02-11 12:03:45 -08:00
James E. Blair 6d3b5f3bab Add missing cloud/region/az/host_id info to nodes
To the greatest extent possible within the limitation of each provider,
this adds cloud, region, az, and host_id to nodes.

Each of AWS, Azure, GCE, IBMVPC have the cloud name hard-coded to
a value that makes sense for each driver given that each of these
are singleton clouds.  Their region and az values are added as
appropriate.

The k8s, openshift, and openshiftpods all have their cloud names set
to the k8s context name, which is the closest approximation of what
the "cloud" attribute means in its existing usage in the OpenStack
driver.  If pods are launched, the host_id value is set to the k8s
host node name, which is an approximation of the existing usage in
the OpenStack driver (where it is typically an opaque uuid that
uniquely identifies the hypervisor).

Change-Id: I53765fc3914a84d2519f5d4dda4f8dc8feda72f2
2022-08-25 13:41:05 -07:00
James E. Blair 10df93540f Use Zuul-style ZooKeeper connections
We have made many improvements to connection handling in Zuul.
Bring those back to Nodepool by copying over the zuul/zk directory
which has our base ZK connection classes.

This will enable us to bring other Zuul classes over, such as the
component registry.

The existing connection-related code is removed and the remaining
model-style code is moved to nodepool.zk.zookeeper.  Almost every
file imported the model as nodepool.zk, so import adjustments are
made to compensate while keeping the code more or less as-is.

Change-Id: I9f793d7bbad573cb881dfcfdf11e3013e0f8e4a3
2022-05-23 07:40:20 -07:00
Albin Vass 0c84b7fa4e Add shell-type config
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
2021-03-05 15:14:29 +01:00
Jonas Sticha d1a123111b
Replace call to deprecated Thread.isAlive
The isAlive() spelling is deprecated since python3.8,
and was remove in python3.9. The is_alive() spelling
of the method exists already since at least python2.7

Change-Id: I5d38aad85365dbc24451f032aac79e1b0de05a09
2020-12-18 12:20:09 +01:00
Simon Westphahl 52709d7070 Pass node request handler to launcher base class
All implementations of the NodeLauncher have access to the node request
handler instance, but it was not passed through to the base class.

In order to initialize the event log adapter, the NodeLauncher will now
receive then node request handler instead of the Zookeeper connection.

The Zookeeper connection is directly extracted from the request handler.

Change-Id: I8ee7335f50b64435c82a5f039989f98750874466
2020-01-22 09:49:52 +01:00
Tristan Cacqueray 159038503a Implement an OpenShift Pod provider
This change implements a single project OpenShift pod provider usable by a
regular user service account, without the need for a self-provisioner role.

Change-Id: I84e4bdda64716f9dd803eaa89e576c26a1667809
2019-05-07 02:25:15 +00:00
Tristan Cacqueray 76aa62230c Add python-path option to node
This change adds a new python_path Node attribute so that zuul executor
can remove the default hard-coded ansible_python_interpreter.

Change-Id: Iddf2cc6b2df579636ec39b091edcfe85a4a4ed10
2019-05-07 02:22:45 +00:00
Tristan Cacqueray 301101d06c Fix OpenShift driver typo
This is a follow-up to fix typo introduced by:
https://review.openstack.org/570667

Change-Id: I7178860f2b7a47cf58e96ee1d2ea32ceeeab5a18
2019-01-17 05:21:08 +00:00
Tristan Cacqueray c1378c4407 Implement an OpenShift resource provider
This change implements an OpenShift resource provider. The driver currently
supports project request and pod request to enable both containers as machine
and native containers workflow.

Depends-On: https://review.openstack.org/608610
Change-Id: Id3770f2b22b80c2e3666b9ae5e1b2fc8092ed67c
2019-01-10 05:05:46 +00:00