Skip to content

Commit

Permalink
add telepresence for new apis
Browse files Browse the repository at this point in the history
Signed-off-by: kpango <[email protected]>
  • Loading branch information
kpango committed Jan 12, 2021
1 parent d299345 commit 2c0acef
Show file tree
Hide file tree
Showing 3 changed files with 282 additions and 2 deletions.
15 changes: 15 additions & 0 deletions Makefile.d/k8s.mk
Original file line number Diff line number Diff line change
Expand Up @@ -404,3 +404,18 @@ telepresence/swap/manager-compressor:
## swap manager-index deployment using telepresence
telepresence/swap/manager-index:
@$(call telepresence,vald-manager-index,vdaas/vald-manager-index)

.PHONY: telepresence/swap/lb-gateway
## swap lb-gateway deployment using telepresence
telepresence/swap/lb-gateway:
@$(call telepresence,vald-lb-gateway,vdaas/vald-lb-gateway)

.PHONY: telepresence/swap/backup-gateway
## swap backup-gateway deployment using telepresence
telepresence/swap/backup-gateway:
@$(call telepresence,vald-backup-gateway,vdaas/vald-backup-gateway)

.PHONY: telepresence/swap/meta-gateway
## swap meta-gateway deployment using telepresence
telepresence/swap/meta-gateway:
@$(call telepresence,vald-meta-gateway,vdaas/vald-meta-gateway)
265 changes: 265 additions & 0 deletions cmd/gateway/meta/sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,265 @@
version: v0.0.0
time_zone: JST
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: ""
header_table_size: 0
initial_conn_window_size: 0
initial_window_size: 0
interceptors: []
keepalive:
max_conn_age: ""
max_conn_age_grace: ""
max_conn_idle: ""
time: ""
timeout: ""
max_header_list_size: 0
max_receive_message_size: 0
max_send_message_size: 0
read_buffer_size: 0
write_buffer_size: 0
mode: GRPC
probe_wait_time: 3s
restart: true
health_check_servers:
- name: liveness
host: 0.0.0.0
port: 3000
http:
handler_timeout: ""
idle_timeout: ""
read_header_timeout: ""
read_timeout: ""
shutdown_duration: 5s
write_timeout: ""
mode: ""
probe_wait_time: 3s
- name: readiness
host: 0.0.0.0
port: 3001
http:
handler_timeout: ""
idle_timeout: ""
read_header_timeout: ""
read_timeout: ""
shutdown_duration: 0s
write_timeout: ""
mode: ""
probe_wait_time: 3s
metrics_servers:
startup_strategy:
- liveness
- grpc
- readiness
full_shutdown_duration: 600s
tls:
ca: /path/to/ca
cert: /path/to/cert
enabled: false
key: /path/to/key
observability:
enabled: false
collector:
duration: 5s
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
- ngt_version
trace:
enabled: false
sampling_rate: 1
prometheus:
enabled: false
endpoint: /metrics
namespace: vald
jaeger:
enabled: false
collector_endpoint: ""
agent_endpoint: "jaeger-agent.default.svc.cluster.local:6831"
username: ""
password: ""
service_name: "vald-meta-gateway"
buffer_max_count: 10
stackdriver:
project_id: ""
client:
api_key: ""
audiences: []
authentication_enabled: true
credentials_file: ""
credentials_json: ""
endpoint: ""
quota_project: ""
request_reason: ""
scopes: []
telemetry_enabled: true
user_agent: ""
exporter:
bundle_count_threshold: 0
bundle_delay_threshold: "0"
location: ""
metric_prefix: vald.vdaas.org
monitoring_enabled: false
number_of_workers: 1
reporting_interval: 1m
skip_cmd: false
timeout: 5s
trace_spans_buffer_max_bytes: 0
tracing_enabled: false
profiler:
enabled: false
service: "vald-meta-gateway"
service_version: ""
debug_logging: false
mutex_profiling: true
cpu_profiling: true
alloc_profiling: true
heap_profiling: true
goroutine_profiling: true
alloc_force_gc: false
api_addr: ""
instance: ""
zone: ""
client:
addrs:
- vald-backup-gateway.default.svc.cluster.local:8081
health_check_duration: "1s"
connection_pool:
enable_dns_resolver: true
enable_rebalance: true
old_conn_close_duration: 3s
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
call_option:
max_recv_msg_size: 0
max_retry_rpc_buffer_size: 0
max_send_msg_size: 0
wait_for_ready: true
dial_option:
backoff_base_delay: 1s
backoff_jitter: 0.2
backoff_max_delay: 120s
backoff_multiplier: 1.6
enable_backoff: false
initial_connection_window_size: 0
initial_window_size: 0
insecure: true
keep_alive:
permit_without_stream: false
time: ""
timeout: ""
max_msg_size: 0
min_connection_timeout: 20s
read_buffer_size: 0
tcp:
dialer:
dual_stack_enabled: true
keep_alive: ""
timeout: ""
dns:
cache_enabled: true
cache_expiration: 1h
refresh_duration: 30m
tls:
ca: /path/to/ca
cert: /path/to/cert
enabled: false
key: /path/to/key
timeout: ""
write_buffer_size: 0
tls:
ca: /path/to/ca
cert: /path/to/cert
enabled: false
key: /path/to/key
meta:
client:
addrs:
- vald-meta.default.svc.cluster.local:8081
health_check_duration: "1s"
connection_pool:
enable_dns_resolver: true
enable_rebalance: true
old_conn_close_duration: 3s
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
call_option:
max_recv_msg_size: 0
max_retry_rpc_buffer_size: 0
max_send_msg_size: 0
wait_for_ready: true
dial_option:
backoff_base_delay: 1s
backoff_jitter: 0.2
backoff_max_delay: 120s
backoff_multiplier: 1.6
enable_backoff: false
initial_connection_window_size: 0
initial_window_size: 0
insecure: true
keep_alive:
permit_without_stream: false
time: ""
timeout: ""
max_msg_size: 0
min_connection_timeout: 20s
read_buffer_size: 0
tcp:
dialer:
dual_stack_enabled: true
keep_alive: ""
timeout: ""
dns:
cache_enabled: true
cache_expiration: 1h
refresh_duration: 30m
tls:
ca: /path/to/ca
cert: /path/to/cert
enabled: false
key: /path/to/key
timeout: ""
write_buffer_size: 0
tls:
ca: /path/to/ca
cert: /path/to/cert
enabled: false
key: /path/to/key
enable_cache: true
cache_expiration: 30m
expired_cache_check_duration: 3m
4 changes: 2 additions & 2 deletions pkg/gateway/meta/handler/grpc/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest)
meta := req.GetId()
req.Id, err = s.metadata.GetUUID(ctx, meta)
if err != nil {
log.Debugf("MultiRemove API failed to process request uuids:\t%v\terror:\t%s", meta, err.Error())
log.Debugf("SearchByID API failed to process request uuids:\t%v\terror:\t%s", meta, err.Error())
req.Id = meta
if span != nil {
span.SetStatus(trace.StatusCodeNotFound(err.Error()))
Expand All @@ -131,7 +131,7 @@ func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest)
if span != nil {
span.SetStatus(trace.StatusCodeNotFound(err.Error()))
}
return nil, status.WrapWithNotFound("Search API failed to process search request", err, req, info.Get())
return nil, status.WrapWithNotFound("SearchByID API failed to process search request", err, req, info.Get())
}
return res, nil
}
Expand Down

0 comments on commit 2c0acef

Please sign in to comment.