Type:
How-To
Question/Problem:
How to query teleport version of nodes and agents. Some times it is required to get versions of all the nodes connected to teleport cluster like during upgrades to find which all nodes will need upgrade etc.
Solution:
- There is metrics 'teleport_build_info' in teleport, which emits its version. If metrics are enabled on teleport nodes and are digested to aggregation too, it is easier to get version information of nodes from here.
- To get node version information, `tctl` tool can be used to query `auth` database of nodes using `tctl get nodes`. Output of this command to json dumps version information. To filter exact version and hostname information this command can be used (requires jq)
% tctl get nodes --format json | jq '.[] | .spec.hostname + ": " + .spec.version'
- Another option is to use 'dynamic' labels to fetch version of teleport using `teleport version` command as below. This will label node with `teleport-version`.
ssh_service:
enabled: yes
listen_addr: 0.0.0.0:3022
commands:
- name: teleport-version
command: ["/bin/sh", "-c", "/usr/local/bin/teleport version | cut -d' ' -f3"]
period: 1m0s
Comments
0 comments
Article is closed for comments.