Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/guides/milvus/concepts/milvus.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,29 @@ spec:
name: milvus-storage-config
```

### spec.objectStorage.tls

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.

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:

```yaml
spec:
objectStorage:
configSecret:
name: milvus-s3
tls:
caConfigMap:
name: openshift-service-ca.crt # created in every OpenShift namespace
key: service-ca.crt
```

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.

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`.

> Backup and restore jobs that read the object storage directly do not use this CA yet.

### spec.metaStorage

Milvus uses etcd as its metadata store.
Expand Down
64 changes: 64 additions & 0 deletions docs/guides/milvus/tls/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,70 @@ $ kubectl exec -it milvus-cluster-proxy-0 -n demo -- \

You should see a successful TLS handshake.

## TLS to the Object Storage

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`.

Create a Secret with the CA certificate (use a ConfigMap and `caConfigMap` if the CA is published that way):

```bash
$ kubectl create secret generic -n demo s3-ca --from-file=ca.crt=./ca.crt
```

Create the object storage secret for the TLS endpoint and the Milvus object:

```yaml
apiVersion: kubedb.com/v1alpha2
kind: Milvus
metadata:
name: milvus-s3-tls
namespace: demo
spec:
version: "2.6.15"
topology:
mode: Standalone
objectStorage:
configSecret:
name: milvus-s3
tls:
caSecret:
name: s3-ca
key: ca.crt
storageType: Durable
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
deletionPolicy: WipeOut
```

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).

```bash
$ kubectl apply -f https://github.com/kubedb/docs/raw/{{< param "info.version" >}}/docs/guides/milvus/tls/yamls/object-storage-tls.yaml
```

### Verify

The CA is mounted in the pod and the rendered configuration enables TLS to the object storage:

```bash
$ kubectl exec -n demo milvus-s3-tls-0 -- ls /milvus/object-storage-ca
ca.crt

$ CS=$(kubectl get petset -n demo milvus-s3-tls -o jsonpath='{.spec.template.spec.volumes[?(@.name=="milvus-config")].secret.secretName}')
$ kubectl get secret -n demo $CS -o jsonpath='{.data.milvus\.yaml}' | base64 -d | grep -A12 '^minio:'
minio:
...
ssl:
tlsCACert: /milvus/object-storage-ca/ca.crt
useSSL: true
```

The Milvus pod log has no `x509` errors, and the database becomes `Ready`.

## Cleaning up

```bash
Expand Down
37 changes: 37 additions & 0 deletions docs/guides/milvus/tls/yamls/object-storage-tls.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: v1
kind: Secret
metadata:
name: milvus-s3
namespace: demo
stringData:
address: rgw.example.svc.cluster.local
port: "443"
bucketName: milvus
rootPath: files
accessKeyID: <access-key>
secretAccessKey: <secret-key>
---
apiVersion: kubedb.com/v1alpha2
kind: Milvus
metadata:
name: milvus-s3-tls
namespace: demo
spec:
version: "2.6.15"
topology:
mode: Standalone
objectStorage:
configSecret:
name: milvus-s3
tls:
caSecret:
name: s3-ca
key: ca.crt
storageType: Durable
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
deletionPolicy: WipeOut
Loading