Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate readreplica chart #2283

Merged
merged 10 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 10 additions & 0 deletions Makefile.d/helm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ charts/vald-helm-operator/README.md: \
charts/vald-helm-operator/values.yaml
helm-docs

.PHONY: helm/docs/vald-readreplica
helm/docs/vald-readreplica: charts/vald-readreplica/README.md

# force to rebuild
.PHONY: charts/vald-readreplica/README.md
charts/vald-readreplica/README.md: \
charts/vald-readreplica/README.md.gotmpl \
charts/vald-readreplica/values.yaml
helm-docs

.PHONY: helm/schema/vald
## generate json schema for Vald Helm Chart
helm/schema/vald: charts/vald/values.schema.json
Expand Down
22 changes: 21 additions & 1 deletion charts/vald-helm-operator/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,5 +187,25 @@ rules:
- patch
- update
- watch

- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshots
verbs:
- get
- list
- watch
- create
- delete
- patch
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- get
- list
- watch
- create
- delete
{{- end }}
23 changes: 23 additions & 0 deletions charts/vald-readreplica/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
46 changes: 46 additions & 0 deletions charts/vald-readreplica/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#
# Copyright (C) 2019-2024 vdaas.org vald team <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

apiVersion: v2
name: vald-readreplica
version: v1.7.10
description: A helm chart for readreplica add-on
type: application
keywords:
- Vald
- NGT
- vector
- search
- approximate-nearest-neighbor-search
- nearest-neighbor-search
- vector-search-engine
- similarity-search
- image-search
- Kubernetes
- k8s
- AI
- artificial-intelligence
home: https://vald.vdaas.org
icon: https://raw.githubusercontent.com/vdaas/vald/main/assets/image/svg/symbol.svg
sources:
- https://github.com/vdaas/vald
maintainers:
- name: kpango
email: [email protected]
- name: ykadowak
email: [email protected]
- name: kmrmt
email: [email protected]
33 changes: 33 additions & 0 deletions charts/vald-readreplica/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Vald Read Replica

**THIS CHART IS A WORK IN PROGRESS AND IS NOT YET FUNCTIONAL**

This is a Helm chart to install Vald readreplica components.

Current chart version is `v1.7.10`

## Install

Add Vald Helm repository

$ helm repo add vald https://vald.vdaas.org/charts

Install Vald cluster first.

$ helm install vald vald/vald
ykadowak marked this conversation as resolved.
Show resolved Hide resolved

Run the following command to install the chart,

$ helm install vald-readreplica vald/vald-readreplica

## Configuration

### Overview

[`values.yaml`](https://github.com/vdaas/vald/blob/main/charts/vald-readreplica/values.yaml)
of this chart is a symbolic link to the [`values.yaml`](https://github.com/vdaas/vald/blob/main/charts/vald/values.yaml) of the main vald chart
because all the configurations must be synced with the main vald cluster.
So please look at the document of the main vald chart for configurations.

When you deploy this chart with custom `values.yaml` on install, you should deploy the vald
cluster with the same `values.yaml` as well.
34 changes: 34 additions & 0 deletions charts/vald-readreplica/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Vald Read Replica

**THIS CHART IS A WORK IN PROGRESS AND IS NOT YET FUNCTIONAL**

This is a Helm chart to install Vald readreplica components.

Current chart version is `{{ template "chart.version" . }}`

## Install

Add Vald Helm repository

$ helm repo add vald https://vald.vdaas.org/charts

Install Vald cluster first.

$ helm install vald vald/vald

Run the following command to install the chart,

$ helm install vald-readreplica vald/vald-readreplica


## Configuration

### Overview

[`values.yaml`](https://github.com/vdaas/vald/blob/main/charts/vald-readreplica/values.yaml)
of this chart is a symbolic link to the [`values.yaml`](https://github.com/vdaas/vald/blob/main/charts/vald/values.yaml) of the main vald chart
because all the configurations must be synced with the main vald cluster.
So please look at the document of the main vald chart for configurations.

When you deploy this chart with custom `values.yaml` on install, you should deploy the vald
cluster with the same `values.yaml` as well.
4 changes: 4 additions & 0 deletions charts/vald-readreplica/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Release {{ .Release.Name }} is created.

Readreplica feature is intended to be used with the main vald chart.
Please look at the document of the main chart for more details.
1 change: 1 addition & 0 deletions charts/vald-readreplica/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
{{- $values := .Values -}}
{{- $agent := .Values.agent -}}
{{- $readreplica := .Values.agent.readreplica -}}
{{- $defaults := .Values.defaults -}}
Expand Down Expand Up @@ -63,7 +64,7 @@ spec:
{{- if $agent.initContainers }}
initContainers:
{{- if $agent.initContainers }}
{{- $initContainers := dict "initContainers" $agent.initContainers "Values" .Values "namespace" .Release.Namespace -}}
{{- $initContainers := dict "initContainers" $agent.initContainers "Values" $values "namespace" $release.Namespace -}}
{{- include "vald.initContainers" $initContainers | trim | nindent 8 }}
{{- end }}
{{- end }}
Expand Down Expand Up @@ -135,6 +136,9 @@ spec:
- name: {{ $readreplica.volume_name }}
persistentVolumeClaim:
claimName: {{ $readreplica.name }}-pvc-{{ $id }}
{{- if $agent.volumes }}
{{- toYaml $agent.volumes | nindent 8 }}
{{- end }}
{{- if $agent.nodeName }}
nodeName: {{ $agent.nodeName }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ spec:
- ReadOnlyMany
resources:
requests:
storage: 1Gi
storage: {{ $agent.persistentVolume.size }}
dataSource:
name: {{ $readreplica.name }}-snapshot-{{ $id }}
kind: VolumeSnapshot
apiGroup: snapshot.storage.k8s.io
storageClassName: {{ $agent.persistentVolume.storageClass }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ metadata:
{{ $readreplica.label_key }}: "{{ $id }}"
name: {{ $readreplica.name }}-snapshot-{{ $id }}
spec:
volumeSnapshotClassName: csi-hostpath-snapclass
volumeSnapshotClassName: {{ $readreplica.snapshot_classname }}
source:
# Specify the PVCs for which you want to take snapshots
persistentVolumeClaimName: {{ $agent.name }}-pvc-{{ $agent.name }}-{{ $id }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ spec:
app: {{ $readreplica.name }}-{{ $id }}
app.kubernetes.io/name: {{ $valdname }}
type: ClusterIP
clusterIP: None
{{- if $agent.externalTrafficPolicy }}
externalTrafficPolicy: {{ $agent.externalTrafficPolicy }}
{{- end }}
Expand Down
1 change: 1 addition & 0 deletions charts/vald-readreplica/values.schema.json
Loading
Loading