Skip to content

Commit

Permalink
add QUIC support and use netpoll for more efficient conntection handl…
Browse files Browse the repository at this point in the history
…ing fix fix fix

Signed-off-by: kpango <kpango@vdaas.org>
  • Loading branch information
kpango committed May 18, 2022
1 parent d55e2db commit 54ea37b
Show file tree
Hide file tree
Showing 17 changed files with 430 additions and 43 deletions.
17 changes: 12 additions & 5 deletions charts/vald/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -728,27 +728,30 @@ defaults:
timeout: ""
# @schema {"name": "defaults.grpc.client.dial_option.net", "type": "object", "anchor": "net"}
net:
# @schema {"name": "defaults.grpc.client.dial_option.net.network", "type": "string", "enum": ["tcp", "udp", "unix"]}
# defaults.grpc.client.dial_option.net.network -- gRPC client dialer network type
network: tcp
# @schema {"name": "defaults.grpc.client.dial_option.net.dns", "type": "object"}
dns:
# @schema {"name": "defaults.grpc.client.dial_option.net.dns.cache_enabled", "type": "boolean"}
# defaults.grpc.client.dial_option.net.dns.cache_enabled -- gRPC client TCP DNS cache enabled
# defaults.grpc.client.dial_option.net.dns.cache_enabled -- gRPC client DNS cache enabled
cache_enabled: true
# @schema {"name": "defaults.grpc.client.dial_option.net.dns.refresh_duration", "type": "string"}
# defaults.grpc.client.dial_option.net.dns.refresh_duration -- gRPC client TCP DNS cache refresh duration
# defaults.grpc.client.dial_option.net.dns.refresh_duration -- gRPC client DNS cache refresh duration
refresh_duration: 30m
# @schema {"name": "defaults.grpc.client.dial_option.net.dns.cache_expiration", "type": "string"}
# defaults.grpc.client.dial_option.net.dns.cache_expiration -- gRPC client TCP DNS cache expiration
# defaults.grpc.client.dial_option.net.dns.cache_expiration -- gRPC client DNS cache expiration
cache_expiration: 1h
# @schema {"name": "defaults.grpc.client.dial_option.net.dialer", "type": "object"}
dialer:
# @schema {"name": "defaults.grpc.client.dial_option.net.dialer.timeout", "type": "string"}
# defaults.grpc.client.dial_option.net.dialer.timeout -- gRPC client TCP dialer timeout
# defaults.grpc.client.dial_option.net.dialer.timeout -- gRPC client dialer timeout
timeout: ""
# @schema {"name": "defaults.grpc.client.dial_option.net.dialer.keepalive", "type": "string"}
# defaults.grpc.client.dial_option.net.dialer.keepalive -- gRPC client TCP dialer keep alive
keepalive: ""
# @schema {"name": "defaults.grpc.client.dial_option.net.dialer.dual_stack_enabled", "type": "boolean"}
# defaults.grpc.client.dial_option.net.dialer.dual_stack_enabled -- gRPC client TCP dialer dual stack enabled
# defaults.grpc.client.dial_option.net.dialer.dual_stack_enabled -- gRPC client dialer dual stack enabled
dual_stack_enabled: true
# @schema {"name": "defaults.grpc.client.dial_option.net.tls", "alias": "tls"}
tls:
Expand Down Expand Up @@ -2085,6 +2088,8 @@ agent:
client:
# @schema {"name": "agent.sidecar.config.client.net", "alias": "net"}
net:
# agent.sidecar.config.client.net.network -- gRPC client dialer network type
network: tcp
dns:
# agent.sidecar.config.client.net.dns.cache_enabled -- HTTP client TCP DNS cache enabled
cache_enabled: true
Expand Down Expand Up @@ -2447,6 +2452,8 @@ discoverer:
fields: {}
# @schema {"name": "discoverer.discoverer.net", "alias": "net"}
net:
# discoverer.discoverer.net.network -- gRPC client dialer network type
network: tcp
dns:
# discoverer.discoverer.net.dns.cache_enabled -- TCP DNS cache enabled
cache_enabled: true
Expand Down
22 changes: 22 additions & 0 deletions cmd/agent/core/ngt/dummyCa.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-----BEGIN CERTIFICATE-----
MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYG
A1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2Jh
bCBSb290MB4XDTA2MTIxNTA4MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UE
ChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBS
b290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+Mi8vRRQZhP/8NN5
7CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW0ozS
J8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2y
HLtgwEZLAfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iP
t3sMpTjr3kfb1V05/Iin89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNz
FtApD0mpSPCzqrdsxacwOUBdrsTiXSZT8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAY
XSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/
MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2MDSgMqAw
hi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3Js
MB8GA1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUA
A4IBAQBW7wojoFROlZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMj
Wqd8BfP9IjsO0QbE2zZMcwSO5bAi5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUx
XOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2hO0j9n0Hq0V+09+zv+mKts2o
omcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+TX3EJIrduPuoc
A06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW
WL1WMRJOEcgh4LMRkWXbtKaIOM5V
-----END CERTIFICATE-----
19 changes: 19 additions & 0 deletions cmd/agent/core/ngt/dummyServer.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-----BEGIN CERTIFICATE-----
MIIC/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/core/ngt/dummyServer.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEA1ASsIQxxpco+RhToQ5ch+uwbFvZfwNq52ttVlZ6uvQDTfVpm
ohad9gvtga6hfA2MLT8qGk4F3flkPMJrY5WMKd+/D++N7wYH+rWs2WCmwmuz2bDT
CwnSNCrq13+osDpAmO80EHDo4kk1FbX69NPSxYHPCgXbsQYshHtbV6Ddaq41GYLc
v9ORLVtPUBRNl6lRUEuIzegguMIZjdye8lh8mb9ytZTtGngt9ZCDqsNPw8Q/w4/0
TCQac9Kt43mCcLzN6xOAzWo01ugS4j1lZC1uB96WkROo2H8gkWsxPLSy1h8xhqj1
lBJVdqyls3Vejp8lixcVgtkSv+9SLmUtVA6phwIDAQABAoIBAQCvuhus3LKJdmI9
FfEYrHg2kGE3nAbrQp7OvgJmm3o7Hycre7UbXWGZYHN/i+0+c8AedH8CBG8qdx1U
mtQFWxssTc3/eE8MsNQGQXQ9S7WL6VbM9JlHSeGW6YdyC9YWEoIeAA0IH312qLS+
BPI24CaPGzMuHILla7eUKuYfcC50zuLcqZVrk3Mf/jQrAlc8YKaModGBn6DFw766
z9k+04KDjmAc4iOoR9hD+8ELx+q0H4tPztRDLzJ7HOdPaBEbHT+xbV7KQb9gHa0F
FQMvGAdQV/FxwDimLt/eY65+xqf4nSO+TtYnEH6TtAE3AW2SCj8+eFBigLxl1I0C
Vysm+wVhAoGBAO4Nnh7G9ZpFCQQ1aZuBDiCwIi/k4bSD53SI1t097d9DprCItq9Y
tckza8oxsMnpY8t6/F9ab9tQzEz7NSOkRTo8sMc6yD6zpz0cz3WSbuw7E31u7HDx
S300MMSW/ufINOjBmQGeIoMhCX2JZswiTy88vkV4UtA0oNEo4bp67FvxAoGBAOQA
lc4qN2hE/o77qbWiPF8X7vQt6ulf4C4QO1Pyk3gYPFeqz0x9/EjGI9CVHUGuRbTb
pYYDfQgozRYnjz3iCU9g8DIY93SImpsQUm0k7QRHkWFa9s0Fp2ymn9PkASiJxQgk
9l6CqTNUbGJLC1AI9LNAkr1WIzzX9lOOhEHFpTT3AoGAQOCbOF4W731jEK+R4ZyR
gh0epBjn3m+Yc+0bSd6n5pIkarZHu5AcswH9nXRfbxfZZ8pT35ThKU9i7pQEDnul
llKWByYhDt2ddY1ViQBolJ8hF61UaQ+J+ExyAhH41Kh+qvSgQ42acExfrsP0rSuo
kwImBP7e6vl83qQaqNz5b7ECgYEAlgVUjKz2fCM5o/cveZXgR2nGDuDPuvMc3PJN
NzVblx/LRJvdfqU/BNtq4WncMEVtFE2aIg3VjTLbjwJEnCFIovRT14LZ/9GKeRFK
SwqK8c/tdrOVxN09hp40eAWERZoxDOTVPuaWUnHwRtS+AtGBwRhx9SbiVLx9Fgmm
OGjGBY0CgYEAr2Go4s2QBQXpvJPdYSUGi/osF1jfntIL0JydqBOy9xx9R6d/CvWX
8ekhlYdXLZPmgUoZ8EIBlULRs+8XJRn1zXGBUu1hEdU8rO7WdkHV6tJBIw6mSppV
btGQ8m0qKBLMJco77ZZCjp5lsG/Af308ojuK/DJcomH1slxyTkSYEjg=
-----END RSA PRIVATE KEY-----
9 changes: 5 additions & 4 deletions cmd/agent/core/ngt/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ logging:
server_config:
servers:
- name: grpc
network: udp
host: 0.0.0.0
port: 8081
grpc:
Expand Down Expand Up @@ -66,10 +67,10 @@ server_config:
- readiness
full_shutdown_duration: 600s
tls:
ca: /path/to/ca
cert: /path/to/cert
enabled: false
key: /path/to/key
ca: ./dummyCa.pem
cert: ./dummyServer.crt
enabled: true
key: ./dummyServer.key
observability:
enabled: false
collector:
Expand Down
14 changes: 14 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ replace (
github.com/Azure/go-autorest/autorest => github.com/Azure/go-autorest/autorest v0.11.28-0.20220504154517-49906996bd99
github.com/Azure/go-autorest/autorest/adal => github.com/Azure/go-autorest/autorest/adal v0.9.19
github.com/aws/aws-sdk-go => github.com/aws/aws-sdk-go v1.44.13
github.com/buger/jsonparser => github.com/buger/jsonparser v1.1.1
github.com/chzyer/logex => github.com/chzyer/logex v1.2.1
github.com/coreos/etcd => go.etcd.io/etcd v3.3.27+incompatible
github.com/docker/docker => github.com/moby/moby v20.10.16+incompatible
Expand Down Expand Up @@ -46,6 +47,7 @@ replace (
github.com/json-iterator/go => github.com/json-iterator/go v1.1.12
github.com/klauspost/compress => github.com/klauspost/compress v1.15.5-0.20220512161851-3909335c441d
github.com/kpango/glg => github.com/kpango/glg v1.6.10
github.com/lucas-clemente/quic-go => github.com/lucas-clemente/quic-go v0.27.0
github.com/onsi/ginkgo => github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega => github.com/onsi/gomega v1.19.0
github.com/opentracing/opentracing-go => github.com/opentracing/opentracing-go v1.2.0
Expand Down Expand Up @@ -127,6 +129,7 @@ require (
contrib.go.opencensus.io/exporter/prometheus v0.4.1
contrib.go.opencensus.io/exporter/stackdriver v0.13.12
github.com/aws/aws-sdk-go v1.43.31
github.com/cloudwego/netpoll v0.2.2
github.com/envoyproxy/protoc-gen-validate v0.1.0
github.com/fsnotify/fsnotify v1.5.1
github.com/go-redis/redis/v8 v8.11.5
Expand All @@ -143,6 +146,7 @@ require (
github.com/kpango/gache v1.2.7
github.com/kpango/glg v1.6.10
github.com/leanovate/gopter v0.2.9
github.com/lucas-clemente/quic-go v0.0.0-00010101000000-000000000000
github.com/lucasb-eyer/go-colorful v1.2.0
github.com/pierrec/lz4/v3 v3.3.4
github.com/quasilyte/go-ruleguard v0.3.15
Expand Down Expand Up @@ -188,8 +192,10 @@ require (
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bytedance/gopkg v0.0.0-20220413063733-65bf48ffb3a7 // indirect
github.com/census-instrumentation/opencensus-proto v0.3.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cheekybits/genny v1.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/emicklei/go-restful v2.9.5+incompatible // indirect
Expand All @@ -204,6 +210,7 @@ require (
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/go-pdf/fpdf v0.6.0 // indirect
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
github.com/go-toolsmith/astcopy v1.0.0 // indirect
github.com/go-toolsmith/astequal v1.0.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
Expand All @@ -230,12 +237,17 @@ require (
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/marten-seemann/qtls-go1-16 v0.1.5 // indirect
github.com/marten-seemann/qtls-go1-17 v0.1.1 // indirect
github.com/marten-seemann/qtls-go1-18 v0.1.1 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/moby/spdystream v0.2.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
Expand All @@ -257,6 +269,7 @@ require (
go.uber.org/multierr v1.8.0 // indirect
go4.org/intern v0.0.0-20211027215823-ae77deb06f29 // indirect
go4.org/unsafe/assume-no-moving-gc v0.0.0-20211027215541-db492cf91b37 // indirect
golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 // indirect
golang.org/x/image v0.0.0-20220302094943-723b81ca9867 // indirect
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
Expand All @@ -265,6 +278,7 @@ require (
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/apiextensions-apiserver v0.24.0 // indirect
k8s.io/component-base v0.24.0 // indirect
Expand Down
Loading

0 comments on commit 54ea37b

Please sign in to comment.