Skip to content

Commit 7c00760

Browse files
Merge pull request #8391 from honza/leader-election
OCPBUGS-33493: Enable leader election for baremetal operator
2 parents dcd7435 + a881de9 commit 7c00760

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

data/data/bootstrap/baremetal/files/etc/containers/systemd/metal3-baremetal-operator.container

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ After=network-online.target ironic-volume.service build-ironic-env.service image
88
[Container]
99
ContainerName=baremetal-operator
1010
Image=$METAL3_BAREMETAL_OPERATOR_IMAGE
11-
Exec=/baremetal-operator -build-preprov-image -webhook-port 0
11+
Exec=/baremetal-operator -build-preprov-image -webhook-port 0 -enable-leader-election -namespace openshift-machine-api
1212
Network=host
1313
Volume=${AUTH_DIR}:/auth:z,ro
1414
Volume=/opt/openshift:/opt/openshift:z,ro
@@ -19,6 +19,9 @@ Environment="IRONIC_KERNEL_PARAMS=${IRONIC_KERNEL_PARAMS}"
1919
Environment="HTTP_PORT=${HTTP_PORT}"
2020
Environment="IRONIC_ENDPOINT=${IRONIC_ENDPOINT}"
2121
Environment="IRONIC_EXTERNAL_URL_V6=${IRONIC_EXTERNAL_URL_V6}"
22+
Environment="LEASE_DURATION_SECONDS=137"
23+
Environment="RENEW_DEADLINE_SECONDS=107"
24+
Environment="RETRY_PERIOD_SECONDS=26"
2225

2326
[Service]
2427
EnvironmentFile=/etc/metal3.env

data/data/bootstrap/baremetal/files/usr/local/bin/master-bmh-update.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ while systemctl is-active metal3-baremetal-operator.service; do
2525
sleep 10
2626
done
2727

28-
echo "Unpause provisioning"
29-
while ! oc annotate --overwrite provisioning provisioning-configuration "provisioning.metal3.io/paused-" ; do
30-
sleep 5
31-
echo "Unpause failed, retrying"
32-
done
33-
3428
echo "Unpause all baremetal hosts"
3529
while ! oc annotate --overwrite -n openshift-machine-api baremetalhosts --all "baremetalhost.metal3.io/paused-" ; do
3630
sleep 5

data/data/manifests/openshift/baremetal-provisioning-config.yaml.template

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ apiVersion: metal3.io/v1alpha1
22
kind: Provisioning
33
metadata:
44
name: provisioning-configuration
5-
annotations:
6-
# We want to pause the metal3 provisioning services until we can be sure
7-
# that all control plane nodes are ready.
8-
provisioning.metal3.io/paused: "true"
95
spec:
106
provisioningInterface: "{{.Baremetal.ProvisioningNetworkInterface}}"
117
provisioningIP: "{{.Baremetal.ClusterProvisioningIP}}"

0 commit comments

Comments
 (0)