Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dind: ensure node certs are generated serially #11298

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions images/dind/node/openshift-generate-node-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ function ensure-node-config() {
local ip_addr
ip_addr="$(ip addr | grep inet | grep eth0 | awk '{print $2}' | sed -e 's+/.*++')"

# Hold a lock on the shared volume to ensure cert generation is
# performed serially. Cert generation is not compatible with
# concurrent execution since the file passed to --signer-serial
# needs to be incremented by each invocation.
exec 200>"${config_path}"/.openshift-generate-node-config.exclusivelock
flock 200

/usr/local/bin/openshift admin create-node-config \
--node-dir="${config_path}" \
--node="${host}" \
Expand All @@ -51,6 +58,9 @@ function ensure-node-config() {
--signer-cert="${master_config_path}/ca.crt" \
--signer-key="${master_config_path}/ca.key" \
--signer-serial="${master_config_path}/ca.serial.txt"

# Release the lock
flock -o
fi

# Deploy the node config
Expand Down