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

fix(charts): Add helm chart for index deletion #2887

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
Prev Previous commit
Next Next commit
fix: Run k8s/manifest/update for index deletion
highpon committed Mar 17, 2025
commit 6562afcf76ac0bfc9602ebca1714f233679ffd98
2 changes: 2 additions & 0 deletions Makefile.d/k8s.mk
Original file line number Diff line number Diff line change
@@ -40,6 +40,7 @@ k8s/manifest/update: \
--set manager.index.operator.enabled=true \
--set manager.index.saver.enabled=true \
--set manager.index.creator.enabled=true \
--set manager.index.deleter.enabled=true \
--set manager.index.corrector.enabled=true \
--set gateway.mirror.enabled=true \
--output-dir $(TEMP_DIR) \
@@ -55,6 +56,7 @@ k8s/manifest/update: \
mv $(TEMP_DIR)/vald/templates/index/operator $(ROOTDIR)/k8s/index/operator
mv $(TEMP_DIR)/vald/templates/index/job/correction $(ROOTDIR)/k8s/index/job/correction
mv $(TEMP_DIR)/vald/templates/index/job/creation $(ROOTDIR)/k8s/index/job/creation
mv $(TEMP_DIR)/vald/templates/index/job/deletion $(ROOTDIR)/k8s/index/job/deletion
mv $(TEMP_DIR)/vald/templates/index/job/save $(ROOTDIR)/k8s/index/job/save
mv $(TEMP_DIR)/vald/templates/index/job/readreplica/rotate $(ROOTDIR)/k8s/index/job/readreplica/rotate
rm -rf $(TEMP_DIR)
418 changes: 418 additions & 0 deletions k8s/index/job/deletion/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,418 @@
---
# Source: vald/templates/index/job/deletion/configmap.yaml
#
# Copyright (C) 2019-2025 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.
#
apiVersion: v1
kind: ConfigMap
metadata:
name: vald-index-deletion-config
labels:
app.kubernetes.io/name: vald
helm.sh/chart: vald-v1.7.16
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: release-name
app.kubernetes.io/version: v1.7.16
app.kubernetes.io/component: vald-index-deletion
data:
config.yaml: |
---
version: v0.0.0
time_zone: UTC
logging:
format: raw
level: debug
logger: glg
server_config:
servers:
- name: grpc
host: 0.0.0.0
port: 8081
grpc:
bidirectional_stream_concurrency: 20
connection_timeout: ""
enable_admin: true
enable_channelz: true
enable_reflection: true
header_table_size: 0
initial_conn_window_size: 2097152
initial_window_size: 1048576
interceptors:
- RecoverInterceptor
keepalive:
max_conn_age: ""
max_conn_age_grace: ""
max_conn_idle: ""
min_time: 10m
permit_without_stream: false
time: 3h
timeout: 60s
max_concurrent_streams: 0
max_header_list_size: 0
max_receive_message_size: 0
max_send_message_size: 0
num_stream_workers: 0
read_buffer_size: 0
shared_write_buffer: false
wait_for_handlers: true
write_buffer_size: 0
mode: GRPC
network: tcp
probe_wait_time: 3s
restart: true
socket_option:
ip_recover_destination_addr: false
ip_transparent: false
reuse_addr: true
reuse_port: true
tcp_cork: false
tcp_defer_accept: false
tcp_fast_open: false
tcp_no_delay: false
tcp_quick_ack: false
socket_path: ""
health_check_servers:
- name: liveness
host: 0.0.0.0
port: 3000
http:
handler_timeout: ""
http2:
enabled: false
handler_limit: 0
max_concurrent_streams: 0
max_decoder_header_table_size: 4096
max_encoder_header_table_size: 4096
max_read_frame_size: 0
max_upload_buffer_per_connection: 0
max_upload_buffer_per_stream: 0
permit_prohibited_cipher_suites: true
idle_timeout: ""
read_header_timeout: ""
read_timeout: ""
shutdown_duration: 5s
write_timeout: ""
mode: REST
network: tcp
probe_wait_time: 3s
restart: true
socket_option:
ip_recover_destination_addr: false
ip_transparent: false
reuse_addr: true
reuse_port: true
tcp_cork: false
tcp_defer_accept: false
tcp_fast_open: true
tcp_no_delay: true
tcp_quick_ack: true
socket_path: ""
- name: readiness
host: 0.0.0.0
port: 3001
http:
handler_timeout: ""
http2:
enabled: false
handler_limit: 0
max_concurrent_streams: 0
max_decoder_header_table_size: 4096
max_encoder_header_table_size: 4096
max_read_frame_size: 0
max_upload_buffer_per_connection: 0
max_upload_buffer_per_stream: 0
permit_prohibited_cipher_suites: true
idle_timeout: ""
read_header_timeout: ""
read_timeout: ""
shutdown_duration: 0s
write_timeout: ""
mode: REST
network: tcp
probe_wait_time: 3s
restart: true
socket_option:
ip_recover_destination_addr: false
ip_transparent: false
reuse_addr: true
reuse_port: true
tcp_cork: false
tcp_defer_accept: false
tcp_fast_open: true
tcp_no_delay: true
tcp_quick_ack: true
socket_path: ""
metrics_servers:
- name: pprof
host: 0.0.0.0
port: 6060
http:
handler_timeout: 5s
http2:
enabled: false
handler_limit: 0
max_concurrent_streams: 0
max_decoder_header_table_size: 4096
max_encoder_header_table_size: 4096
max_read_frame_size: 0
max_upload_buffer_per_connection: 0
max_upload_buffer_per_stream: 0
permit_prohibited_cipher_suites: true
idle_timeout: 2s
read_header_timeout: 1s
read_timeout: 1s
shutdown_duration: 5s
write_timeout: 1m
mode: REST
network: tcp
probe_wait_time: 3s
restart: true
socket_option:
ip_recover_destination_addr: false
ip_transparent: false
reuse_addr: true
reuse_port: true
tcp_cork: true
tcp_defer_accept: false
tcp_fast_open: false
tcp_no_delay: false
tcp_quick_ack: false
socket_path: ""
startup_strategy:
- liveness
- pprof
- grpc
- readiness
shutdown_strategy:
- readiness
- grpc
- pprof
- liveness
full_shutdown_duration: 600s
tls:
ca: /path/to/ca
cert: /path/to/cert
enabled: false
insecure_skip_verify: false
key: /path/to/key
observability:
enabled: false
otlp:
collector_endpoint: ""
trace_batch_timeout: "1s"
trace_export_timeout: "1m"
trace_max_export_batch_size: 1024
trace_max_queue_size: 256
metrics_export_interval: "1s"
metrics_export_timeout: "1m"
attribute:
namespace: "_MY_POD_NAMESPACE_"
pod_name: "_MY_POD_NAME_"
node_name: "_MY_NODE_NAME_"
service_name: "vald-index-deletion"
metrics:
enable_cgo: true
enable_goroutine: true
enable_memory: true
enable_version_info: true
version_info_labels:
- vald_version
- server_name
- git_commit
- build_time
- go_version
- go_os
- go_arch
- algorithm_info
trace:
enabled: false
deleter:
index_id: "sample"
agent_port: 8081
agent_name: "vald-agent"
agent_dns: vald-agent.default.svc.cluster.local
agent_namespace: "_MY_POD_NAMESPACE_"
node_name: ""
concurrency: 1
target_addrs: []
discoverer:
duration: 500ms
client:
addrs:
- vald-discoverer.default.svc.cluster.local:8081
health_check_duration: "1s"
connection_pool:
enable_dns_resolver: true
enable_rebalance: true
old_conn_close_duration: 2m
rebalance_duration: 30m
size: 3
backoff:
backoff_factor: 1.1
backoff_time_limit: 5s
enable_error_log: true
initial_duration: 5ms
jitter_limit: 100ms
maximum_duration: 5s
retry_count: 100
circuit_breaker:
closed_error_rate: 0.7
closed_refresh_timeout: 10s
half_open_error_rate: 0.5
min_samples: 1000
open_timeout: 1s
call_option:
content_subtype: ""
max_recv_msg_size: 0
max_retry_rpc_buffer_size: 0
max_send_msg_size: 0
wait_for_ready: true
dial_option:
authority: ""
backoff_base_delay: 1s
backoff_jitter: 0.2
backoff_max_delay: 120s
backoff_multiplier: 1.6
disable_retry: false
enable_backoff: false
idle_timeout: 1h
initial_connection_window_size: 2097152
initial_window_size: 1048576
insecure: true
interceptors: []
keepalive:
permit_without_stream: false
time: ""
timeout: 30s
max_call_attempts: 0
max_header_list_size: 0
max_msg_size: 0
min_connection_timeout: 20s
net:
dialer:
dual_stack_enabled: true
keepalive: ""
timeout: ""
dns:
cache_enabled: true
cache_expiration: 1h
refresh_duration: 30m
network: tcp
socket_option:
ip_recover_destination_addr: false
ip_transparent: false
reuse_addr: true
reuse_port: true
tcp_cork: false
tcp_defer_accept: false
tcp_fast_open: false
tcp_no_delay: false
tcp_quick_ack: false
tls:
ca: /path/to/ca
cert: /path/to/cert
enabled: false
insecure_skip_verify: false
key: /path/to/key
read_buffer_size: 0
shared_write_buffer: false
timeout: ""
user_agent: Vald-gRPC
write_buffer_size: 0
tls:
ca: /path/to/ca
cert: /path/to/cert
enabled: false
insecure_skip_verify: false
key: /path/to/key
agent_client_options:
addrs: []
health_check_duration: "1s"
connection_pool:
enable_dns_resolver: true
enable_rebalance: true
old_conn_close_duration: 2m
rebalance_duration: 30m
size: 3
backoff:
backoff_factor: 1.1
backoff_time_limit: 5s
enable_error_log: true
initial_duration: 5ms
jitter_limit: 100ms
maximum_duration: 5s
retry_count: 100
circuit_breaker:
closed_error_rate: 0.7
closed_refresh_timeout: 10s
half_open_error_rate: 0.5
min_samples: 1000
open_timeout: 1s
call_option:
content_subtype: ""
max_recv_msg_size: 0
max_retry_rpc_buffer_size: 0
max_send_msg_size: 0
wait_for_ready: true
dial_option:
write_buffer_size: 0
read_buffer_size: 0
initial_window_size: 1.048576e+06
initial_connection_window_size: 2.097152e+06
max_msg_size: 0
backoff_max_delay: "120s"
backoff_base_delay: "1s"
backoff_multiplier: 1.6
backoff_jitter: 0.2
min_connection_timeout: "20s"
enable_backoff: false
insecure: true
timeout: ""
interceptors: []
net:
dns:
cache_enabled: true
cache_expiration: 1h
refresh_duration: 30m
dialer:
timeout: ""
keepalive: "15m"
dual_stack_enabled: true
tls:
ca: /path/to/ca
cert: /path/to/cert
enabled: false
insecure_skip_verify: false
key: /path/to/key
socket_option:
ip_recover_destination_addr: false
ip_transparent: false
reuse_addr: true
reuse_port: true
tcp_cork: false
tcp_defer_accept: false
tcp_fast_open: false
tcp_no_delay: false
tcp_quick_ack: false
keepalive:
permit_without_stream: false
time: ""
timeout: 30s
tls:
ca: /path/to/ca
cert: /path/to/cert
enabled: false
insecure_skip_verify: false
key: /path/to/key
157 changes: 157 additions & 0 deletions k8s/index/job/deletion/cronjob.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
---
# Source: vald/templates/index/job/deletion/cronjob.yaml
#
# Copyright (C) 2019-2025 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.
#
apiVersion: batch/v1
kind: CronJob
metadata:
name: vald-index-deletion
labels:
app: vald-index-deletion
app.kubernetes.io/name: vald
helm.sh/chart: vald-v1.7.16
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: release-name
app.kubernetes.io/component: vald-index-deletion
app.kubernetes.io/version: v1.7.16
spec:
schedule: "* * * * *"
concurrencyPolicy: Forbid
suspend: false
startingDeadlineSeconds: 43200
jobTemplate:
spec:
ttlSecondsAfterFinished: 86400
template:
metadata:
labels:
app: vald-index-deletion
app.kubernetes.io/name: vald
helm.sh/chart: vald-v1.7.16
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: release-name
app.kubernetes.io/component: vald-index-deletion
app.kubernetes.io/version: v1.7.16
annotations:
pyroscope.io/scrape: "true"
pyroscope.io/application-name: vald-index-deletion
pyroscope.io/profile-cpu-enabled: "true"
pyroscope.io/profile-mem-enabled: "true"
pyroscope.io/port: "6060"
spec:
initContainers:
- name: wait-for-agent
image: busybox:stable
imagePullPolicy: Always
command:
- /bin/sh
- -e
- -c
- |
until [ "$(wget --server-response --spider --quiet http://vald-agent.default.svc.cluster.local:3001/readiness 2>&1 | awk 'NR==1{print $2}')" == "200" ]; do
echo "waiting for agent to be ready..."
sleep 2;
done
- name: wait-for-discoverer
image: busybox:stable
imagePullPolicy: Always
command:
- /bin/sh
- -e
- -c
- |
until [ "$(wget --server-response --spider --quiet http://vald-discoverer.default.svc.cluster.local:3001/readiness 2>&1 | awk 'NR==1{print $2}')" == "200" ]; do
echo "waiting for discoverer to be ready..."
sleep 2;
done
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution: []
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution: []
requiredDuringSchedulingIgnoredDuringExecution: []
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution: []
requiredDuringSchedulingIgnoredDuringExecution: []
containers:
- name: vald-index-deletion
image: "vdaas/vald-index-deletion:nightly"
imagePullPolicy: Always
volumeMounts:
- name: vald-index-deletion-config
mountPath: /etc/server/
livenessProbe:
failureThreshold: 2
httpGet:
path: /liveness
port: liveness
scheme: HTTP
initialDelaySeconds: 5
periodSeconds: 3
successThreshold: 1
timeoutSeconds: 2
readinessProbe:
failureThreshold: 2
httpGet:
path: /readiness
port: readiness
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 3
successThreshold: 1
timeoutSeconds: 2
startupProbe:
failureThreshold: 30
httpGet:
path: /liveness
port: liveness
scheme: HTTP
initialDelaySeconds: 5
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 2
ports:
- name: liveness
protocol: TCP
containerPort: 3000
- name: readiness
protocol: TCP
containerPort: 3001
- name: grpc
protocol: TCP
containerPort: 8081
- name: pprof
protocol: TCP
containerPort: 6060
env:
- name: MY_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: MY_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: MY_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
restartPolicy: OnFailure
volumes:
- name: vald-index-deletion-config
configMap:
defaultMode: 420
name: vald-index-deletion-config