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

Update vpphelper manually #286

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
35 changes: 18 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,24 @@ docker build .

## Environment config

* `NSM_NAME` - Name of vL3 Server (default: "docker-vl3-server")
* `NSM_REQUEST_TIMEOUT` - timeout to request NSE (default: "15s")
* `NSM_CONNECT_TO` - url to connect to (default: "tcp://k8s.nsm")
* `NSM_MAX_TOKEN_LIFETIME` - maximum lifetime of tokens (default: "10m")
* `NSM_REGISTRY_CLIENT_POLICIES` - paths to files and directories that contain registry client policies (default: "etc/nsm/opa/common/.*.rego,etc/nsm/opa/registry/.*.rego,etc/nsm/opa/client/.*.rego")
* `NSM_SERVICE_NAMES` - Name of providing service (default: "docker-vl3")
* `NSM_REGISTER_SERVICE` - if true then registers network service on startup (default: "true")
* `NSM_REGISTER_AS_URL` - Endpoint URL
* `NSM_LABELS` - Endpoint labels
* `NSM_TUNNEL_IP` - IP to use for tunnels
* `NSM_VL3_PREFIX` - vl3 prefix (default: "169.254.0.0/16")
* `NSM_INTERFACE_NAME` - Name of the nsm network interface (default: "nsm")
* `NSM_FEDERATES_WITH` - Name of the federated domain (default: "k8s.nsm")
* `NSM_TRUST_DOMAIN` - Name of the trust domain (default: "docker.nsm")
* `NSM_LOG_LEVEL` - Log level (default: "INFO")
* `NSM_PPROF_ENABLED` - is pprof enabled (default: "false")
* `NSM_PPROF_LISTEN_ON` - pprof URL to ListenAndServe (default: "localhost:6060")
* `NSM_NAME` - Name of vL3 Server (default: "docker-vl3-server")
* `NSM_REQUEST_TIMEOUT` - timeout to request NSE (default: "15s")
* `NSM_CONNECT_TO` - url to connect to (default: "tcp://k8s.nsm")
* `NSM_MAX_TOKEN_LIFETIME` - maximum lifetime of tokens (default: "10m")
* `NSM_REGISTRY_CLIENT_POLICIES` - paths to files and directories that contain registry client policies (default: "etc/nsm/opa/common/.*.rego,etc/nsm/opa/registry/.*.rego,etc/nsm/opa/client/.*.rego")
* `NSM_SERVICE_NAMES` - Name of providing service (default: "docker-vl3")
* `NSM_REGISTER_SERVICE` - if true then registers network service on startup (default: "true")
* `NSM_REGISTER_AS_URL` - Endpoint URL
* `NSM_LABELS` - Endpoint labels
* `NSM_TUNNEL_IP` - IP to use for tunnels
* `NSM_VL3_PREFIX` - vl3 prefix (default: "169.254.0.0/16")
* `NSM_INTERFACE_NAME` - Name of the nsm network interface (default: "nsm")
* `NSM_FEDERATES_WITH` - Name of the federated domain (default: "k8s.nsm")
* `NSM_TRUST_DOMAIN` - Name of the trust domain (default: "docker.nsm")
* `NSM_LOG_LEVEL` - Log level (default: "INFO")
* `NSM_PPROF_ENABLED` - is pprof enabled (default: "false")
* `NSM_PPROF_LISTEN_ON` - pprof URL to ListenAndServe (default: "localhost:6060")
* `NSM_VPP_MIN_OPERATION_TIMEOUT` - minimum timeout for every vpp operation

