Skip to content

Commit cc5b70a

Browse files
authored
chore: improve minio tls (#2489)
1 parent 9701daf commit cc5b70a

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

addons/minio/scripts/startup.sh

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,27 @@
22

33
replicas_history_file="/minio-config/MINIO_REPLICAS_HISTORY"
44
bucket_dir="/data"
5+
writable_certs_path="/data/.minio/certs"
56

67
setup_tls_certs() {
7-
if [ "$TLS_ENABLED" = "true" ] && [ -f ${CERTS_PATH}/ca.pem ]; then
8-
echo "Setting up TLS CA certificate for MinIO..."
9-
mkdir -p ${CERTS_PATH}/CAs
10-
cp -L ${CERTS_PATH}/ca.pem ${CERTS_PATH}/CAs/ca.crt
11-
echo "TLS CA certificate setup completed"
8+
if [ "$TLS_ENABLED" = "true" ] && [ -f ${CERTS_PATH}/ca.crt ]; then
9+
echo "Setting up TLS certificates for MinIO..."
10+
11+
# Create writable certs directory
12+
mkdir -p ${writable_certs_path}/CAs
13+
14+
# Copy certificates from read-only mount to writable location
15+
cp -L ${CERTS_PATH}/public.crt ${writable_certs_path}/public.crt
16+
cp -L ${CERTS_PATH}/private.key ${writable_certs_path}/private.key
17+
cp -L ${CERTS_PATH}/ca.crt ${writable_certs_path}/CAs/ca.crt
18+
19+
# Set proper permissions
20+
chmod 600 ${writable_certs_path}/private.key
21+
22+
# Override CERTS_PATH to use writable location
23+
export CERTS_PATH=${writable_certs_path}
24+
25+
echo "TLS certificates setup completed at ${writable_certs_path}"
1226
fi
1327
}
1428

addons/minio/templates/cmpd.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ spec:
104104
tls:
105105
volumeName: tls
106106
mountPath: {{ .Values.certsPath | quote }}
107-
caFile: ca.pem
107+
caFile: ca.crt
108108
certFile: public.crt
109109
keyFile: private.key
110110
roles:

0 commit comments

Comments
 (0)