Skip to content

Commit

Permalink
Align env vars (#627)
Browse files Browse the repository at this point in the history
* Align env vars

Signed-off-by: Arpad Kiss <arpad.a.kiss@est.tech>

* Update license

Signed-off-by: Arpad Kiss <arpad.a.kiss@est.tech>

---------

Signed-off-by: Arpad Kiss <arpad.a.kiss@est.tech>
  • Loading branch information
arp-est authored May 14, 2024
1 parent 14344ff commit 018db44
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
26 changes: 17 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
15 changes: 9 additions & 6 deletions internal/config/config.go
Original file line number Diff line number Diff line change
@@ -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");
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 018db44

Please sign in to comment.