From f852ffcadc77b49e8bef0f0af0e71184bee21425 Mon Sep 17 00:00:00 2001 From: Arpad Kiss Date: Mon, 22 Apr 2024 15:00:27 +0200 Subject: [PATCH 1/2] Align env vars Signed-off-by: Arpad Kiss --- README.md | 31 +++++++++++++++++++------------ main.go | 2 +- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index a33a68eb..b8364b77 100644 --- a/README.md +++ b/README.md @@ -18,18 +18,25 @@ Also it works as a device plugin server providing resources for the client pods. `cmd-forwarder-sriov` accept following environment variables: -* `NSM_NAME` - A string value of forwarder network service endpoint name (default `sriov-forwarder`) -* `NSM_NS_NAME` - A string value of forwarder network service name (default `sriovns`) -* `NSM_CONNECT_TO` - A Network Service Manager connectTo URL (default `unix:///var/lib/networkservicemesh/nsm.io.sock`) -* `NSM_MAX_TOKEN_LIFETIME` - A token lifetime duration (default `24h`) -* `NSM_RESOURCE_POLL_TIMEOUT` - A timeout to poll device plugin resources usage from kubelet API (default `30s`) -* `NSM_DEVICE_PLUGIN_PATH` - Path to the device plugin directory (default `/var/lib/kubelet/device-plugins/`) -* `NSM_POD_RESOURCES_PATH` - Path to the pod resources directory (default `/var/lib/kubelet/pod-resources/`) -* `NSM_SRIOV_CONFIG_FILE` - Path to the config file (default `./pci.config`) -* `NSM_PCI_DEVICES_PATH` - Path to the PCI devices directory (default `/sys/bus/pci/devices`) -* `NSM_PCI_DRIVERS_PATH` - Path to the PCI drivers directory (default `/sys/bus/pci/drivers`) -* `NSM_CGROUP_PATH` - Path to the host `/sys/fs/cgroup/devices` directory (default `/host/sys/fs/cgroup/devices`) -* `NSM_VFIO_PATH` - Path to the host `/dev/vfio` directory (default `/host/dev/vfio`) +* `NSM_NAME` - A string value of forwarder network service endpoint name (default `sriov-forwarder`) +* `NSM_NSNAME` - A string value of forwarder network service name (default `sriovns`) +* `NSM_CONNECT_TO` - A Network Service Manager connectTo URL (default `unix:///var/lib/networkservicemesh/nsm.io.sock`) +* `NSM_MAX_TOKEN_LIFETIME` - A token lifetime duration (default `24h`) +* `NSM_RESOURCE_POLL_TIMEOUT` - A timeout to poll device plugin resources usage from kubelet API (default `30s`) +* `NSM_DEVICE_PLUGIN_PATH` - Path to the device plugin directory (default `/var/lib/kubelet/device-plugins/`) +* `NSM_POD_RESOURCES_PATH` - Path to the pod resources directory (default `/var/lib/kubelet/pod-resources/`) +* `NSM_SRIOV_CONFIG_FILE` - Path to the config file (default `./pci.config`) +* `NSM_PCI_DEVICES_PATH` - Path to the PCI devices directory (default `/sys/bus/pci/devices`) +* `NSM_PCI_DRIVERS_PATH` - Path to the PCI drivers directory (default `/sys/bus/pci/drivers`) +* `NSM_CGROUP_PATH` - Path to the host `/sys/fs/cgroup/devices` directory (default `/host/sys/fs/cgroup/devices`) +* `NSM_VFIO_PATH` - Path to the host `/dev/vfio` directory (default `/host/dev/vfio`) +* `NSM_DIAL_TIMEOUT` - Timeout for the dial the next endpoint +* `NSM_LABELS` - Labels related to this forwarder-sriov instance +* `NSM_LOG_LEVEL` - Log level +* `NSM_METRICS_EXPORT_INTERVAL` - interval between mertics exports +* `NSM_OPEN_TELEMETRY_ENDPOINT` - OpenTelemetry Collector Endpoint +* `NSM_REGISTRY_CLIENT_POLICIES` - paths to files and directories that contain registry client policies + ## Config file diff --git a/main.go b/main.go index d009c090..b31b5bca 100644 --- a/main.go +++ b/main.go @@ -85,7 +85,7 @@ type Config struct { CgroupPath string `default:"/host/sys/fs/cgroup/devices" desc:"path to the host cgroup directory" split_words:"true"` VFIOPath string `default:"/host/dev/vfio" desc:"path to the host VFIO directory" 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"` } From 77f33a224545e948a0e080f2fe47c71f409489da Mon Sep 17 00:00:00 2001 From: Arpad Kiss Date: Wed, 24 Apr 2024 16:08:41 +0200 Subject: [PATCH 2/2] Update license Signed-off-by: Arpad Kiss --- README.md | 1 - main.go | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b8364b77..69167e48 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,6 @@ Also it works as a device plugin server providing resources for the client pods. * `NSM_METRICS_EXPORT_INTERVAL` - interval between mertics exports * `NSM_OPEN_TELEMETRY_ENDPOINT` - OpenTelemetry Collector Endpoint * `NSM_REGISTRY_CLIENT_POLICIES` - paths to files and directories that contain registry client policies - ## Config file diff --git a/main.go b/main.go index b31b5bca..8e340ea7 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,8 @@ // // 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");