-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add hpa for read replica * Update schema * Add read replica flag to agent ngt to skip save index when it's read replica instance * Refactor * Add tests for Close * enable readreplica hpa on e2e * Add error handling for write operation to read replica in CreateIndex and saveIndex
- Loading branch information
Showing
16 changed files
with
1,182 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# | ||
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org> | ||
# | ||
# 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. | ||
# | ||
{{- $agent := .Values.agent -}} | ||
{{- $readreplica := .Values.agent.readreplica -}} | ||
{{- if $agent.enabled }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ $readreplica.name }}-config | ||
labels: | ||
app.kubernetes.io/name: {{ include "vald.name" . }} | ||
helm.sh/chart: {{ include "vald.chart" . }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/version: {{ .Chart.Version }} | ||
app.kubernetes.io/component: agent | ||
data: | ||
config.yaml: | | ||
--- | ||
version: {{ $agent.version }} | ||
time_zone: {{ default .Values.defaults.time_zone $agent.time_zone }} | ||
logging: | ||
{{- $logging := dict "Values" $agent.logging "default" .Values.defaults.logging }} | ||
{{- include "vald.logging" $logging | nindent 6 }} | ||
server_config: | ||
{{- $servers := dict "Values" $agent.server_config "default" .Values.defaults.server_config }} | ||
{{- include "vald.servers" $servers | nindent 6 }} | ||
observability: | ||
{{- $observability := dict "Values" $agent.observability "default" .Values.defaults.observability }} | ||
{{- include "vald.observability" $observability | nindent 6 }} | ||
ngt: | ||
{{- toYaml $agent.ngt | nindent 6 }} | ||
is_readreplica: true | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# | ||
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org> | ||
# | ||
# 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. | ||
# | ||
{{- $agent := .Values.agent -}} | ||
{{- $readreplica := .Values.agent.readreplica -}} | ||
{{- $defaults := .Values.defaults -}} | ||
{{- $release := .Release -}} | ||
{{- $chart := .Chart -}} | ||
{{- $valdname := include "vald.name" . -}} | ||
{{- $valdchart := include "vald.chart" . -}} | ||
{{- $cap := .Capabilities -}} | ||
{{- if and $readreplica.enabled $readreplica.hpa.enabled }} | ||
{{ range $id := until (int $agent.minReplicas) }} | ||
--- | ||
{{- if ($cap.APIVersions.Has "autoscaling/v2") }} | ||
apiVersion: autoscaling/v2 | ||
{{- else if ($cap.APIVersions.Has "autoscaling/v1") }} | ||
apiVersion: autoscaling/v1 | ||
{{- else if ($cap.APIVersions.Has "autoscaling/v2beta2") }} | ||
apiVersion: autoscaling/v2beta2 | ||
{{- else }} | ||
apiVersion: autoscaling/v2beta1 | ||
{{- end }} | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: {{ $readreplica.name }}-{{ $id }} | ||
labels: | ||
app.kubernetes.io/name: {{ $valdname }} | ||
helm.sh/chart: {{ $valdchart }} | ||
app.kubernetes.io/managed-by: {{ $release.Service }} | ||
app.kubernetes.io/instance: {{ $release.Name }} | ||
app.kubernetes.io/version: {{ $chart.Version }} | ||
app.kubernetes.io/component: {{ $readreplica.component_name }} | ||
{{ $readreplica.label_key }}: "{{ $id }}" | ||
spec: | ||
maxReplicas: {{ $readreplica.maxReplicas }} | ||
minReplicas: {{ $readreplica.minReplicas }} | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: {{ $readreplica.name }}-{{ $id }} | ||
{{- if or ($cap.APIVersions.Has "autoscaling/v2") ($cap.APIVersions.Has "autoscaling/v2beta2") ($cap.APIVersions.Has "autoscaling/v2beta1") }} | ||
metrics: | ||
- type: Resource | ||
resource: | ||
name: cpu | ||
target: | ||
type: Utilization | ||
averageUtilization: {{ $readreplica.hpa.targetCPUUtilizationPercentage }} | ||
{{ else }} | ||
targetCPUUtilizationPercentage: {{ $readreplica.hpa.targetCPUUtilizationPercentage }} | ||
{{- end }} | ||
status: | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.