Skip to content

Commit

Permalink
Merge pull request #1159 from rabi/node_selection_tests
Browse files Browse the repository at this point in the history
Add doc and kuttl test for ansible job node selection
  • Loading branch information
openshift-merge-bot[bot] authored Oct 28, 2024
2 parents c2f6677 + 2c82ec8 commit 82ae78a
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/assemblies/proc_deploying-the-data-plane.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,23 @@ spec:
+
* Replace `<nodeSet_name>` with the names of the `OpenStackDataPlaneNodeSet` CRs that you want to include in your data plane deployment.

* You can optionally provide `ansibleJobNodeSelector` to run the ansible jobs on specific set of OCP worker nodes. For example, worker nodes with `ctlplane` network, as ansible jobs require `ctlplane` NAD.
+
----
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneDeployment
metadata:
name: edpm-deployment-ipam
spec:
nodeSets:
- openstack-edpm-ipam
- <nodeSet_name>
- ...
- <nodeSet_name>
ansibleJobNodeSelector:
nodeWith: ctlplane
----
+
. Save the `openstack-edpm-deploy.yaml` deployment file.

. Deploy the data plane:
Expand Down
103 changes: 103 additions & 0 deletions tests/kuttl/tests/dataplane-deploy-no-nodes-test/07-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
apiVersion: batch/v1
kind: Job
metadata:
generation: 1
labels:
app: openstackansibleee
openstackdataplanedeployment: edpm-compute-node-selection
openstackdataplanenodeset: edpm-compute-no-nodes
openstackdataplaneservice: configure-os
name: configure-os-edpm-compute-node-selection-edpm-compute-no-nodes
namespace: openstack-kuttl-tests
ownerReferences:
- apiVersion: dataplane.openstack.org/v1beta1
blockOwnerDeletion: true
controller: true
kind: OpenStackDataPlaneDeployment
name: edpm-compute-node-selection
spec:
backoffLimit: 6
completionMode: NonIndexed
completions: 1
manualSelector: false
parallelism: 1
podReplacementPolicy: TerminatingOrFailed
suspend: false
template:
metadata:
annotations:
k8s.v1.cni.cncf.io/networks: '[]'
creationTimestamp: null
labels:
app: openstackansibleee
batch.kubernetes.io/job-name: configure-os-edpm-compute-node-selection-edpm-compute-no-nodes
openstackdataplanedeployment: edpm-compute-node-selection
openstackdataplanenodeset: edpm-compute-no-nodes
openstackdataplaneservice: configure-os
spec:
containers:
- args:
- ansible-runner
- run
- /runner
- -p
- osp.edpm.configure_os
- -i
- configure-os-edpm-compute-node-selection-edpm-compute-no-nodes
env:
- name: ANSIBLE_FORCE_COLOR
value: "True"
- name: RUNNER_PLAYBOOK
value: |2+
osp.edpm.configure_os
- name: RUNNER_EXTRA_VARS
value: |2+
edpm_override_hosts: edpm-compute-no-nodes
edpm_service_type: configure-os
edpm_services_override: [configure-os]
imagePullPolicy: Always
name: configure-os-edpm-compute-node-selection-edpm-compute-no-nodes
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /runner/env/ssh_key
name: ssh-key
subPath: ssh_key
- mountPath: /runner/inventory/hosts
name: inventory
subPath: inventory
dnsPolicy: ClusterFirst
nodeSelector:
nodeWith: ctlplane
restartPolicy: Never
schedulerName: default-scheduler
securityContext: {}
serviceAccount: edpm-compute-no-nodes
serviceAccountName: edpm-compute-no-nodes
terminationGracePeriodSeconds: 30
volumes:
- name: ssh-key
secret:
defaultMode: 420
items:
- key: ssh-privatekey
path: ssh_key
secretName: dataplane-ansible-ssh-private-key-secret
- name: inventory
secret:
defaultMode: 420
items:
- key: inventory
path: inventory
secretName: dataplanenodeset-edpm-compute-no-nodes
status:
active: 1
terminating: 0
uncountedTerminatedPods: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneDeployment
metadata:
name: edpm-compute-node-selection
spec:
nodeSets:
- edpm-compute-no-nodes
ansibleJobNodeSelector:
nodeWith: ctlplane
servicesOverride:
- configure-os

0 comments on commit 82ae78a

Please sign in to comment.