Skip to content

Commit b065c21

Browse files
authored
fix(stack/minio-tls): Enable tls and remove broken config (#177)
* fix(stack/minio-tls): Enable tls This adds a bunch of settings, but also breaks the configuration. The next commit will remove the broken part * chore(stack/minio-tls): Override command to copy certs to the correct names * fix(stack/minio-tls): Manually mount certs - Remove the invalid Secret mount - Add mounts for secret-operator to store certs - Override Job commands to place CA certs in the right place
1 parent 00fbe76 commit b065c21

File tree

2 files changed

+89
-13
lines changed

2 files changed

+89
-13
lines changed

stacks/_templates/minio-tls/rendered-chart.yaml

Lines changed: 55 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ data:
135135
}
136136
137137
# Try connecting to MinIO instance
138-
scheme=http
138+
scheme=https
139139
connectToMinio $scheme
140140
141141
@@ -223,7 +223,7 @@ data:
223223
}
224224
225225
# Try connecting to MinIO instance
226-
scheme=http
226+
scheme=https
227227
connectToMinio $scheme
228228
229229
@@ -291,7 +291,7 @@ data:
291291
}
292292
293293
# Try connecting to MinIO instance
294-
scheme=http
294+
scheme=https
295295
connectToMinio $scheme
296296
297297
@@ -372,7 +372,7 @@ data:
372372
}
373373
374374
# Try connecting to MinIO instance
375-
scheme=http
375+
scheme=https
376376
connectToMinio $scheme
377377
378378
@@ -418,7 +418,7 @@ data:
418418
}
419419
420420
# Try connecting to MinIO instance
421-
scheme=http
421+
scheme=https
422422
connectToMinio $scheme
423423
---
424424
# Source: minio/templates/pvc.yaml
@@ -452,7 +452,7 @@ spec:
452452
type: NodePort
453453
externalTrafficPolicy: "Cluster"
454454
ports:
455-
- name: http
455+
- name: https
456456
port: 9001
457457
protocol: TCP
458458
targetPort: 9001
@@ -475,7 +475,7 @@ spec:
475475
type: NodePort
476476
externalTrafficPolicy: "Cluster"
477477
ports:
478-
- name: http
478+
- name: https
479479
port: 9000
480480
protocol: TCP
481481
targetPort: 9000
@@ -514,7 +514,7 @@ spec:
514514
stackable.tech/vendor: Stackable
515515
annotations:
516516
checksum/secrets: fa63e34a92c817c84057e2d452fa683e66462a57b0529388fb96a57e05f38e57
517-
checksum/config: 2b1e6b6d0485236a84032ab7e9eeee4a7bac29d2b63d3b0260bde76e84626730
517+
checksum/config: ebea49cc4c1bfbd1b156a58bf770a776ff87fe199f642d31c2816b5515112e72
518518
spec:
519519
securityContext:
520520

