Skip to content

Commit

Permalink
Add Pulsar standalone persistence (#191)
Browse files Browse the repository at this point in the history
Signed-off-by: quicksilver <[email protected]>
  • Loading branch information
jeffoverflow authored Jul 1, 2021
1 parent 44c2b4f commit bc81680
Show file tree
Hide file tree
Showing 16 changed files with 104 additions and 171 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ jobs:
- name: Run chart-testing (lint)
run: ct lint

- name: Create kind cluster
uses: helm/kind-action@v1.1.0
- name: Create KinD cluster
uses: helm/kind-action@v1.2.0
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install)
Expand Down
2 changes: 1 addition & 1 deletion charts/milvus/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: milvus
appVersion: "2.0.0-rc.1"
kubeVersion: "^1.10.0-0"
description: Milvus is an open-source vector database built to power AI applications and vector similarity search.
version: 2.0.1
version: 2.0.2
keywords:
- milvus
- elastic
Expand Down
16 changes: 16 additions & 0 deletions charts/milvus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@ The following table lists the configurable parameters of the Milvus Standalone c
| `standalone.affinity` | Affinity settings for Milvus Standalone pods assignment | `{}` |
| `standalone.tolerations` | Toleration labels for Milvus Standalone pods assignment | `[]` |
| `standalone.extraEnv` | Additional Milvus Standalone container environment variables | `[]` |
| `standalone.persistence.enabled` | Use persistent volume to store Milvus standalone data | `true` |
| `standalone.persistence.mountPath` | Milvus standalone data persistence volume mount path | `/var/lib/milvus` |
| `standalone.persistence.annotations` | PersistentVolumeClaim annotations | `{}` |
| `standalone.persistence.persistentVolumeClaim.existingClaim` | Use your own data Persistent Volume existing claim name | `unset` |
| `standalone.persistence.persistentVolumeClaim.storageClass` | The Milvus standalone data Persistent Volume Storage Class | `unset` |
| `standalone.persistence.persistentVolumeClaim.accessModes` | The Milvus standalone data Persistence access modes | `ReadWriteOnec` |
| `standalone.persistence.persistentVolumeClaim.size` | The size of Milvus standalone data Persistent Volume Storage Class | `5Gi` |
| `standalone.persistence.persistentVolumeClaim.subPath` | SubPath for Milvus standalone data mount | `unset` |

### Milvus Proxy Deployment Configuration

Expand Down Expand Up @@ -291,6 +299,14 @@ The following table lists the configurable parameters of the Pulsar Standalone c
| `pulsarStandalone.service.loadBalancerIP` | IP address to assign to load balancer (if supported) | `unset` |
| `pulsarStandalone.service.loadBalancerSourceRanges` | List of IP CIDRs allowed access to lb (if supported) | `[]` |
| `pulsarStandalone.service.externalIPs` | Service external IP addresses | `[]` |
| `pulsarStandalone.persistence.enabled` | Use persistent volume to store Pulsar standalone data | `true` |
| `pulsarStandalone.persistence.mountPath` | Pulsar standalone data persistence volume mount path | `/var/lib/milvus` |
| `pulsarStandalone.persistence.annotations` | PersistentVolumeClaim annotations | `{}` |
| `pulsarStandalone.persistence.persistentVolumeClaim.existingClaim` | Use your own data Persistent Volume existing claim name | `unset` |
| `pulsarStandalone.persistence.persistentVolumeClaim.storageClass` | The Pulsar standalone data Persistent Volume Storage Class | `unset` |
| `pulsarStandalone.persistence.persistentVolumeClaim.accessModes` | The Pulsar standalone data Persistence access modes | `ReadWriteOnec` |
| `pulsarStandalone.persistence.persistentVolumeClaim.size` | The size of Pulsar standalone data Persistent Volume Storage Class | `5Gi` |
| `pulsarStandalone.persistence.persistentVolumeClaim.subPath` | SubPath for Pulsar standalone data mount | `unset` |

### Pulsar Configuration

Expand Down
4 changes: 0 additions & 4 deletions charts/milvus/templates/config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,7 @@ dataNode:
log:
level: {{ .Values.log.level }}
file:
{{- if .Values.logsPersistence.enabled }}
rootPath: {{ .Values.logsPersistence.mountPath }}
{{- else }}
rootPath: ""
{{- end }}
maxSize: {{ .Values.log.file.maxSize }}
maxAge: {{ .Values.log.file.maxAge }}
maxBackups: {{ .Values.log.file.maxBackups }}
Expand Down
10 changes: 0 additions & 10 deletions charts/milvus/templates/datacoord-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ spec:
mountPath: /milvus/configs/milvus.yaml
subPath: milvus.yaml
readOnly: true
- name: milvus-logs-disk
mountPath: {{ .Values.logsPersistence.mountPath | quote }}
subPath: {{ .Values.logsPersistence.persistentVolumeClaim.subPath | default "" }}

{{- with .Values.dataCoordinator.nodeSelector }}
nodeSelector:
Expand All @@ -72,11 +69,4 @@ spec:
- name: milvus-config
configMap:
name: {{ template "milvus.fullname" . }}
- name: milvus-logs-disk
{{- if .Values.logsPersistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.logsPersistence.persistentVolumeClaim.existingClaim | default (printf "%s-logs" (include "milvus.fullname" . | trunc 58)) }}
{{- else }}
emptyDir: {}
{{- end }}
{{- end }}
10 changes: 0 additions & 10 deletions charts/milvus/templates/datanode-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ spec:
mountPath: /milvus/configs/milvus.yaml
subPath: milvus.yaml
readOnly: true
- name: milvus-logs-disk
mountPath: {{ .Values.logsPersistence.mountPath | quote }}
subPath: {{ .Values.logsPersistence.persistentVolumeClaim.subPath | default "" }}

{{- with .Values.dataNode.nodeSelector }}
nodeSelector:
Expand All @@ -72,11 +69,4 @@ spec:
- name: milvus-config
configMap:
name: {{ template "milvus.fullname" . }}
- name: milvus-logs-disk
{{- if .Values.logsPersistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.logsPersistence.persistentVolumeClaim.existingClaim | default (printf "%s-logs" (include "milvus.fullname" . | trunc 58)) }}
{{- else }}
emptyDir: {}
{{- end }}
{{- end }}
10 changes: 0 additions & 10 deletions charts/milvus/templates/indexcoord-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ spec:
mountPath: /milvus/configs/milvus.yaml
subPath: milvus.yaml
readOnly: true
- name: milvus-logs-disk
mountPath: {{ .Values.logsPersistence.mountPath | quote }}
subPath: {{ .Values.logsPersistence.persistentVolumeClaim.subPath | default "" }}

{{- with .Values.indexCoordinator.nodeSelector }}
nodeSelector:
Expand All @@ -72,11 +69,4 @@ spec:
- name: milvus-config
configMap:
name: {{ template "milvus.fullname" . }}
- name: milvus-logs-disk
{{- if .Values.logsPersistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.logsPersistence.persistentVolumeClaim.existingClaim | default (printf "%s-logs" (include "milvus.fullname" . | trunc 58)) }}
{{- else }}
emptyDir: {}
{{- end }}
{{- end }}
10 changes: 0 additions & 10 deletions charts/milvus/templates/indexnode-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ spec:
mountPath: /milvus/configs/milvus.yaml
subPath: milvus.yaml
readOnly: true
- name: milvus-logs-disk
mountPath: {{ .Values.logsPersistence.mountPath | quote }}
subPath: {{ .Values.logsPersistence.persistentVolumeClaim.subPath | default "" }}

