Skip to content

Commit c2b18a9

Browse files
committed
Add documentation for operator features and security hardening
Document configurable OpenStack config, network attachments, nodeSelector/tolerations, security hardening, privileged mode capabilities, image creation timeout, and tempest cleanup in crds.rst. Add ServiceConfigReady condition diagnostics to guide.rst.
1 parent e78fd62 commit c2b18a9

7 files changed

Lines changed: 118 additions & 2 deletions

File tree

config/samples/test_v1beta1_ansibletest.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ spec:
1616
storageClass: local-storage
1717
workloadSSHKeySecretName: open-ssh-keys
1818
ansiblePlaybookPath: playbooks/my_playbook.yaml
19-
ansibleGitRepo: https://github.com/myansible/project
19+
ansibleGitRepo: https://github.com/myansible/project # git repository URL to clone into the test pod
20+
# ansibleGitBranch: "" # branch, tag, or commit SHA to check out (default: repo's default branch)
2021
# containerImage:
2122
ansibleInventory: |
2223
localhost ansible_connection=local ansible_python_interpreter=python3

config/samples/test_v1beta1_tempest.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ spec:
99
# storageClass: local-storage
1010
# parallel: false
1111
# debug: false
12+
# networkAttachments: [] # list of NADs to attach extra networks to the test pod
13+
# # if omitted, the pod uses only the default cluster network
1214

1315
# configOverwrite
1416
# ---------------
@@ -91,6 +93,8 @@ spec:
9193
# RAM: 512
9294
# disk: 20
9395
# vcpus: 1
96+
# Set to true to remove all resources created by Tempest during teardown
97+
# cleanup: true
9498

9599
# extraRPMs:
96100
# ----------

config/samples/test_v1beta1_tobiko.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ spec:
3535
# storageClass: local-storage
3636
# parallel: false
3737
# debug: false
38+
# networkAttachments: [] # list of NADs to attach extra networks to the test pod
39+
# # if omitted, the pod uses only the default cluster network
3840
# privateKey: |
3941
# <private-key-value>
4042
# publicKey: |

docs/source/crds.rst

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,36 @@ CRs that can use the workflow section:
144144

145145
* :ref:`ansibletest-custom-resource`
146146

147+
.. _nodeselector-and-tolerations:
148+
149+
NodeSelector and Tolerations
150+
============================
151+
The test-operator creates pods to run OpenStack tests. By default, the
152+
Kubernetes scheduler places these pods on any available node based on resource
153+
availability.The toleration grants permission to run on the tainted nod. The
154+
:code:`nodeSelector` ensures the pod only runs on nodes with the matching
155+
label.
156+
157+
Basic Usage
158+
-----------
159+
160+
.. code-block:: yaml
161+
162+
apiVersion: test.openstack.org/v1beta1
163+
kind: AnsibleTest
164+
metadata:
165+
name: ansible-validate
166+
namespace: openstack
167+
spec:
168+
nodeSelector:
169+
testoperator: "true"
170+
tolerations:
171+
- key: "test"
172+
operator: "Equal"
173+
value: "true"
174+
effect: "NoSchedule"
175+
containerImage: quay.io/podified-antelope-centos9/openstack-ansible-tests:current-podified
176+
147177
ExtraMounts parameter
148178
=====================
149179
To correctly use the :code:`ExtraMounts` parameter, follow these steps:
@@ -159,7 +189,7 @@ to be mounted. The name assigned here is later referenced in the
159189
mounted in the Pod. Each entry should include the name of a volume
160190
from the :code:`volumes` field and the target mount path.
161191

162-
Example of using the :code:`ExtraMounts` parameter:
192+
Example test of using the :code:`ExtraMounts` parameter:
163193

164194
.. code-block:: yaml
165195

