Skip to content

Commit

Permalink
cert-rotation: CSR approval fixes
Browse files Browse the repository at this point in the history
* print when CSR approval is completed. This helps correlate between
  kubelet logs and csr approval start/end period
* extend time we want for new certs. With leader election
  it takes ~7 minutes for new certs to be generated and distributed,
  so that kubelet could create CSRs after we finish approval.

  This extends timeout we wait for bootstrap certs to be approved from
  30*10/60 = 5 minutes to 40*15/60 = 10 minutes
  • Loading branch information
vrutkovs committed May 13, 2024
1 parent 2359c19 commit d0ec8e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ cat << 'EOZ' > /tmp/approve-csrs-with-timeout.sh
(( required_csrs=${#control_nodes[@]} + ${#compute_nodes[@]} ))
approved_csrs=0
attempts=0
max_attempts=30
max_attempts=40
while (( required_csrs >= approved_csrs )); do
echo -n '.'
mapfile -d ' ' -t csrs < <(oc get csr --field-selector=spec.signerName=${field} --no-headers | grep Pending | cut -f1 -d" ")
Expand All @@ -70,10 +70,11 @@ cat << 'EOZ' > /tmp/approve-csrs-with-timeout.sh
if (( attempts > max_attempts )); then
break
fi
sleep 10s
sleep 15s
done
echo ""
done
echo "Done"
echo "Finished CSR approval at $(date)"
EOZ
chmod a+x /tmp/approve-csrs-with-timeout.sh
timeout ${COMMAND_TIMEOUT} ${SCP} /tmp/approve-csrs-with-timeout.sh "core@${control_nodes[0]}:/tmp/approve-csrs-with-timeout.sh"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ref:
as: openshift-e2e-cert-rotation-suspend
from: baremetal-installer
timeout: 1h30m00s
grace_period: 10m
commands: openshift-e2e-cert-rotation-suspend-commands.sh
resources:
Expand Down

0 comments on commit d0ec8e6

Please sign in to comment.