Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional TLS support for exporter #122

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions cmd/dcgm-exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ var (
CLINoHostname = "no-hostname"
CLIUseFakeGpus = "fake-gpus"
CLIConfigMapData = "configmap-data"
CLIWebConfig = "web-config"
)

func main() {
Expand Down Expand Up @@ -174,6 +175,12 @@ func main() {
Usage: "Accept GPUs that are fake, for testing purposes only",
EnvVars: []string{"DCGM_EXPORTER_USE_FAKE_GPUS"},
},
&cli.StringFlag{
Name: CLIWebConfig,
Value: "",
Usage: "TLS config file following webConfig spec. Only tls_server_config implemented. All other parameters are ignored",
EnvVars: []string{"DCGM_EXPORTER_WEB_CONFIG"},
},
}

c.Action = func(c *cli.Context) error {
Expand Down Expand Up @@ -269,8 +276,6 @@ restart:
return nil
}
}

return nil
}

func parseDeviceOptionsToken(token string, dOpt *dcgmexporter.DeviceOptions) error {
Expand Down Expand Up @@ -423,5 +428,6 @@ func contextToConfig(c *cli.Context) (*dcgmexporter.Config, error) {
NoHostname: c.Bool(CLINoHostname),
UseFakeGpus: c.Bool(CLIUseFakeGpus),
ConfigMapData: c.String(CLIConfigMapData),
WebConfig: c.String(CLIWebConfig),
}, nil
}
9 changes: 5 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ replace (

require (
github.com/NVIDIA/go-dcgm v0.0.0-20221107203308-b6ed78cdc8d3
github.com/NVIDIA/gpu-monitoring-tools v0.0.0-20211102125545-5a2c58442e48 // indirect
github.com/NVIDIA/gpu-monitoring-tools v0.0.0-20211102125545-5a2c58442e48
github.com/gorilla/mux v1.8.0
github.com/prometheus/exporter-toolkit v0.8.2
github.com/sirupsen/logrus v1.7.0
github.com/stretchr/testify v1.6.1
github.com/stretchr/testify v1.8.0
github.com/urfave/cli/v2 v2.3.0
google.golang.org/grpc v1.35.0
google.golang.org/grpc v1.47.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.20.2
k8s.io/apimachinery v0.20.2
k8s.io/cli-runtime v0.20.2
k8s.io/client-go v0.20.2
k8s.io/kubelet v0.20.2
k8s.io/kubernetes v0.0.0-00010101000000-000000000000
Expand Down
Loading