docs/source/guide.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,26 @@ Please make sure that you follow the order of the steps:
201201
:code:`crd`. In such a case, try to delete the :code:`finalizers:`
202202
section in the output of the :code:`oc edit tempest/tempest-tests`.
203203

204+
.. _configurable-openstack-config:
205+
206+
Configurable OpenStack Config
207+
------------------------------
208+
Test pods authenticate against OpenStack using two resources mounted into
209+
every pod: a ConfigMap containing :code:`clouds.yaml` (endpoints, project,
210+
username) and a Secret containing :code:`secure.yaml` (passwords, tokens).
211+
The names default to :code:`openstack-config` and
212+
:code:`openstack-config-secret` but can be overridden per CR:
213+
214+
.. code-block:: yaml
215+
216+
spec:
217+
openStackConfigMap: "my-clouds-config"
218+
openStackConfigSecret: "my-clouds-secret"
219+
220+
.. note::
221+
For HorizonTest and Tobiko, the operator automatically injects the password
222+
from :code:`secure.yaml` into :code:`clouds.yaml` if it is missing. Tempest
223+
and AnsibleTest mount the original ConfigMap and Secret directly.
204224

205225
.. _executing-tests:
206226

@@ -253,6 +273,15 @@ You should see a pod with a name like :code:`tempest-tests-xxxxx`.
253273
Read :ref:`getting-logs` section if you want to see logs and artifacts
254274
produced during the testing.
255275

276+
.. _checking-conditions:
277+
278+
Checking Conditions
279+
-------------------
280+
Every test CR exposes standard conditions that track its progress:
281+
282+
.. code-block:: bash
283+
284+
oc get tempest tempest-tests -n openstack -o jsonpath='{.status.conditions}' | jq
256285
257286
.. _getting-logs:
258287

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Running Test Operator
2424
prerequisites.rst
2525
guide.rst
2626
crds.rst
27+
security.rst
2728
FAQ.rst
2829

2930
Alternative Ways of Running Tempest Container

docs/source/security.rst

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
.. _test-pod-privileges:
2+
3+
===================
4+
Test Pod Privileges
5+
===================
6+
The test-operator follows security best practices by applying a restricted
7+
security profile to all test pods by default. This section describes the
8+
defaults and when you might need to change them.
9+
10+
Default Security Profile
11+
========================
12+
13+
Every test pod runs with the following restrictions:
14+
15+
* **Seccomp**: A :code:`RuntimeDefault` profile filters system calls at the
16+
kernel level.
17+
18+
* **Privilege escalation**: Disabled — processes cannot gain more privileges
19+
than their parent.
20+
21+
* **Root filesystem**: Read-only — containers cannot modify their own binaries
22+
or write to unexpected locations.
23+
24+
* **Capabilities**: All capabilities are dropped.
25+
26+
* **SELinux level**: No default — users set this explicitly when needed.
27+
28+
No configuration is required to get these defaults. They apply automatically
29+
to Tempest, Tobiko, HorizonTest, and AnsibleTest pods.
30+
31+
When to Use Privileged Mode
32+
===========================
33+
Set :code:`privileged: true` on the CR spec when your tests need capabilities
34+
that the default profile blocks. The two capabilities added in privileged mode
35+
are:
36+
37+
* :code:`NET_ADMIN` — allows modifying network configuration (routing tables,
38+
interfaces, firewall rules). Needed by Tempest neutron plugin tests and
39+
Tobiko fault injection scenarios.
40+
41+
* :code:`NET_RAW` — allows raw socket access for tools like :code:`ping` and
42+
:code:`tcpdump`. Needed by Tempest connectivity tests and Tobiko
43+
reachability checks.
44+
45+
Privileged mode is also required when Tempest installs additional RPMs at
46+
runtime via :code:`extraRPMs`, since that needs a writable root filesystem.
47+
48+
If your tests do not exercise network infrastructure or install extra
49+
packages, leave :code:`privileged: false` (the default).

0 commit comments

Comments
 (0)