mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-28 10:47:23 +00:00
Merge pull request #1218 from marquiz/devel/configz-uri
topology-updater: use node IP in the default configz URI
This commit is contained in:
commit
ef92b2f606
5 changed files with 21 additions and 5 deletions
|
@ -112,12 +112,13 @@ func parseArgs(flags *flag.FlagSet, osArgs ...string) (*topology.Args, *resource
|
|||
}
|
||||
|
||||
if len(resourcemonitorArgs.KubeletConfigURI) == 0 {
|
||||
if len(utils.NodeName()) == 0 {
|
||||
fmt.Fprintf(flags.Output(), "unable to determine the default kubelet config endpoint 'https://${NODE_NAME}:%d/configz' due to empty NODE_NAME environment, "+
|
||||
"please either define the NODE_NAME environment variable or specify endpoint with the -kubelet-config-uri flag\n", kubeletSecurePort)
|
||||
nodeAddress := os.Getenv("NODE_ADDRESS")
|
||||
if len(nodeAddress) == 0 {
|
||||
fmt.Fprintf(flags.Output(), "unable to determine the default kubelet config endpoint 'https://${NODE_ADDRESS}:%d/configz' due to empty NODE_ADDRESS environment, "+
|
||||
"please either define the NODE_ADDRESS environment variable or specify endpoint with the -kubelet-config-uri flag\n", kubeletSecurePort)
|
||||
os.Exit(1)
|
||||
}
|
||||
resourcemonitorArgs.KubeletConfigURI = fmt.Sprintf("https://%s:%d/configz", utils.NodeName(), kubeletSecurePort)
|
||||
resourcemonitorArgs.KubeletConfigURI = fmt.Sprintf("https://%s:%d/configz", nodeAddress, kubeletSecurePort)
|
||||
}
|
||||
|
||||
return args, resourcemonitorArgs
|
||||
|
|
7
deployment/components/topology-updater/env.yaml
Normal file
7
deployment/components/topology-updater/env.yaml
Normal file
|
@ -0,0 +1,7 @@
|
|||
- op: add
|
||||
path: "/spec/template/spec/containers/0/env/-"
|
||||
value:
|
||||
name: NODE_ADDRESS
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.hostIP
|
|
@ -14,3 +14,7 @@ patches:
|
|||
target:
|
||||
labelSelector: app=nfd
|
||||
name: nfd-topology-updater
|
||||
- path: env.yaml
|
||||
target:
|
||||
labelSelector: app=nfd
|
||||
name: nfd-topology-updater
|
||||
|
|
|
@ -37,6 +37,10 @@ spec:
|
|||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- name: NODE_ADDRESS
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.hostIP
|
||||
command:
|
||||
- "nfd-topology-updater"
|
||||
args:
|
||||
|
|
|
@ -109,7 +109,7 @@ nfd-topology-updater -watch-namespace=rte
|
|||
The `-kubelet-config-uri` specifies the path to the Kubelet's configuration.
|
||||
Note that the URi could either be a local host file or an HTTP endpoint.
|
||||
|
||||
Default: `https://${NODE_NAME}:10250/configz`
|
||||
Default: `https://${NODE_ADDRESS}:10250/configz`
|
||||
|
||||
Example:
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue