Skip to content

Commit

Permalink
support ctr to generate ssl certs (#4068)
Browse files Browse the repository at this point in the history
Signed-off-by: oilbeater <[email protected]>
  • Loading branch information
oilbeater committed May 22, 2024
1 parent 66f6144 commit 08e3c56
Showing 1 changed file with 9 additions and 1 deletion.
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

0 comments on commit 08e3c56

Please sign in to comment.