nginx-profile-setup/kaproxy/gencerts.sh
Ava Hahn 4acd439e8a get better profileo on worker process
Signed-off-by: Ava Hahn <a.hahn@f5.com>
2025-10-06 16:19:20 +00:00

30 lines
610 B
Bash
Executable file

#!/bin/bash
N=$(nproc --all)
for iter in {0..79}; do
((i=i%N)); ((i++==0)) && wait
echo "minting cert $iter"
openssl req -x509 \
-newkey rsa:4096 \
-keyout key$iter.pem \
-out cert$iter.pem \
-sha256 -nodes \
-days 3650 \
-subj "/C=XX/ST=StateName/L=CityName/O=CompanyName/OU=CompanySectionName/CN=kaproxy-$iter" &
done
for iter in {0..79}; do
echo "
location /$iter {
proxy_ssl_certificate /cert$iter.pem;
proxy_ssl_certificate_key /key$iter.pem;
proxy_pass https://kasvc-$iter:8080;
}" >> /nginx.conf
done
echo '
}
}
' >> /nginx.conf
wait