Skip to content

Commit

Permalink
Adds new values to hack/config.yml, adds support for custom agent por…
Browse files Browse the repository at this point in the history
…t number (#109)
  • Loading branch information
amorey authored Sep 17, 2024
1 parent 7c1454e commit 57e9f08
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 20 deletions.
10 changes: 5 additions & 5 deletions backend/server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/gorilla/websocket v1.5.1
github.com/gwatts/gin-adapter v1.0.0
github.com/hasura/go-graphql-client v0.10.0
github.com/kubetail-org/grpc-dispatcher-go v0.0.1
github.com/kubetail-org/grpc-dispatcher-go v0.0.2
github.com/kubetail-org/kubetail/backend/common v0.0.0-00010101000000-000000000000
github.com/mitchellh/mapstructure v1.5.0
github.com/rs/zerolog v1.32.0
Expand All @@ -25,12 +25,12 @@ require (
github.com/spf13/viper v1.18.2
github.com/stretchr/testify v1.9.0
github.com/vektah/gqlparser/v2 v2.5.11
google.golang.org/grpc v1.66.1
google.golang.org/grpc v1.66.2
google.golang.org/protobuf v1.34.2
k8s.io/api v0.31.0
k8s.io/apimachinery v0.31.0
k8s.io/api v0.31.1
k8s.io/apimachinery v0.31.1
k8s.io/apiserver v0.30.1
k8s.io/client-go v0.31.0
k8s.io/client-go v0.31.1
k8s.io/utils v0.0.0-20240902221715-702e33fdd3c3
)

Expand Down
20 changes: 10 additions & 10 deletions backend/server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kubetail-org/grpc-dispatcher-go v0.0.1 h1:JGb9uwcec70No1fDEsyUNhSIAx6YGA8g4QGfGB+TdNY=
github.com/kubetail-org/grpc-dispatcher-go v0.0.1/go.mod h1:UHbHIp00DcCyOV0P/bd3PUQ77uQEGOICVp2D7Ikk1Fs=
github.com/kubetail-org/grpc-dispatcher-go v0.0.2 h1:ho+RffttK2Wdq99lJG+wUDJe+pmSTLSrrXCOgxQAvlg=
github.com/kubetail-org/grpc-dispatcher-go v0.0.2/go.mod h1:UHbHIp00DcCyOV0P/bd3PUQ77uQEGOICVp2D7Ikk1Fs=
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
Expand Down Expand Up @@ -392,8 +392,8 @@ google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 h1:
google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117/go.mod h1:OimBR/bc1wPO9iV4NC2bpyjy3VnAwZh5EBPQdtaE5oo=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
google.golang.org/grpc v1.66.1 h1:hO5qAXR19+/Z44hmvIM4dQFMSYX9XcWsByfoxutBpAM=
google.golang.org/grpc v1.66.1/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y=
google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo=
google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand All @@ -414,14 +414,14 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.31.0 h1:b9LiSjR2ym/SzTOlfMHm1tr7/21aD7fSkqgD/CVJBCo=
k8s.io/api v0.31.0/go.mod h1:0YiFF+JfFxMM6+1hQei8FY8M7s1Mth+z/q7eF1aJkTE=
k8s.io/apimachinery v0.31.0 h1:m9jOiSr3FoSSL5WO9bjm1n6B9KROYYgNZOb4tyZ1lBc=
k8s.io/apimachinery v0.31.0/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
k8s.io/api v0.31.1 h1:Xe1hX/fPW3PXYYv8BlozYqw63ytA92snr96zMW9gWTU=
k8s.io/api v0.31.1/go.mod h1:sbN1g6eY6XVLeqNsZGLnI5FwVseTrZX7Fv3O26rhAaI=
k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U=
k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
k8s.io/apiserver v0.30.1 h1:BEWEe8bzS12nMtDKXzCF5Q5ovp6LjjYkSp8qOPk8LZ8=
k8s.io/apiserver v0.30.1/go.mod h1:i87ZnQ+/PGAmSbD/iEKM68bm1D5reX8fO4Ito4B01mo=
k8s.io/client-go v0.31.0 h1:QqEJzNjbN2Yv1H79SsS+SWnXkBgVu4Pj3CJQgbx0gI8=
k8s.io/client-go v0.31.0/go.mod h1:Y9wvC76g4fLjmU0BA+rV+h2cncoadjvjjkkIGoTLcGU=
k8s.io/client-go v0.31.1 h1:f0ugtWSbWpxHR7sjVpQwuvw9a3ZKLXX0u0itkFXufb0=
k8s.io/client-go v0.31.1/go.mod h1:sKI8871MJN2OyeqRlmA4W4KM9KBdBUpDLu/43eGemCg=
k8s.io/component-base v0.30.1 h1:bvAtlPh1UrdaZL20D9+sWxsJljMi0QZ3Lmw+kmZAaxQ=
k8s.io/component-base v0.30.1/go.mod h1:e/X9kDiOebwlI41AvBHuWdqFriSRrX50CdwA9TFaHLI=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
Expand Down
13 changes: 12 additions & 1 deletion backend/server/internal/ginapp/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
package ginapp

import (
"fmt"
"html/template"
"net"
"path"

grpcdispatcher "github.com/kubetail-org/grpc-dispatcher-go"
Expand Down Expand Up @@ -78,8 +80,17 @@ func mustNewGrpcDispatcher(cfg *config.Config) *grpcdispatcher.Dispatcher {
dialOpts = append(dialOpts, grpc.WithTransportCredentials(insecure.NewCredentials()))
}

// get port
_, port, err := net.SplitHostPort(cfg.Agent.Addr)
if err != nil {
zlog.Fatal().Err(err).Send()
}

// TODO: reuse app clientset
d, err := grpcdispatcher.NewDispatcher("kubernetes://kubetail-agent", grpcdispatcher.WithDialOptions(dialOpts...))
d, err := grpcdispatcher.NewDispatcher(
fmt.Sprintf("kubernetes://kubetail-agent:%s", port),
grpcdispatcher.WithDialOptions(dialOpts...),
)
if err != nil {
zlog.Fatal().Err(err).Send()
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^1.6.0"
},
"packageManager": "pnpm@9.10.0"
"packageManager": "pnpm@9.10.0+sha256.355a8ab8dbb6ad41befbef39bc4fd6b5df85e12761d2724bd01f13e878de4b13"
}
32 changes: 29 additions & 3 deletions hack/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,11 @@ agent:

## addr ##
#
# Sets the target ip and port to bind the server to
# Sets the target ip and port to bind the gRPC server to
#
# Default value: ":4000"
# Default value: ":50051"
#
addr: :4000
addr: :50051

## logging ##
#
Expand Down Expand Up @@ -325,3 +325,29 @@ agent:
# - pretty
#
format: json

## tls ##
#
tls:

## enabled ##
#
# Default value: false
#
enabled: false

## cert-file ##
#
# Path to tls certificate file
#
# Default value: __empty__
#
cert-file:

## key-file ##
#
# Path to tls key file
#
# Default value: __empty__
#
key-file:

0 comments on commit 57e9f08

Please sign in to comment.