Skip to content

Add readyz socket endpoint to tbot for use by teleport-update#60477

Merged
sclevine merged 16 commits intomasterfrom
sclevine/autoupdates-tbot-readyz
Oct 28, 2025
Merged

Add readyz socket endpoint to tbot for use by teleport-update#60477
sclevine merged 16 commits intomasterfrom
sclevine/autoupdates-tbot-readyz

Conversation

@sclevine
Copy link
Copy Markdown
Member

@sclevine sclevine commented Oct 22, 2025

This PR instruments tbot for compatibility with teleport-update.

In #60478, teleport-update will be updated to create a tbot.service file and manage tbot updates automatically, including restarting tbot.

This PR adds the following features to tbot to accomplish this:

  1. Passing --diag-socket-for-updater /path/to/debug.socket will create a new /readyz endpoint that teleport-update can monitor for readiness. If tbot is unready after an update, teleport-update will revert it.
  2. The /readyz endpoint now contains the process PID. teleport-update can use this to verify that the tbot responding on the socket is the target version of tbot.
  3. tbot's systemd service now passes --pid-file. Before, the systemd service was configured to look for a PID file that was never created (bug fix).

All three features are implemented by teleport already.

changelog: instrument tbot to better support teleport-update

RFD: #47126
Goal (internal): https://github.com/gravitational/cloud/issues/14225

)
}

if b.cfg.DiagSocketForUpdater != "" {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@boxofrad - do you foresee any issues with multiple replicas of the diagnostics service running ? From our current architecture, I don't see any problems but figured you would know with more certainty.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be fine!

Copy link
Copy Markdown
Contributor

@boxofrad boxofrad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, nice job!

@sclevine sclevine requested a review from strideynet October 23, 2025 17:02
@sclevine
Copy link
Copy Markdown
Member Author

I realized that the new --pid-file and hidden --diag-socket-for-updater flags should probably be added to the shared list of flags for the other start commands as well. The first flag is generally useful, and the second could be useful if you drop-in a systemd override to use one of the other start commands.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 23, 2025

Amplify deployment status

Branch Commit Job ID Status Preview Updated (UTC)
sclevine/autoupdates-tbot-readyz 38cfa2e 6 ✅SUCCEED sclevine-autoupdates-tbot-readyz 2025-10-28 22:39:45

Copy link
Copy Markdown
Contributor

@strideynet strideynet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thank you for taking this on.

@sclevine sclevine added this pull request to the merge queue Oct 28, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 28, 2025
@sclevine sclevine added this pull request to the merge queue Oct 28, 2025
@sclevine sclevine removed this pull request from the merge queue due to a manual request Oct 28, 2025
@sclevine sclevine enabled auto-merge October 28, 2025 21:26
@sclevine sclevine added this pull request to the merge queue Oct 28, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 28, 2025
@sclevine sclevine enabled auto-merge October 28, 2025 22:37
@sclevine sclevine added this pull request to the merge queue Oct 28, 2025
Merged via the queue into master with commit df59ebe Oct 28, 2025
41 checks passed
@sclevine sclevine deleted the sclevine/autoupdates-tbot-readyz branch October 28, 2025 23:20
mmcallister pushed a commit that referenced this pull request Nov 6, 2025
* PID and readyz changes for tbot

* remove teleport-update changes

* tidy

* tidy

* godoc

* linting, typos

* lint

* shared cli args + cli tests

* lint

* missing .

* flag docs

* pid example

* Apply suggestion from @strideynet

Co-authored-by: Noah Stride <noah.stride@goteleport.com>

* windows fix

* windows fix for merge queue

* missing errors on windows

---------

Co-authored-by: Noah Stride <noah.stride@goteleport.com>
sclevine added a commit that referenced this pull request Nov 7, 2025
* PID and readyz changes for tbot

* remove teleport-update changes

* tidy

* tidy

* godoc

* linting, typos

* lint

* shared cli args + cli tests

* lint

* missing .

* flag docs

* pid example

* Apply suggestion from @strideynet

Co-authored-by: Noah Stride <noah.stride@goteleport.com>

* windows fix

* windows fix for merge queue

* missing errors on windows

---------

Co-authored-by: Noah Stride <noah.stride@goteleport.com>
sclevine added a commit that referenced this pull request Nov 10, 2025
* PID and readyz changes for tbot

* remove teleport-update changes

* tidy

* tidy

* godoc

* linting, typos

* lint

* shared cli args + cli tests

* lint

* missing .

* flag docs

* pid example

* Apply suggestion from @strideynet

Co-authored-by: Noah Stride <noah.stride@goteleport.com>

* windows fix

* windows fix for merge queue

* missing errors on windows

---------

Co-authored-by: Noah Stride <noah.stride@goteleport.com>
sclevine added a commit that referenced this pull request Nov 10, 2025
* PID and readyz changes for tbot

* remove teleport-update changes

* tidy

* tidy

* godoc

* linting, typos

* lint

* shared cli args + cli tests

* lint

* missing .

* flag docs

* pid example

* Apply suggestion from @strideynet

Co-authored-by: Noah Stride <noah.stride@goteleport.com>

* windows fix

* windows fix for merge queue

* missing errors on windows

---------

Co-authored-by: Noah Stride <noah.stride@goteleport.com>
github-merge-queue bot pushed a commit that referenced this pull request Nov 11, 2025
#61190)

* PID and readyz changes for tbot

* remove teleport-update changes

* tidy

* tidy

* godoc

* linting, typos

* lint

* shared cli args + cli tests

* lint

* missing .

* flag docs

* pid example

* Apply suggestion from @strideynet



* windows fix

* windows fix for merge queue

* missing errors on windows

---------

Co-authored-by: Noah Stride <noah.stride@goteleport.com>
github-merge-queue bot pushed a commit that referenced this pull request Nov 11, 2025
#61189)

* PID and readyz changes for tbot

* remove teleport-update changes

* tidy

* tidy

* godoc

* linting, typos

* lint

* shared cli args + cli tests

* lint

* missing .

* flag docs

* pid example

* Apply suggestion from @strideynet



* windows fix

* windows fix for merge queue

* missing errors on windows

---------

Co-authored-by: Noah Stride <noah.stride@goteleport.com>
mmcallister pushed a commit that referenced this pull request Nov 19, 2025
* PID and readyz changes for tbot

* remove teleport-update changes

* tidy

* tidy

* godoc

* linting, typos

* lint

* shared cli args + cli tests

* lint

* missing .

* flag docs

* pid example

* Apply suggestion from @strideynet

Co-authored-by: Noah Stride <noah.stride@goteleport.com>

* windows fix

* windows fix for merge queue

* missing errors on windows

---------

Co-authored-by: Noah Stride <noah.stride@goteleport.com>
mmcallister pushed a commit that referenced this pull request Nov 20, 2025
* PID and readyz changes for tbot

* remove teleport-update changes

* tidy

* tidy

* godoc

* linting, typos

* lint

* shared cli args + cli tests

* lint

* missing .

* flag docs

* pid example

* Apply suggestion from @strideynet

Co-authored-by: Noah Stride <noah.stride@goteleport.com>

* windows fix

* windows fix for merge queue

* missing errors on windows

---------

Co-authored-by: Noah Stride <noah.stride@goteleport.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants