Skip to content

Commit 86e948e

Browse files
committed
intra-cluster-tls: restore setup.sh, fix README
1 parent 1af0156 commit 86e948e

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

Diff for: docs/examples/mtls-inter-node/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@ OpenSSL command line tools. This methodology helps narrow down connectivity issu
6565
In the context of Kubernetes, OpenSSL CLI tools can be run on RabbitMQ nodes using `kubectl exec`, e.g.:
6666

6767
``` shell
68-
kubectl exec -it tls-server-0 -- openssl s_client -connect tls-nodes.examples.svc.cluster.local:25672 </dev/null
68+
kubectl exec -it mtls-inter-node-server-0 -- openssl s_client -connect mtls-inter-node-nodes.examples.svc.cluster.local:25672 </dev/null
6969
```

Diff for: docs/examples/mtls-inter-node/setup.sh

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
OPENSSL=${OPENSSL:-openssl}
4+
5+
# Generate CA certificate and key
6+
#
7+
# These commands do not work with LibreSSL which is shipped with MacOS. Please use openssl
8+
#
9+
if $OPENSSL version | grep -q LibreSSL; then
10+
echo "Please do not use LibreSSL. Set OPENSSL variable to actual OpenSSL binary."
11+
exit 1
12+
fi
13+
14+
$OPENSSL genrsa -out rabbitmq-ca-key.pem 2048
15+
$OPENSSL req -x509 -new -nodes -key rabbitmq-ca-key.pem -subj "/CN=mtls-inter-node" -days 3650 -reqexts v3_req -extensions v3_ca -out rabbitmq-ca.pem
16+
17+
# Create a CA secret
18+
kubectl create secret tls rabbitmq-ca --cert=rabbitmq-ca.pem --key=rabbitmq-ca-key.pem
19+
20+
# Create an Issuer (Cert Manager CA)
21+
kubectl apply -f rabbitmq-ca.yaml
22+
23+
# Create a certificate for the cluster
24+
kubectl apply -f rabbitmq-certificate.yaml
25+
26+
# Create a configuration file for Erlang Distribution
27+
kubectl create configmap mtls-inter-node-tls-config --from-file=inter_node_tls.config
28+
29+
# Deploy the RabbitMQ cluster
30+
kubectl apply -f rabbitmq.yaml

0 commit comments

Comments
 (0)