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

support ctr to generate ssl certs #4068

Merged
merged 1 commit into from
May 22, 2024
Merged
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: 9 additions & 1 deletion dist/images/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,15 @@ if [[ $ENABLE_SSL = "true" ]];then
echo "[Step 0/6] Generate SSL key and cert"
exist=$(kubectl get secret -n kube-system kube-ovn-tls --ignore-not-found)
if [[ $exist == "" ]];then
docker run --rm -v "$PWD":/etc/ovn $REGISTRY/kube-ovn:$VERSION bash generate-ssl.sh
if command -v docker &> /dev/null; then
docker run --rm -v "$PWD":/etc/ovn $REGISTRY/kube-ovn:$VERSION bash generate-ssl.sh
elif command -v ctr &> /dev/null; then
ctr image pull $REGISTRY/kube-ovn:$VERSION
ctr run --rm --mount type=bind,src="$PWD",dst=/etc/ovn,options=rbind:rw $REGISTRY/kube-ovn:$VERSION 0 bash generate-ssl.sh
else
echo "ERROR: No docker or ctr found"
exit 1
fi
kubectl create secret generic -n kube-system kube-ovn-tls --from-file=cacert=cacert.pem --from-file=cert=ovn-cert.pem --from-file=key=ovn-privkey.pem
rm -rf cacert.pem ovn-cert.pem ovn-privkey.pem ovn-req.pem
fi
Expand Down
Loading