Skip to content

Commit eae0eb2

Browse files
committed
drain: adding 'USE_EXTERNAL_DRAINER' provoding an option to enable/disable SRIOV OP drain controller, in favor of using maintenance OP to drive node drain aspects
Signed-off-by: Ido Heyvi <[email protected]>
1 parent 1144951 commit eae0eb2

File tree

6 files changed

+13
-7
lines changed

6 files changed

+13
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ nodes in parallel from the pool the operator can drain in parallel. maxUnavailab
464464

465465
> **NOTE**: If a node is not part of any pool it will have a default configuration of maxUnavailable 1
466466

467-
> **NOTE**: Internal drain controller can be disabled by exposing the following `USE_MAINTENANCE_OPERATOR_DRAINER` env variable. This means that drain operations will be done externally, utilizing [NVIDIA maintenance OP](https://github.com/Mellanox/maintenance-operator). In addition, `SriovNetworkPoolConfig` will not take any effect during drain procedure, since the maintenance operator will be in charge of [parallel node operations](https://github.com/Mellanox/maintenance-operator/blob/main/api/v1alpha1/maintenanceoperatorconfig_types.go#L38-L46).
467+
> **NOTE**: Internal drain controller can be disabled by exposing the following `USE_EXTERNAL_DRAINER` env variable. This means that drain operations will be done externally, for example by utilizing [NVIDIA maintenance OP](https://github.com/Mellanox/maintenance-operator). In addition, `SriovNetworkPoolConfig` will not take any effect during drain procedure, since the maintenance operator will be in charge of [parallel node operations](https://github.com/Mellanox/maintenance-operator/blob/main/api/v1alpha1/maintenanceoperatorconfig_types.go#L38-L46).
468468

469469
#### RDMA Mode Configuration
470470

deployment/sriov-network-operator-chart/templates/operator.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ spec:
8686
value: {{ .Values.operator.metricsExporter.certificates.secretName }}
8787
- name: METRICS_EXPORTER_KUBE_RBAC_PROXY_IMAGE
8888
value: {{ .Values.images.metricsExporterKubeRbacProxy }}
89-
- name: USE_MAINTENANCE_OPERATOR_DRAINER
90-
value: {{ .Values.operator.maintenanceOperatorDrainer.enabled | quote }}
89+
- name: USE_EXTERNAL_DRAINER
90+
value: {{ .Values.operator.externalDrainer.enabled | quote }}
9191
{{- if .Values.operator.metricsExporter.prometheusOperator.enabled }}
9292
- name: METRICS_EXPORTER_PROMETHEUS_OPERATOR_ENABLED
9393
value: {{ .Values.operator.metricsExporter.prometheusOperator.enabled | quote}}

deployment/sriov-network-operator-chart/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ operator:
4040
serviceAccount: "prometheus-k8s"
4141
namespace: "monitoring"
4242
deployRules: false
43-
# use external drain controller, utilizing NVIDIA maintenance operator
44-
maintenanceOperatorDrainer:
43+
# use external drain controller, for example utilizing NVIDIA maintenance operator
44+
externalDrainer:
4545
enabled: false
4646
admissionControllers:
4747
enabled: false

doc/design/parallel-node-config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Node annotation, `sriovnetwork.openshift.io/state` and SriovNetworkNodeState ann
6060

6161
*NOTE:* In the future we are going to drop the node annotation and only use the SriovNetworkNodeState
6262

63-
*NOTE:* Internal drain controller can be disabled by exposing the following `USE_MAINTENANCE_OPERATOR_DRAINER` env variable. This means that drain operations will be done externally, utilizing [NVIDIA maintenance OP](https://github.com/Mellanox/maintenance-operator). In addition, `SriovNetworkPoolConfig` will not take any effect during drain procedure, since the maintenance operator will be in charge of parallel node operations.
63+
*NOTE:* Internal drain controller can be disabled by exposing the following `USE_EXTERNAL_DRAINER` env variable. This means that drain operations will be done externally, for example by utilizing [NVIDIA maintenance OP](https://github.com/Mellanox/maintenance-operator). In addition, `SriovNetworkPoolConfig` will not take any effect during drain procedure, since the maintenance operator will be in charge of parallel node operations.
6464

6565
Draining procedure:
6666

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ func main() {
273273

274274
func setupDrainController(mgr ctrl.Manager, restConfig *rest.Config,
275275
platformsHelper platforms.Interface, scheme *runtime.Scheme) error {
276-
if controllers.UseMaintenanceOperatorDrainer() {
276+
if vars.UseExternalDrainer {
277277
setupLog.Info("internal drain controller is disabled, draining will be done externally by the maintenance operator")
278278
return nil
279279
}

pkg/vars/vars.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ var (
9595

9696
// FeatureGates interface to interact with feature gates
9797
FeatureGate featuregate.FeatureGate
98+
99+
// UseExternalDrainer controls if SRIOV operator will use an external drainer
100+
// for draining nodes or its internal drain controller (default)
101+
UseExternalDrainer bool
98102
)
99103

100104
func init() {
@@ -117,4 +121,6 @@ func init() {
117121
ResourcePrefix = os.Getenv("RESOURCE_PREFIX")
118122

119123
FeatureGate = featuregate.New()
124+
125+
UseExternalDrainer = os.Getenv("USE_EXTERNAL_DRAINER") == "true"
120126
}

0 commit comments

Comments
 (0)