nginx-profile-setup/kaproxy/gencerts.sh
Ava Hahn 78baa850a8 fixes for worker process profiling
Signed-off-by: Ava Hahn <a.hahn@f5.com>
2025-09-18 00:04:23 +00:00

29 lines
627 B
Bash
Executable file

#!/bin/bash
N=$(nproc --all)
for iter in {0..999}; 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..999}; do
upstr=$(($iter%10))
echo "
location /$iter {
proxy_ssl_certificate /cert$iter.pem;
proxy_ssl_certificate_key /key$iter.pem;
proxy_pass http://kasvc-$upstr:8080;
}" >> /nginx.conf
done
echo '
}
}
' >> /nginx.conf