Skip to content

Commit d03a1bf

Browse files
authored
Merge pull request #21 from mhjacks/exclude_infra_nodes_by_default
[WIP] Improvements to labelling job - allow label selector to be passed as value (to avoid, e.g. submariner) and ensure at least 3 nodes labelled
2 parents 21ad63c + 97c2095 commit d03a1bf

5 files changed

Lines changed: 19 additions & 3 deletions

File tree

Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.2.2
18+
version: 0.2.3
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# openshift-data-foundations
22

3-
![Version: 0.2.2](https://img.shields.io/badge/Version-0.2.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square)
3+
![Version: 0.2.3](https://img.shields.io/badge/Version-0.2.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square)
44

55
A Helm chart to install ODF on Openshift
66

77
### Notable changes
88

9+
* v0.2.3: Allow passing of label selector to labelling job to avoid, for example, labelling submariner nodes.
10+
Also ensure at least 3 nodes are labelled when using label selector.
11+
912
* v0.2.2: Reconfigure sync ordering to ensure label job runs before attempts to create storagecluster/storagesystem
13+
1014
* v0.2.1: Introduce boolean to configure where mirroring is enabled. Needed for RamenDR. Defaults to false
1115

1216
**Homepage:** <https://github.com/validatedpatterns/openshift-data-foundations-chart>
@@ -81,6 +85,7 @@ default failure domain for objectStorage.
8185
| route.service.weight | int | `100` | |
8286
| serviceAccountName | string | `"odf-node-label-sa"` | |
8387
| storageSystem.deploy | bool | `false` | |
88+
| storageSystem.inventory.nodeJobLabelSelector | string | `"node-role.kubernetes.io/worker="` | |
8489
| storageSystem.inventory.nodes[0] | string | `"nodeA"` | |
8590
| storageSystem.inventory.nodes[1] | string | `"nodeB"` | |
8691
| storageSystem.inventory.nodes[2] | string | `"nodeC"` | |

README.md.gotmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77

88
### Notable changes
99

10+
* v0.2.3: Allow passing of label selector to labelling job to avoid, for example, labelling submariner nodes.
11+
Also ensure at least 3 nodes are labelled when using label selector.
12+
1013
* v0.2.2: Reconfigure sync ordering to ensure label job runs before attempts to create storagecluster/storagesystem
14+
1115
* v0.2.1: Introduce boolean to configure where mirroring is enabled. Needed for RamenDR. Defaults to false
1216

1317
{{ template "chart.homepageLine" . }}

templates/job-labelNodes.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@ spec:
1919
oc label node {{ . }} cluster.ocs.openshift.io/openshift-storage='' --overwrite
2020
{{- end }}
2121
{{- else }}
22-
oc label nodes -l node-role.kubernetes.io/worker= cluster.ocs.openshift.io/openshift-storage='' --overwrite
22+
oc label nodes -l {{ $.Values.storageSystem.inventory.nodeJobLabelSelector | squote }} cluster.ocs.openshift.io/openshift-storage='' --overwrite
23+
LABELED_COUNT=$(oc get nodes -l cluster.ocs.openshift.io/openshift-storage --no-headers 2>/dev/null | wc -l)
24+
if [ "$LABELED_COUNT" -lt 3 ]; then
25+
echo "Error: Only $LABELED_COUNT node(s) were labeled. At least 3 nodes must be labeled."
26+
exit 1
27+
fi
28+
echo "Successfully labeled $LABELED_COUNT node(s)"
2329
{{- end }}
2430
name: label-storage-nodes
2531
dnsPolicy: ClusterFirst

values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ objectStorage:
7070
#Define the odf storageSystem parameters
7171
storageSystem:
7272
inventory:
73+
nodeJobLabelSelector: 'node-role.kubernetes.io/worker='
7374
useSpecificNodes: true # true/false to label a specific set of nodes to be part of ODF
7475
nodes: # At least specify three nodes
7576
- nodeA

0 commit comments

Comments
 (0)