# Testing

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/networkservicemesh/sdk v0.5.1-0.20241227223757-422abe9bfbdd
github.com/networkservicemesh/sdk-kernel v0.0.0-20241227224026-3bba51753247
github.com/networkservicemesh/sdk-vpp v0.0.0-20241227224413-166396795a3c
github.com/networkservicemesh/vpphelper v0.0.0-20240115135903-e2b961f768b6
github.com/networkservicemesh/vpphelper v0.0.0-20241209033247-bcb5c25a9f29
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.3
github.com/spiffe/go-spiffe/v2 v2.1.7
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ github.com/networkservicemesh/sdk-kernel v0.0.0-20241227224026-3bba51753247 h1:Z
github.com/networkservicemesh/sdk-kernel v0.0.0-20241227224026-3bba51753247/go.mod h1:BEcSP25b0qmilHCYv5QtGtADOI4sU8eX/lJskK5O5fc=
github.com/networkservicemesh/sdk-vpp v0.0.0-20241227224413-166396795a3c h1:sLos0zvQuAqbTjvIM0ZIJ+w0XE/RCDgrWfEz5N8zmPA=
github.com/networkservicemesh/sdk-vpp v0.0.0-20241227224413-166396795a3c/go.mod h1:UeWHbi3ozPYRxoA2nlZNWsSDnsMCr4PM5abgtJO93iM=
github.com/networkservicemesh/vpphelper v0.0.0-20240115135903-e2b961f768b6 h1:o+enN5yCikNXZN+hO+JjE+aLxBWq9+GMVF9GSQtpwMI=
github.com/networkservicemesh/vpphelper v0.0.0-20240115135903-e2b961f768b6/go.mod h1:n6+8PnoDvWj6WMryfU3J8HOCusgysFjQ0kGLfrcsDEM=
github.com/networkservicemesh/vpphelper v0.0.0-20241209033247-bcb5c25a9f29 h1:hqYoTeQ9mFOIoKUMBXg779SU2yJWrrapucKgoPNZ1co=
github.com/networkservicemesh/vpphelper v0.0.0-20241209033247-bcb5c25a9f29/go.mod h1:Qc5x5poZk5cVzcHk4ZIL6+NMC95uoitsmmnl7X9V/Yw=
github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8=
github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
github.com/open-policy-agent/opa v0.44.0 h1:sEZthsrWBqIN+ShTMJ0Hcz6a3GkYsY4FaB2S/ou2hZk=
Expand Down
1 change: 1 addition & 0 deletions internal/imports/imports_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
"github.com/google/uuid"
"github.com/kelseyhightower/envconfig"
"github.com/pkg/errors"
"go.fd.io/govpp/api"

nested "github.com/antonfisher/nested-logrus-formatter"
"github.com/edwarnicke/grpcfd"
Expand All @@ -45,6 +46,7 @@ import (
"google.golang.org/grpc/credentials"

"github.com/networkservicemesh/vpphelper"
"github.com/networkservicemesh/vpphelper/extendtimeout"

"github.com/networkservicemesh/api/pkg/api/networkservice"
"github.com/networkservicemesh/api/pkg/api/networkservice/mechanisms/cls"
Expand Down Expand Up @@ -111,6 +113,7 @@ type Config struct {
LogLevel string `default:"INFO" desc:"Log level" split_words:"true"`
PprofEnabled bool `default:"false" desc:"is pprof enabled" split_words:"true"`
PprofListenOn string `default:"localhost:6060" desc:"pprof URL to ListenAndServe" split_words:"true"`
VPPMinOperationTimeout time.Duration `default:"2s" desc:"minimum timeout for every vpp operation" split_words:"true"`
}

// Process prints and processes env to config
Expand Down Expand Up @@ -197,6 +200,7 @@ func main() {
<-vppErrCh
}()
config.TunnelIP = vppinit.Must(vppinit.LinkToAfPacket(ctx, vppConn, config.TunnelIP))
vppConn = extendtimeout.NewConnection(vppConn, config.VPPMinOperationTimeout)

// ********************************************************************************
log.FromContext(ctx).Info("executing phase 3: start spire-server and spire-agent")
Expand Down Expand Up @@ -343,7 +347,7 @@ func main() {
<-vppErrCh
}

func createVl3Endpoint(ctx context.Context, config *Config, vppConn vpphelper.Connection, source *workloadapi.X509Source, tlsServerConfig *tls.Config) *grpc.Server {
func createVl3Endpoint(ctx context.Context, config *Config, vppConn api.Connection, source *workloadapi.X509Source, tlsServerConfig *tls.Config) *grpc.Server {
vl3Endpoint := endpoint.NewServer(ctx,
spiffejwt.TokenGeneratorFunc(source, config.MaxTokenLifetime),
endpoint.WithName(config.Name),
Expand Down
Loading