Skip to content

Commit bf492de

Browse files
authored
Document spec.objectStorage.tls for a Milvus object storage with a private CA (#1089)
Signed-off-by: sabnaj <sabnaj@appscode.com>
1 parent 14797af commit bf492de

3 files changed

Lines changed: 201 additions & 0 deletions

File tree

‎docs/guides/milvus/concepts/milvus.md‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,33 @@ spec:
131131
name: milvus-storage-config
132132
```
133133

134+
### spec.objectStorage.tls
135+
136+
Set `spec.objectStorage.tls` when the object storage serves a certificate signed by a private CA, for example Ceph RGW behind an OpenShift service CA. Without it, Milvus fails with `x509: certificate signed by unknown authority`. This field only configures how Milvus verifies the object storage server. It is separate from [`spec.tls`](/docs/guides/milvus/tls/overview.md), which secures Milvus's own listeners.
137+
138+
Name the CA bundle in exactly one of `caSecret` or `caConfigMap`. Both need a `name` and a `key` that holds the PEM CA certificate, in the same namespace as the Milvus object:
139+
140+
```yaml
141+
spec:
142+
objectStorage:
143+
configSecret:
144+
name: milvus-s3
145+
tls:
146+
caConfigMap:
147+
name: openshift-service-ca.crt # an injected service CA ConfigMap in this namespace
148+
key: service-ca.crt
149+
```
150+
151+
KubeDB mounts the CA at `/milvus/object-storage-ca/ca.crt` in every Milvus pod and sets `minio.useSSL: true` and `minio.ssl.tlsCACert` in the rendered `milvus.yaml`. The endpoint still comes from the object storage secret, so set its `address` and `port` (usually `443`) for the TLS endpoint.
152+
153+
If the same `minio` key is set in more than one place, the last one in this order wins: KubeDB defaults, the object storage secret, `spec.objectStorage.tls`, then `spec.configuration`.
154+
155+
The matching Milvus archiver, backup-plugin and CSI-plugin images also use this CA. They read the effective storage settings from the generated configuration Secret, so inline overrides apply consistently to Milvus and its backup workers. An arbitrary CA path mounted only through `podTemplate` is not accessible to these workers; use `spec.objectStorage.tls` for backup-compatible private-CA configuration.
156+
157+
This is independent of `spec.tls`: Milvus listener TLS can be disabled while HTTPS to object storage remains enabled. A backup destination has its own TLS settings in KubeStash `BackupStorage`; supply that endpoint's CA in the credential Secret under `CA_CERT_DATA`. The two endpoints can use different CAs.
158+
159+
Before restoring into another namespace, create that target's object-storage credential Secret and selected CA Secret or ConfigMap there. Restore uses the target's configuration and does not replace its CA with the source database's CA.
160+
134161
Each Milvus needs its own object storage path: the `rootPath` key of the secret, which defaults to `files`. Before the first pod of a new Milvus starts, KubeDB checks that path. If the meta etcd is empty and the path already holds objects, the Milvus does not start, because it could not write there. KubeDB then sets the `ObjectStorageChecked` condition to `False` with reason `PathInUse`:
135162

136163
```bash

‎docs/guides/milvus/tls/guide.md‎

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,147 @@ $ kubectl exec -it milvus-cluster-proxy-0 -n demo -- \
307307

308308
You should see a successful TLS handshake.
309309

310+
## TLS to the Object Storage
311+
312+
The TLS above secures connections to Milvus. Milvus also connects to the object storage, and if that serves a certificate signed by a private CA, Milvus must trust the CA. Give KubeDB the CA with `spec.objectStorage.tls`.
313+
314+
Create a Secret with the CA certificate (use a ConfigMap and `caConfigMap` if the CA is published that way):
315+
316+
```bash
317+
$ kubectl create secret generic -n demo s3-ca --from-file=ca.crt=./ca.crt
318+
```
319+
320+
Create the object storage secret for the TLS endpoint and the Milvus object:
321+
322+
```yaml
323+
apiVersion: kubedb.com/v1alpha2
324+
kind: Milvus
325+
metadata:
326+
name: milvus-s3-tls
327+
namespace: demo
328+
spec:
329+
version: "2.6.15"
330+
topology:
331+
mode: Standalone
332+
objectStorage:
333+
configSecret:
334+
name: milvus-s3
335+
tls:
336+
caSecret:
337+
name: s3-ca
338+
key: ca.crt
339+
storageType: Durable
340+
storage:
341+
accessModes:
342+
- ReadWriteOnce
343+
resources:
344+
requests:
345+
storage: 10Gi
346+
deletionPolicy: WipeOut
347+
```
348+
349+
The full manifest, with the `milvus-s3` secret, is in [object-storage-tls.yaml](https://github.com/kubedb/docs/raw/{{< param "info.version" >}}/docs/guides/milvus/tls/yamls/object-storage-tls.yaml).
350+
351+
```bash
352+
$ kubectl apply -f https://github.com/kubedb/docs/raw/{{< param "info.version" >}}/docs/guides/milvus/tls/yamls/object-storage-tls.yaml
353+
```
354+
355+
### Independent TLS for backup and restore
356+
357+
`spec.objectStorage.tls` works even when `spec.tls` is omitted. The latter controls connections to Milvus itself; it does not enable or disable HTTPS to the object storage.
358+
359+
Deploy the updated provisioner and webhook API together with Milvus archiver v0.2.1 or later, backup plugin v0.1.1 or later, and CSI plugin v0.2.1 or later. These versions must be published before deploying the corresponding catalog; older worker images do not contain this support. The backup workers read the operator-generated `milvus.yaml` and load the selected CA through the Kubernetes API. The storage-check Job receives a read-only CA mount. No KubeDB-issued listener certificate is needed for object-storage verification.
360+
361+
The backup destination uses the existing KubeStash configuration, independently of the live store:
362+
363+
```yaml
364+
apiVersion: v1
365+
kind: Secret
366+
metadata:
367+
name: backup-storage-credentials
368+
namespace: demo
369+
stringData:
370+
AWS_ACCESS_KEY_ID: <backup-access-key>
371+
AWS_SECRET_ACCESS_KEY: <backup-secret-key>
372+
CA_CERT_DATA: |
373+
<PEM CA bundle for the backup endpoint>
374+
---
375+
apiVersion: storage.kubestash.com/v1alpha1
376+
kind: BackupStorage
377+
metadata:
378+
name: milvus-backups
379+
namespace: demo
380+
spec:
381+
storage:
382+
provider: s3
383+
s3:
384+
endpoint: https://backup.example.com
385+
bucket: milvus-backups
386+
region: us-east-1
387+
secretName: backup-storage-credentials
388+
usagePolicy:
389+
allowedNamespaces:
390+
from: Same
391+
deletionPolicy: Delete
392+
```
393+
394+
The live endpoint and backup endpoint can use different CAs. Physical backup and PITR clients keep separate trust pools. The logical backup plugin gives its external `milvus-backup` process a bundle containing both CAs and the container's normal public roots.
395+
396+
For restore into another namespace or object store, create the target credential and CA resources first. The target's CA is used to write restored data. Existing customer-managed resources are not overwritten from the source backup.
397+
398+
For a physical restore, set the source repository namespace explicitly:
399+
400+
```yaml
401+
spec:
402+
init:
403+
archiver:
404+
fullDBRepository:
405+
name: source-full
406+
namespace: source-namespace
407+
recoveryTimestamp: "2026-11-04T12:00:00Z"
408+
encryptionSecret:
409+
name: backup-encryption
410+
namespace: source-namespace
411+
```
412+
413+
For a logical `RestoreSession`, use `spec.dataSource.namespace` for the source repository and `spec.target.namespace` for the target Milvus. Configure KubeStash usage policies and access for the namespaces involved. The target's object-storage Secret and selected CA must exist in the target namespace; the source CA is not copied over them.
414+
415+
Physical backup, PITR and CSI workers currently require object-storage access keys. IAM-only authentication is not supported by those workers.
416+
417+
418+
### Certificate renewal
419+
420+
New backup and restore jobs load the current CA when they start. The continuous archiver checks configuration and CA changes every minute and reconnects from its last published checkpoint. A bad replacement certificate stops progress rather than disabling verification.
421+
422+
To renew a private CA, first publish a bundle containing both the old and new CA. Restart Milvus pods through the existing restart workflow so they reload trust, then change the storage server certificate. Remove the old CA after clients have switched and restart Milvus again. The mounted file alone does not guarantee that a running Milvus process reloads it.
423+
424+
For OpenShift service certificates, use a ConfigMap annotated with `service.beta.openshift.io/inject-cabundle: "true"` and select its `service-ca.crt` key. The OpenShift service-CA controller owns that bundle.
425+
426+
### Verify
427+
428+
The CA is mounted in the pod and the rendered configuration enables TLS to the object storage:
429+
430+
```bash
431+
$ kubectl exec -n demo milvus-s3-tls-0 -- ls /milvus/object-storage-ca
432+
ca.crt
433+
434+
$ CS=$(kubectl get petset -n demo milvus-s3-tls -o jsonpath='{.spec.template.spec.volumes[?(@.name=="milvus-config")].secret.secretName}')
435+
$ kubectl get secret -n demo $CS -o jsonpath='{.data.milvus\.yaml}' | base64 -d | grep -A12 '^minio:'
436+
minio:
437+
...
438+
ssl:
439+
tlsCACert: /milvus/object-storage-ca/ca.crt
440+
useSSL: true
441+
```
442+
443+
The Milvus pod log has no `x509` errors, and the database becomes `Ready`.
444+
310445
## Cleaning up
311446

312447
```bash
313448
$ kubectl delete milvus.kubedb.com -n demo milvus-standalone
449+
$ kubectl delete milvuses.kubedb.com -n demo milvus-s3-tls --ignore-not-found
450+
$ kubectl delete secret -n demo s3-ca milvus-s3 --ignore-not-found
314451
$ kubectl delete issuer -n demo milvus-issuer
315452
$ kubectl delete secret -n demo milvus-ca
316453
$ kubectl delete ns demo
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: milvus-s3
5+
namespace: demo
6+
stringData:
7+
address: rgw.example.svc.cluster.local
8+
port: "443"
9+
bucketName: milvus
10+
rootPath: files
11+
accessKeyID: <access-key>
12+
secretAccessKey: <secret-key>
13+
---
14+
apiVersion: kubedb.com/v1alpha2
15+
kind: Milvus
16+
metadata:
17+
name: milvus-s3-tls
18+
namespace: demo
19+
spec:
20+
version: "2.6.15"
21+
topology:
22+
mode: Standalone
23+
objectStorage:
24+
configSecret:
25+
name: milvus-s3
26+
tls:
27+
caSecret:
28+
name: s3-ca
29+
key: ca.crt
30+
storageType: Durable
31+
storage:
32+
accessModes:
33+
- ReadWriteOnce
34+
resources:
35+
requests:
36+
storage: 10Gi
37+
deletionPolicy: WipeOut

0 commit comments

Comments
 (0)