From e84141c0f0904832f9bc12274a8189ae1d3c326d Mon Sep 17 00:00:00 2001 From: Hiroto Funakoshi Date: Wed, 18 Oct 2023 10:03:32 +0900 Subject: [PATCH] Enable ingress resource in the getStarted document (#2211) * fix: enable ingress resource in the getStarted document and refactor Signed-off-by: hlts2 * fix: indent bug Signed-off-by: hlts2 * style: format code with Gofumpt and Prettier This commit fixes the style issues introduced in ac6ee52 according to the output from Gofumpt and Prettier. Details: https://github.com/vdaas/vald/pull/2211 * fix expand format bug Signed-off-by: hlts2 * fix: broken expand Signed-off-by: hlts2 * fix: new line for visibility Signed-off-by: hlts2 --------- Signed-off-by: hlts2 Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> --- docs/tutorial/get-started.md | 16 ++- docs/tutorial/vald-agent-standalone-on-k8s.md | 103 +++++++++--------- example/client/agent/main.go | 3 +- example/client/go.mod | 39 +++---- example/client/go.mod.default | 2 +- example/client/go.sum | 46 +++++--- example/client/main.go | 7 +- example/helm/values-with-pyroscope.yaml | 10 +- example/helm/values.yaml | 12 +- 9 files changed, 130 insertions(+), 108 deletions(-) diff --git a/docs/tutorial/get-started.md b/docs/tutorial/get-started.md index ec8b8addeaa..683703cb102 100644 --- a/docs/tutorial/get-started.md +++ b/docs/tutorial/get-started.md @@ -67,6 +67,12 @@ Please make sure these functions are available.
The configuration of Kubernetes Ingress is depended on your Kubernetes cluster's provider. Please refer to on yourself. +In the following example, we create the Kubernetes cluster using [k3d](https://k3d.io/), that the internal port 80 (where the traefik ingress controller is listening on) is exposed on the host system. + +```bash +k3d cluster create -p 8081:80@loadbalancer +``` + The way to deploy Kubernetes Metrics Service is here: ```bash @@ -108,7 +114,7 @@ In this tutorial, you will deploy the basic configuration of Vald that is consis enabled: true # TODO: Set your ingress host. host: localhost - # TODO: Set annotations which you have to set for your k8s cluster. + # TODO: Set annotations which you have to set for your Ingress resource. annotations: ... ``` @@ -164,8 +170,8 @@ In this tutorial, you will deploy the basic configuration of Vald that is consis
Example output
```bash - NAME CLASS HOSTS ADDRESS PORTS AGE - vald-lb-gateway-ingress localhost 192.168.16.2 80 7m43s + NAME CLASS HOSTS ADDRESS PORTS AGE + vald-lb-gateway-ingress traefik localhost 192.168.16.2 80 7m43s ```
@@ -253,9 +259,9 @@ If you are interested, please refer to [SDKs](../user-guides/sdks.md).
"github.com/kpango/glg" "github.com/vdaas/vald-client-go/v1/payload" "github.com/vdaas/vald-client-go/v1/vald" - "gonum.org/v1/hdf5" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" ) ``` @@ -323,7 +329,7 @@ If you are interested, please refer to [SDKs](../user-guides/sdks.md).
```go ctx := context.Background() - conn, err := grpc.DialContext(ctx, grpcServerAddr, grpc.WithInsecure()) + conn, err := grpc.DialContext(ctx, grpcServerAddr, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { glg.Fatal(err) } diff --git a/docs/tutorial/vald-agent-standalone-on-k8s.md b/docs/tutorial/vald-agent-standalone-on-k8s.md index 7ac4e732656..095b6831e82 100644 --- a/docs/tutorial/vald-agent-standalone-on-k8s.md +++ b/docs/tutorial/vald-agent-standalone-on-k8s.md @@ -165,11 +165,11 @@ This chapter uses [NGT](https://github.com/yahoojapan/ngt) as Vald Agent to perf "github.com/kpango/fuid" "github.com/kpango/glg" agent "github.com/vdaas/vald-client-go/v1/agent/core" - "github.com/vdaas/vald-client-go/v1/vald" "github.com/vdaas/vald-client-go/v1/payload" - + "github.com/vdaas/vald-client-go/v1/vald" "gonum.org/v1/hdf5" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" ) ``` @@ -236,7 +236,7 @@ This chapter uses [NGT](https://github.com/yahoojapan/ngt) as Vald Agent to perf ```go ctx := context.Background() - conn, err := grpc.DialContext(ctx, grpcServerAddr, grpc.WithInsecure()) + conn, err := grpc.DialContext(ctx, grpcServerAddr, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { glg.Fatal(err) } @@ -284,21 +284,23 @@ This chapter uses [NGT](https://github.com/yahoojapan/ngt) as Vald Agent to perf - - [Optional] Indexing manually instead of waiting for auto indexing + - [Optional] Indexing manually instead of waiting for auto indexing. + You can set Agent NGT configuration `auto_index_duration_limit` and `auto_index_check_duration` for auto indexing. In this example, you can create index manually using `CreateAndSaveIndex()` method in the client library -
example code
- ```go - _, err = client.CreateAndSaveIndex(ctx, &payload.Control_CreateIndexRequest{ - PoolSize: uint32(insertCount), - }) - if err != nil { - glg.Fatal(err) - } - ``` +
example code
-
+ ```go + _, err = client.CreateAndSaveIndex(ctx, &payload.Control_CreateIndexRequest{ + PoolSize: uint32(insertCount), + }) + if err != nil { + glg.Fatal(err) + } + ``` + +
1. Search @@ -333,49 +335,48 @@ This chapter uses [NGT](https://github.com/yahoojapan/ngt) as Vald Agent to perf 1. Remove - - Remove indexed 400 training datasets from the Vald agent. -
example code
- - ```go - for i := range ids [:insertCount] { - _, err := client.Remove(ctx, &payload.Remove_Request{ - Id: &payload.Object_ID{ - Id: ids[i], - }, - }) - if err != nil { - glg.Fatal(err) - } - if i%10 == 0 { - glg.Infof("Removed %d", i) - } - } - ``` - -
- - - - Remove from the index manually instead of waiting for auto indexing. - The removed vectors still exist in the NGT graph index before the SaveIndex (or CreateAndSaveIndex) API is called. - If you run the below code, the indexes will be removed completely from the Vald Agent NGT graph and the Backup file. -
example code
- - ```go - _, err = client.SaveIndex(ctx, &payload.Empty{}) - if err != nil { - glg.Fatal(err) - } - ``` - -
+ - Remove indexed 400 training datasets from the Vald agent. +
example code
-
+ ```go + for i := range ids [:insertCount] { + _, err := client.Remove(ctx, &payload.Remove_Request{ + Id: &payload.Object_ID{ + Id: ids[i], + }, + }) + if err != nil { + glg.Fatal(err) + } + if i%10 == 0 { + glg.Infof("Removed %d", i) + } + } + ``` + + + + - Remove from the index manually instead of waiting for auto indexing. + + The removed vectors still exist in the NGT graph index before the SaveIndex (or CreateAndSaveIndex) API is called. + If you run the below code, the indexes will be removed completely from the Vald Agent NGT graph and the Backup file. + +
example code
+ + ```go + _, err = client.SaveIndex(ctx, &payload.Empty{}) + if err != nil { + glg.Fatal(err) + } + ``` + +
It would be best to run CreateIndex() after Insert() without waiting for auto-indexing in your client code, even you can wait for the finishing auto createIndex function, which sometimes takes a long time. The backup files (e.g., ngt-meta.kvsdb) will be in your mount directory when vald-agent-ngt finishes indexing.
- +
If you use Go(v1.16~) and catch the error like `missing go.sum entry to add it` when running `go run main.go`, please run `go mod tidy` and retry. This error comes from Go Command Changes of Go 1.16 Release Notes.(Please refer to https://golang.org/doc/go1.16#go-command for more details). diff --git a/example/client/agent/main.go b/example/client/agent/main.go index 493687e337f..45cfcc400e5 100644 --- a/example/client/agent/main.go +++ b/example/client/agent/main.go @@ -27,6 +27,7 @@ import ( "github.com/vdaas/vald-client-go/v1/vald" "gonum.org/v1/hdf5" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" ) const ( @@ -65,7 +66,7 @@ func main() { ctx := context.Background() // Create a Vald Agent client for connecting to the Vald cluster. - conn, err := grpc.DialContext(ctx, grpcServerAddr, grpc.WithInsecure()) + conn, err := grpc.DialContext(ctx, grpcServerAddr, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { glg.Fatal(err) } diff --git a/example/client/go.mod b/example/client/go.mod index a8e2c37c62b..a356acea235 100644 --- a/example/client/go.mod +++ b/example/client/go.mod @@ -1,20 +1,20 @@ module github.com/vdaas/vald/example/client -go 1.20 +go 1.21 replace ( github.com/envoyproxy/protoc-gen-validate => github.com/envoyproxy/protoc-gen-validate v1.0.2 github.com/goccy/go-json => github.com/goccy/go-json v0.10.2 github.com/golang/protobuf => github.com/golang/protobuf v1.5.3 github.com/kpango/glg => github.com/kpango/glg v1.6.15 - github.com/pkg/sftp => github.com/pkg/sftp v1.13.5 - golang.org/x/crypto => golang.org/x/crypto v0.10.0 - golang.org/x/net => golang.org/x/net v0.11.0 - golang.org/x/text => golang.org/x/text v0.10.0 - google.golang.org/genproto => google.golang.org/genproto v0.0.0-20230626202813-9b080da550b3 - google.golang.org/genproto/googleapis/api => google.golang.org/genproto/googleapis/api v0.0.0-20230626202813-9b080da550b3 - google.golang.org/genproto/googleapis/rpc => google.golang.org/genproto/googleapis/rpc v0.0.0-20230626202813-9b080da550b3 - google.golang.org/grpc => google.golang.org/grpc v1.56.1 + github.com/pkg/sftp => github.com/pkg/sftp v1.13.6 + golang.org/x/crypto => golang.org/x/crypto v0.14.0 + golang.org/x/net => golang.org/x/net v0.17.0 + golang.org/x/text => golang.org/x/text v0.13.0 + google.golang.org/genproto => google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b + google.golang.org/genproto/googleapis/api => google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b + google.golang.org/genproto/googleapis/rpc => google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b + google.golang.org/grpc => google.golang.org/grpc v1.58.3 google.golang.org/protobuf => google.golang.org/protobuf v1.31.0 gopkg.in/yaml.v2 => gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 => gopkg.in/yaml.v3 v3.0.1 @@ -23,21 +23,22 @@ replace ( require ( github.com/kpango/fuid v0.0.0-20221203053508-503b5ad89aa1 github.com/kpango/glg v1.6.14 - github.com/vdaas/vald-client-go v1.7.6 + github.com/vdaas/vald-client-go v1.7.8 gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946 - google.golang.org/grpc v1.55.0 + google.golang.org/grpc v1.58.3 ) require ( - github.com/envoyproxy/protoc-gen-validate v0.10.1 // indirect + github.com/envoyproxy/protoc-gen-validate v1.0.2 // indirect github.com/goccy/go-json v0.10.2 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/kpango/fastime v1.1.9 // indirect - golang.org/x/net v0.11.0 // indirect - golang.org/x/sys v0.9.0 // indirect - golang.org/x/text v0.10.0 // indirect - google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230526203410-71b5a4ffd15e // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230526203410-71b5a4ffd15e // indirect - google.golang.org/protobuf v1.30.0 // indirect + github.com/planetscale/vtprotobuf v0.5.0 // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect + google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a // indirect + google.golang.org/protobuf v1.31.0 // indirect ) diff --git a/example/client/go.mod.default b/example/client/go.mod.default index b7a8b698b87..396196b96d5 100644 --- a/example/client/go.mod.default +++ b/example/client/go.mod.default @@ -1,6 +1,6 @@ module github.com/vdaas/vald/example/client -go 1.20 +go 1.21 replace ( github.com/envoyproxy/protoc-gen-validate => github.com/envoyproxy/protoc-gen-validate latest diff --git a/example/client/go.sum b/example/client/go.sum index 9b9963489ac..b30397075d7 100644 --- a/example/client/go.sum +++ b/example/client/go.sum @@ -1,3 +1,4 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= @@ -6,34 +7,47 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/kpango/fastime v1.1.9 h1:xVQHcqyPt5M69DyFH7g1EPRns1YQNap9d5eLhl/Jy84= github.com/kpango/fastime v1.1.9/go.mod h1:vyD7FnUn08zxY4b/QFBZVG+9EWMYsNl+QF0uE46urD4= github.com/kpango/fuid v0.0.0-20221203053508-503b5ad89aa1 h1:rxyM+7uaZQ35P9fbixdnld/h4AgEhODoubuy6A4nDdk= github.com/kpango/fuid v0.0.0-20221203053508-503b5ad89aa1/go.mod h1:CAYeq6us9NfnRkSz67/xKVIR6/vaY5ZQZRe6IVcaIKg= github.com/kpango/glg v1.6.15 h1:nw0xSxpSyrDIWHeb3dvnE08PW+SCbK+aYFETT75IeLA= github.com/kpango/glg v1.6.15/go.mod h1:cmsc7Yeu8AS3wHLmN7bhwENXOpxfq+QoqxCIk2FneRk= +github.com/planetscale/vtprotobuf v0.5.0 h1:l8PXm6Colok5z6qQLNhAj2Jq5BfoMTIHxLER5a6nDqM= +github.com/planetscale/vtprotobuf v0.5.0/go.mod h1:wm1N3qk9G/4+VM1WhpkLbvY/d8+0PbwYYpP5P5VhTks= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/vdaas/vald-client-go v1.7.6 h1:rvd7Rt6Xx917r9Yy9sB4wnYCsguegXXaQUME9JquxGU= -github.com/vdaas/vald-client-go v1.7.6/go.mod h1:rJcmCO0yuJEb4vd8jh7aDCgiZr7b10g3SYvfB9wt1O8= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/vdaas/vald-client-go v1.7.8 h1:QguvA8BTj8o3Xe2FfmSO8ipOBTTdXoTB1KnSL52+IvM= +github.com/vdaas/vald-client-go v1.7.8/go.mod h1:kZ4GSvNGrCIaD3HfA7quabWM8Z10roUzT4C4xgCSTqU= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= -golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= -golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= -golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946 h1:vJpL69PeUullhJyKtTjHjENEmZU3BkO4e+fod7nKzgM= gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946/go.mod h1:BQUWDHIAygjdt1HnUPQ0eWqLN2n5FwJycrpYUVUOx2I= -google.golang.org/genproto v0.0.0-20230626202813-9b080da550b3 h1:Yofj1/U0xc/Zi5KEpoIxm51I2f85X+eGyY4YzAujRdw= -google.golang.org/genproto v0.0.0-20230626202813-9b080da550b3/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= -google.golang.org/genproto/googleapis/api v0.0.0-20230626202813-9b080da550b3 h1:wl7z+A0jkB3Rl8Hz74SqGDlnnn5VlL2CV+9UTdZOo00= -google.golang.org/genproto/googleapis/api v0.0.0-20230626202813-9b080da550b3/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230626202813-9b080da550b3 h1:QJuqz7YzNTyKDspkp2lrzqtq4lf2AhUSpXTsGP5SbLw= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230626202813-9b080da550b3/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/grpc v1.56.1 h1:z0dNfjIl0VpaZ9iSVjA6daGatAYwPGstTjt5vkRMFkQ= -google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b h1:+YaDE2r2OG8t/z5qmsh7Y+XXwCbvadxxZ0YY6mTdrVA= +google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:CgAqfJo+Xmu0GwA0411Ht3OU3OntXwsGmrmjI8ioGXI= +google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b h1:CIC2YMXmIhYw6evmhPxBKJ4fmLbOFtXQN/GV3XOZR8k= +google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:IBQ646DjkDkvUIsVq/cc03FUFQ9wbZu7yE396YcL870= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b h1:ZlWIi1wSK56/8hn4QcBp/j9M7Gt3U/3hZw3mC7vDICo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:swOH3j0KzcDDgGUWr+SNpyTen5YrXjS3eyPzFYKc6lc= +google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= +google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/example/client/main.go b/example/client/main.go index 8585c664678..386de999174 100644 --- a/example/client/main.go +++ b/example/client/main.go @@ -25,6 +25,7 @@ import ( "github.com/vdaas/vald-client-go/v1/vald" "gonum.org/v1/hdf5" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" ) const ( @@ -41,11 +42,11 @@ var ( func init() { /** Path option specifies hdf file by path. Default value is `fashion-mnist-784-euclidean.hdf5`. - Addr option specifies grpc server address. Default value is `127.0.0.1:8080`. + Addr option specifies grpc server address. Default value is `127.0.0.1:8081`. Wait option specifies indexing wait time (in seconds). Default value is `60`. **/ flag.StringVar(&datasetPath, "path", "fashion-mnist-784-euclidean.hdf5", "dataset path") - flag.StringVar(&grpcServerAddr, "addr", "localhost:8080", "gRPC server address") + flag.StringVar(&grpcServerAddr, "addr", "localhost:8081", "gRPC server address") flag.UintVar(&indexingWaitSeconds, "wait", 60, "indexing wait seconds") flag.Parse() } @@ -62,7 +63,7 @@ func main() { ctx := context.Background() // Create a Vald client for connecting to the Vald cluster. - conn, err := grpc.DialContext(ctx, grpcServerAddr, grpc.WithInsecure()) + conn, err := grpc.DialContext(ctx, grpcServerAddr, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { glg.Fatal(err) } diff --git a/example/helm/values-with-pyroscope.yaml b/example/helm/values-with-pyroscope.yaml index df63a9a26ae..99947ab5942 100644 --- a/example/helm/values-with-pyroscope.yaml +++ b/example/helm/values-with-pyroscope.yaml @@ -54,14 +54,14 @@ gateway: cpu: 150m memory: 150Mi ingress: + # if enabled is true, vald-lb-gateway can be connected through Kubernetes ingress from the external network. enabled: true - annotations: - ingress.kubernetes.io/protocol: h2c - ingress.kubernetes.io/ssl-passthrough: "true" - traefik.protocol: h2c - kubernetes.io/ingress.class: traefik host: localhost servicePort: grpc + service: + # NOTE: https://doc.traefik.io/traefik/routing/providers/kubernetes-ingress/#on-service + annotations: + traefik.ingress.kubernetes.io/service.serversscheme: h2c gateway_config: index_replica: 2 diff --git a/example/helm/values.yaml b/example/helm/values.yaml index 76c6c45aded..8d969e02fb3 100644 --- a/example/helm/values.yaml +++ b/example/helm/values.yaml @@ -41,15 +41,13 @@ gateway: enabled: false ingress: # if enabled is true, vald-lb-gateway can be connected through Kubernetes ingress from the external network. - enabled: false + enabled: true # TODO: Set your ingress host. host: localhost + service: + # NOTE: https://doc.traefik.io/traefik/routing/providers/kubernetes-ingress/#on-service annotations: - # TODO: Set annotations which you have to set for your k8s cluster. - ingress.kubernetes.io/protocol: "h2c" - ingress.kubernetes.io/ssl-passthrough: "true" - kubernetes.io/ingress.class: "traefik" - traefik.protocol: "h2c" + traefik.ingress.kubernetes.io/service.serversscheme: h2c ## vald-agent settings agent: @@ -64,7 +62,7 @@ agent: memory: 150Mi ngt: # The number of dimensions for feature vector of fashion-mnist dataset. - dimension: 300 + dimension: 784 # We use L2-Norm for distance_type. distance_type: cos # The type of fashion-mnist's feature vectors.