@@ -549,9 +549,9 @@ spec:
549549
- mountPath: /etc/minio/certs
550550
name: certs
551551
ports:
552-
- name: http
552+
- name: https
553553
containerPort: 9000
554-
- name: http-console
554+
- name: https-console
555555
containerPort: 9001
556556
env:
557557
- name: MINIO_ROOT_USER
@@ -579,7 +579,7 @@ spec:
579579
- name: minio-user
580580
secret:
581581
secretName: minio
582-
582+
583583
- ephemeral:
584584
volumeClaimTemplate:
585585
metadata:
@@ -633,12 +633,38 @@ spec:
633633
name: minio
634634
- secret:
635635
name: minio
636+
- ephemeral:
637+
volumeClaimTemplate:
638+
metadata:
639+
annotations:
640+
secrets.stackable.tech/class: tls
641+
secrets.stackable.tech/scope: service=minio
642+
spec:
643+
accessModes:
644+
- ReadWriteOnce
645+
resources:
646+
requests:
647+
storage: 1
648+
storageClassName: secrets.stackable.tech
649+
name: tls
650+
- emptyDir:
651+
medium: Memory
652+
sizeLimit: 5Mi
653+
name: certs
636654
serviceAccountName: minio-sa
637655
containers:
638656
- name: minio-make-bucket
639657
image: "quay.io/minio/mc:RELEASE.2024-11-21T17-21-54Z"
640658
imagePullPolicy: IfNotPresent
641-
command: [ "/bin/sh", "/config/initialize" ]
659+
command:
660+
- "/bin/sh"
661+
- "-ce"
662+
- |
663+
# Copy the CA cert from the "tls" SecretClass
664+
# mkdir -p /etc/minio/mc/certs/CAs
665+
cp -v /etc/minio/mc/original_certs/ca.crt /etc/minio/mc/certs/CAs/public.crt
666+
667+
. /config/initialize
642668
env:
643669
- name: MINIO_ENDPOINT
644670
value: minio
@@ -651,13 +677,25 @@ spec:
651677
mountPath: /tmp
652678
- name: minio-configuration
653679
mountPath: /config
680+
- name: tls
681+
mountPath: /etc/minio/mc/original_certs
682+
- name: certs
683+
mountPath: /etc/minio/mc/certs/CAs
654684
resources:
655685
requests:
656686
memory: 128Mi
657687
- name: minio-make-user
658688
image: "quay.io/minio/mc:RELEASE.2024-11-21T17-21-54Z"
659689
imagePullPolicy: IfNotPresent
660-
command: [ "/bin/sh", "/config/add-user" ]
690+
command:
691+
- "/bin/sh"
692+
- "-ce"
693+
- |
694+
# Copy the CA cert from the "tls" SecretClass
695+
# mkdir -p /etc/minio/mc/certs/CAs
696+
cp -v /etc/minio/mc/original_certs/ca.crt /etc/minio/mc/certs/CAs/public.crt
697+
698+
. /config/add-user
661699
env:
662700
- name: MINIO_ENDPOINT
663701
value: minio
@@ -670,6 +708,10 @@ spec:
670708
mountPath: /tmp
671709
- name: minio-configuration
672710
mountPath: /config
711+
- name: tls
712+
mountPath: /etc/minio/mc/original_certs
713+
- name: certs
714+
mountPath: /etc/minio/mc/certs/CAs
673715
resources:
674716
requests:
675717
memory: 128Mi

stacks/_templates/minio-tls/values.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ service:
2020
consoleService:
2121
type: NodePort
2222
nodePort: null
23+
tls:
24+
enabled: true
2325
extraVolumes:
2426
# Request a TLS certificate from the secret-operator
2527
- name: tls
@@ -49,3 +51,35 @@ extraVolumeMounts:
4951
# On startup, we will rename the certs and move them here:
5052
- mountPath: /etc/minio/certs
5153
name: certs
54+
55+
customCommandJob:
56+
extraVolumes:
57+
# Request a TLS certificate from the secret-operator
58+
- name: tls
59+
ephemeral:
60+
volumeClaimTemplate:
61+
metadata:
62+
annotations:
63+
secrets.stackable.tech/class: tls
64+
secrets.stackable.tech/scope: |-
65+
service=minio
66+
spec:
67+
storageClassName: secrets.stackable.tech
68+
accessModes:
69+
- ReadWriteOnce
70+
resources:
71+
requests:
72+
storage: 1
73+
# Create an in-memory emptyDir to copy the certs to (to avoid permission errors)
74+
- name: certs
75+
emptyDir:
76+
sizeLimit: 5Mi
77+
medium: Memory
78+
# WARNING: this is currently only used by the custom-scripts job container. Other containers do not mount these.
79+
extraVolumeMounts:
80+
# Mount the certificate generated by the secret-operator
81+
- name: tls
82+
mountPath: /etc/minio/mc/original_certs
83+
# On startup, we will rename the certs and move them here:
84+
- mountPath: /etc/minio/mc/certs/CAs
85+
name: certs

0 commit comments

Comments
 (0)