From 018db4452ed335f64287347e95333a7ed0c7778f Mon Sep 17 00:00:00 2001 From: Arpad Kiss <158226216+arp-est@users.noreply.github.com> Date: Tue, 14 May 2024 12:23:10 +0200 Subject: [PATCH] Align env vars (#627) * Align env vars Signed-off-by: Arpad Kiss * Update license Signed-off-by: Arpad Kiss --------- Signed-off-by: Arpad Kiss --- README.md | 26 +++++++++++++++++--------- internal/config/config.go | 15 +++++++++------ 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 9644677..fec53d9 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,14 @@ This README will provide directions for building, testing, and debugging that co `cmd-nsc` accept following environment variables: -* NSM_NAME - A string value of network service client name (default "nsc") -* NSM_CONNECT_TO - A Network service Manager connectTo URL (default "unix:///var/lib/networkservicemesh/nsm.io.sock") -* NSM_DIAL_TIMEOUT - A timeout to dial Network Service Manager (default 5s) -* NSM_REQUEST_TIMEOUT - A timeout to request Network Service Endpoint (default 15s) -* NSM_MAX_TOKEN_LIFETIME - A token lifetime duration (default 24h) -* NSM_LABELS - A list of client labels with format key1=val1,key2=val2, will be used a primary list for network services -* NSM_MECHANISM - Default Mechanism to use, supported values "kernel", "vfio" -* NSM_NETWORK_SERVICES - A list of Network Service Requests URLs with inner format +* `NSM_NAME` - A string value of network service client name (default "nsc") +* `NSM_CONNECT_TO` - A Network service Manager connectTo URL (default "unix:///var/lib/networkservicemesh/nsm.io.sock") +* `NSM_DIAL_TIMEOUT` - A timeout to dial Network Service Manager (default 5s) +* `NSM_REQUEST_TIMEOUT` - A timeout to request Network Service Endpoint (default 15s) +* `NSM_MAX_TOKEN_LIFETIME` - A token lifetime duration (default 24h) +* `NSM_LABELS` - A list of client labels with format key1=val1,key2=val2, will be used a primary list for network services +* `NSM_MECHANISM` - Default Mechanism to use, supported values "kernel", "vfio" +* `NSM_NETWORK_SERVICES` - A list of Network Service Requests URLs with inner format - \[kernel://]nsName\[@domainName]/interfaceName?\[label1=value1\*(&labelN=valueN)] - \[vfio://]nsName\[@domainName]?\[label1=value1\*(&labelN=valueN)] - nsName - a Network service name requested @@ -37,7 +37,15 @@ This README will provide directions for building, testing, and debugging that co - **vfio** mechanism - **l2-controller** network service - **{ sriovToken: "l2.domain/1G" }** request parameters - +* `NSM_AWARENESS_GROUPS` - Awareness groups for mutually aware NSEs +* `NSM_LIVENESS_CHECK_ENABLED` - Dataplane liveness check enabled/disabled +* `NSM_LIVENESS_CHECK_INTERVAL` - Dataplane liveness check interval +* `NSM_LIVENESS_CHECK_TIMEOUT` - Dataplane liveness check timeout +* `NSM_LOCAL_DNS_SERVER_ADDRESS` - Default address for local DNS server +* `NSM_LOCAL_DNS_SERVER_ENABLED` - Local DNS Server enabled/disabled +* `NSM_LOG_LEVEL` - Log level +* `NSM_METRICS_EXPORT_INTERVAL` - interval between mertics exports +* `NSM_OPEN_TELEMETRY_ENDPOINT` - OpenTelemetry Collector Endpoint # Build diff --git a/internal/config/config.go b/internal/config/config.go index 5efdb0f..054d859 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -1,8 +1,11 @@ // Copyright (c) 2020-2022 Doc.ai and/or its affiliates. +// // Copyright (c) 2021-2022 Nordix and/or its affiliates. // // Copyright (c) 2023 Cisco and/or its affiliates. // +// Copyright (c) 2024 OpenInfra Foundation Europe. All rights reserved. +// // SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,15 +46,15 @@ type Config struct { NetworkServices []url.URL `default:"" desc:"A list of Network Service Requests" split_words:"true"` AwarenessGroups awarenessgroups.Decoder `defailt:"" desc:"Awareness groups for mutually aware NSEs" split_words:"true"` LogLevel string `default:"INFO" desc:"Log level" 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"` - LocalDNSServerEnabled bool `default:"true" desc:"Local DNS Server enabled/disabled"` - LocalDNSServerAddress string `default:"127.0.0.1:53" desc:"Default address for local DNS server"` + LocalDNSServerEnabled bool `default:"true" desc:"Local DNS Server enabled/disabled" split_words:"true"` + LocalDNSServerAddress string `default:"127.0.0.1:53" desc:"Default address for local DNS server" split_words:"true"` - LivenessCheckEnabled bool `default:"true" desc:"Dataplane liveness check enabled/disabled"` - LivenessCheckInterval time.Duration `default:"200ms" desc:"Dataplane liveness check interval"` - LivenessCheckTimeout time.Duration `default:"1s" desc:"Dataplane liveness check timeout"` + LivenessCheckEnabled bool `default:"true" desc:"Dataplane liveness check enabled/disabled" split_words:"true"` + LivenessCheckInterval time.Duration `default:"200ms" desc:"Dataplane liveness check interval" split_words:"true"` + LivenessCheckTimeout time.Duration `default:"1s" desc:"Dataplane liveness check timeout" split_words:"true"` } // IsValid - check if configuration is valid