{{- with .Values.indexNode.nodeSelector }}
nodeSelector:
Expand All @@ -72,11 +69,4 @@ spec:
- name: milvus-config
configMap:
name: {{ template "milvus.fullname" . }}
- name: milvus-logs-disk
{{- if .Values.logsPersistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.logsPersistence.persistentVolumeClaim.existingClaim | default (printf "%s-logs" (include "milvus.fullname" . | trunc 58)) }}
{{- else }}
emptyDir: {}
{{- end }}
{{- end }}
10 changes: 0 additions & 10 deletions charts/milvus/templates/proxy-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ spec:
mountPath: /milvus/configs/milvus.yaml
subPath: milvus.yaml
readOnly: true
- name: milvus-logs-disk
mountPath: {{ .Values.logsPersistence.mountPath | quote }}
subPath: {{ .Values.logsPersistence.persistentVolumeClaim.subPath | default "" }}

{{- with .Values.proxy.nodeSelector }}
nodeSelector:
Expand All @@ -72,11 +69,4 @@ spec:
- name: milvus-config
configMap:
name: {{ template "milvus.fullname" . }}
- name: milvus-logs-disk
{{- if .Values.logsPersistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.logsPersistence.persistentVolumeClaim.existingClaim | default (printf "%s-logs" (include "milvus.fullname" . | trunc 58)) }}
{{- else }}
emptyDir: {}
{{- end }}
{{- end }}
13 changes: 13 additions & 0 deletions charts/milvus/templates/pulsar-standalone-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ spec:
protocol: TCP
resources:
{{- toYaml .Values.pulsarStandalone.resources | nindent 10 }}
volumeMounts:
- name: milvus-pulsar-disk
mountPath: {{ .Values.pulsarStandalone.persistence.mountPath | quote }}
subPath: {{ .Values.pulsarStandalone.persistence.persistentVolumeClaim.subPath | default "" }}

{{- with .Values.pulsarStandalone.nodeSelector }}
nodeSelector:
Expand All @@ -60,4 +64,13 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

