-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove public ca and generate ca by operator
Signed-off-by: jooho lee <[email protected]>
- Loading branch information
Showing
13 changed files
with
332 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: ray-tls-script | ||
labels: | ||
opendatahub.io/managed: 'true' | ||
data: | ||
gencert_ray.sh: | | ||
#!/bin/sh | ||
## Create tls.key | ||
openssl genrsa -out /etc/ray/tls/tls.key 2048 | ||
## Write CSR Config | ||
cat > /etc/ray/tls/csr.conf <<EOF | ||
[ req ] | ||
default_bits = 2048 | ||
prompt = no | ||
default_md = sha256 | ||
req_extensions = req_ext | ||
distinguished_name = dn | ||
[ dn ] | ||
C = US | ||
ST = Raleigh | ||
L = North Carolina | ||
O = redhat | ||
OU = redhat | ||
CN = self-signed-cert | ||
[ req_ext ] | ||
subjectAltName = @alt_names | ||
[ alt_names ] | ||
DNS.1 = localhost | ||
DNS.2 = *.${POD_NAMESPACE}.svc.cluster.local | ||
IP.1 = 127.0.0.1 | ||
IP.2 = $POD_IP | ||
EOF | ||
## Create CSR using tls.key | ||
openssl req -new -key /etc/ray/tls/tls.key -out /etc/ray/tls/ca.csr -config /etc/ray/tls/csr.conf | ||
## Write cert config | ||
cat > /etc/ray/tls/cert.conf <<EOF | ||
authorityKeyIdentifier=keyid,issuer | ||
basicConstraints=CA:FALSE | ||
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment | ||
subjectAltName = @alt_names | ||
[alt_names] | ||
DNS.1 = localhost | ||
DNS.2 = *.${POD_NAMESPACE}.svc.cluster.local | ||
IP.1 = 127.0.0.1 | ||
IP.2 = $POD_IP | ||
EOF | ||
## create serial file | ||
echo '01' > /tmp/ca.srl | ||
## Generate tls.cert | ||
openssl x509 -req \ | ||
-in /etc/ray/tls/ca.csr \ | ||
-CA /etc/ca/tls/tls.crt -CAkey /etc/ca/tls/tls.key \ | ||
-CAserial /tmp/ca.srl -out /etc/ray/tls/tls.crt \ | ||
-days 3650 \ | ||
-sha256 -extfile /etc/ray/tls/cert.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.