From 515e54b1ee669378e64cff0585cac00134236899 Mon Sep 17 00:00:00 2001 From: Arpad Kiss <158226216+arp-est@users.noreply.github.com> Date: Tue, 14 May 2024 12:26:39 +0200 Subject: [PATCH] Align env vars (#677) Signed-off-by: Arpad Kiss --- README.md | 19 ++++++++++++++++++- internal/config/config.go | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bce57260..4f13ad3a 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,23 @@ You can build the docker container by running: docker build . ``` +# Usage + +## Environment config + + +* `NSM_NAME` - Name of Network service manager (default: "nmgr") +* `NSM_LISTEN_ON` - url to listen on. tcp:// one will be used a public to register NSM. (default: "unix:///var/lib/networkservicemesh/nsm.io.sock") +* `NSM_REGISTRY_URL` - A NSE registry url to use (default: "tcp://localhost:5001") +* `NSM_MAX_TOKEN_LIFETIME` - maximum lifetime of tokens (default: "10m") +* `NSM_REGISTRY_SERVER_POLICIES` - paths to files and directories that contain registry server policies (default: "etc/nsm/opa/common/.*.rego,etc/nsm/opa/registry/.*.rego,etc/nsm/opa/server/.*.rego") +* `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_LOG_LEVEL` - Log level (default: "INFO") +* `NSM_DIAL_TIMEOUT` - Timeout for the dial the next endpoint (default: "750ms") +* `NSM_FORWARDER_NETWORK_SERVICE_NAME` - the default service name for forwarder discovering (default: "forwarder") +* `NSM_OPEN_TELEMETRY_ENDPOINT` - OpenTelemetry Collector Endpoint (default: "otel-collector.observability.svc.cluster.local:4317") +* `NSM_METRICS_EXPORT_INTERVAL` - interval between mertics exports (default: "10s") + # Testing ## Testing Docker container @@ -82,4 +99,4 @@ through to the point of running nsmgr, you will not be able to attach a debugger # Build Docker image compatible with integration testing suite: -`docker build . -t networkservicemeshci/cmd-nsmgr:master && kind load docker-image networkservicemeshci/cmd-nsmgr:master` \ No newline at end of file +`docker build . -t networkservicemeshci/cmd-nsmgr:master && kind load docker-image networkservicemeshci/cmd-nsmgr:master` diff --git a/internal/config/config.go b/internal/config/config.go index 955abbb6..3a0e8c32 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -35,6 +35,6 @@ type Config struct { LogLevel string `default:"INFO" desc:"Log level" split_words:"true"` DialTimeout time.Duration `default:"750ms" desc:"Timeout for the dial the next endpoint" split_words:"true"` ForwarderNetworkServiceName string `default:"forwarder" desc:"the default service name for forwarder discovering" split_words:"true"` - OpenTelemetryEndpoint string `default:"otel-collector.observability.svc.cluster.local:4317" desc:"OpenTelemetry Collector Endpoint"` + OpenTelemetryEndpoint string `default:"otel-collector.observability.svc.cluster.local:4317" desc:"OpenTelemetry Collector Endpoint" split_words:"true"` MetricsExportInterval time.Duration `default:"10s" desc:"interval between mertics exports" split_words:"true"` }