volumes:
- name: milvus-pulsar-disk
{{- if .Values.pulsarStandalone.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.pulsarStandalone.persistence.persistentVolumeClaim.existingClaim | default (printf "%s-pulsar" (include "milvus.fullname" . | trunc 58)) }}
{{- else }}
emptyDir: {}
{{- end }}
{{- end }}
22 changes: 10 additions & 12 deletions charts/milvus/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{{- $pvc := .Values.logsPersistence.persistentVolumeClaim -}}
{{- if and .Values.logsPersistence.enabled (not $pvc.existingClaim) }}
{{- if not .Values.cluster.enabled }}
{{- $pvc := .Values.standalone.persistence.persistentVolumeClaim -}}
{{- if and .Values.standalone.persistence.enabled (not $pvc.existingClaim) }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ printf "%s-logs" (include "milvus.fullname" . | trunc 58)}}
{{- with .Values.logsPersistence.annotations }}
name: {{ printf "%s" (include "milvus.fullname" . | trunc 58)}}
{{- with .Values.standalone.persistence.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
Expand All @@ -24,17 +25,14 @@ spec:
requests:
storage: {{ $pvc.size }}
{{- end }}

{{- if not .Values.cluster.enabled }}
{{- $pvc := .Values.persistence.persistentVolumeClaim -}}
{{- if and .Values.persistence.enabled (not $pvc.existingClaim) }}
---

{{- else }}
{{- $pvc := .Values.pulsarStandalone.persistence.persistentVolumeClaim -}}
{{- if and .Values.pulsarStandalone.persistence.enabled (not $pvc.existingClaim) }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ printf "%s" (include "milvus.fullname" . | trunc 58)}}
{{- with .Values.persistence.annotations }}
name: {{ printf "%s-pulsar" (include "milvus.fullname" . | trunc 58)}}
{{- with .Values.pulsarStandalone.persistence.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
Expand Down
10 changes: 0 additions & 10 deletions charts/milvus/templates/querycoord-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ spec:
mountPath: /milvus/configs/milvus.yaml
subPath: milvus.yaml
readOnly: true
- name: milvus-logs-disk
mountPath: {{ .Values.logsPersistence.mountPath | quote }}
subPath: {{ .Values.logsPersistence.persistentVolumeClaim.subPath | default "" }}

{{- with .Values.queryCoordinator.nodeSelector }}
nodeSelector:
Expand All @@ -72,11 +69,4 @@ spec:
- name: milvus-config
configMap:
name: {{ template "milvus.fullname" . }}
- name: milvus-logs-disk
{{- if .Values.logsPersistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.logsPersistence.persistentVolumeClaim.existingClaim | default (printf "%s-logs" (include "milvus.fullname" . | trunc 58)) }}
{{- else }}
emptyDir: {}
{{- end }}
{{- end }}
10 changes: 0 additions & 10 deletions charts/milvus/templates/querynode-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ spec:
mountPath: /milvus/configs/milvus.yaml
subPath: milvus.yaml
readOnly: true
- name: milvus-logs-disk
mountPath: {{ .Values.logsPersistence.mountPath | quote }}
subPath: {{ .Values.logsPersistence.persistentVolumeClaim.subPath | default "" }}

{{- with .Values.queryNode.nodeSelector }}
nodeSelector:
Expand All @@ -72,11 +69,4 @@ spec:
- name: milvus-config
configMap:
name: {{ template "milvus.fullname" . }}
- name: milvus-logs-disk
{{- if .Values.logsPersistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.logsPersistence.persistentVolumeClaim.existingClaim | default (printf "%s-logs" (include "milvus.fullname" . | trunc 58)) }}
{{- else }}
emptyDir: {}
{{- end }}
{{- end }}
10 changes: 0 additions & 10 deletions charts/milvus/templates/rootcoord-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ spec:
mountPath: /milvus/configs/milvus.yaml
subPath: milvus.yaml
readOnly: true
- name: milvus-logs-disk
mountPath: {{ .Values.logsPersistence.mountPath | quote }}
subPath: {{ .Values.logsPersistence.persistentVolumeClaim.subPath | default "" }}

{{- with .Values.rootCoordinator.nodeSelector }}
nodeSelector:
Expand All @@ -72,11 +69,4 @@ spec:
- name: milvus-config
configMap:
name: {{ template "milvus.fullname" . }}
- name: milvus-logs-disk
{{- if .Values.logsPersistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.logsPersistence.persistentVolumeClaim.existingClaim | default (printf "%s-logs" (include "milvus.fullname" . | trunc 58)) }}
{{- else }}
emptyDir: {}
{{- end }}
{{- end }}
18 changes: 4 additions & 14 deletions charts/milvus/templates/standalone-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,8 @@ spec:
subPath: milvus.yaml
readOnly: true
- name: milvus-data-disk
mountPath: {{ .Values.persistence.mountPath | quote }}
subPath: {{ .Values.persistence.persistentVolumeClaim.subPath | default "" }}
- name: milvus-logs-disk
mountPath: {{ .Values.logsPersistence.mountPath | quote }}
subPath: {{ .Values.logsPersistence.persistentVolumeClaim.subPath | default "" }}
mountPath: {{ .Values.standalone.persistence.mountPath | quote }}
subPath: {{ .Values.standalone.persistence.persistentVolumeClaim.subPath | default "" }}

{{- with .Values.standalone.nodeSelector }}
nodeSelector:
Expand All @@ -76,16 +73,9 @@ spec:
configMap:
name: {{ template "milvus.fullname" . }}
- name: milvus-data-disk
{{- if .Values.persistence.enabled }}
{{- if .Values.standalone.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.persistence.persistentVolumeClaim.existingClaim | default (printf "%s" (include "milvus.fullname" . | trunc 58)) }}
{{- else }}
emptyDir: {}
{{- end }}
- name: milvus-logs-disk
{{- if .Values.logsPersistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.logsPersistence.persistentVolumeClaim.existingClaim | default (printf "%s-logs" (include "milvus.fullname" . | trunc 58)) }}
claimName: {{ .Values.standalone.persistence.persistentVolumeClaim.existingClaim | default (printf "%s" (include "milvus.fullname" . | trunc 58)) }}
{{- else }}
emptyDir: {}
{{- end }}
Expand Down
Loading

0 comments on commit bc81680

Please sign in to comment.