From 0afa01c64bfbdbc5835e2d3cde74f8e770543ae6 Mon Sep 17 00:00:00 2001 From: Arpad Kiss Date: Tue, 23 Apr 2024 11:51:05 +0200 Subject: [PATCH] Align env vars Signed-off-by: Arpad Kiss --- README.md | 22 +++++++++++++++++++++- main.go | 4 ++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 80fa61b..7f91923 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,26 @@ You can build the docker container by running: docker build . ``` +# Usage + +## 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") + # Testing ## Testing Docker container @@ -72,4 +92,4 @@ docker run --privileged -e DLV_LISTEN_FORWARDER=:50000 -p 40000:40000 -p 50000:5 ``` Please note, the tests **start** the cmd, so until you connect to port 40000 with your debugger and walk the tests -through to the point of running cmd, you will not be able to attach a debugger on port 50000 to the cmd. \ No newline at end of file +through to the point of running cmd, you will not be able to attach a debugger on port 50000 to the cmd. diff --git a/main.go b/main.go index 1d9f16c..73da663 100644 --- a/main.go +++ b/main.go @@ -103,8 +103,8 @@ type Config struct { RegisterAsURL url.URL `default:"" desc:"Endpoint URL" split_words:"true"` Labels map[string]string `default:"" desc:"Endpoint labels"` TunnelIP net.IP `desc:"IP to use for tunnels" split_words:"true"` - Vl3Prefix string `default:"169.254.0.0/16" desc:"vl3 prefix"` - InterfaceName string `default:"nsm" desc:"Name of the nsm network interface"` + Vl3Prefix string `default:"169.254.0.0/16" desc:"vl3 prefix" split_words:"true"` + InterfaceName string `default:"nsm" desc:"Name of the nsm network interface" split_words:"true"` FederatesWith string `default:"k8s.nsm" desc:"Name of the federated domain" split_words:"true"` TrustDomain string `default:"docker.nsm" desc:"Name of the trust domain" split_words:"true"` LogLevel string `default:"INFO" desc:"Log level" split_words:"true"`