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

kube-agent-update: Use the RFD-184 webapi proxy update protocol by default when possible #50464

Merged
merged 3 commits into from
Jan 17, 2025

Conversation

hugoShaka
Copy link
Contributor

Part of: RFD-184

Goal (internal): https://github.com/gravitational/cloud/issues/10289

This PR does two changes:

  • add the ability to configure the kube-agent-udpater to use both RFD-109 APIs and RFD-184 APIs to fetch version and choose when to update. If both are configured, RFD-184 takes precedence if the proxy supports it.
  • have the chart configure the kube-agent-updater RFD-184 APIs by default if the version server was already the proxy. We don't enable the new API if a custom versionServer is set to avoid breaking existing users.

Copy link

🤖 Vercel preview here: https://docs-9hn260mmh-goteleport.vercel.app/docs

@hugoShaka hugoShaka added the no-changelog Indicates that a PR does not require a changelog entry label Dec 20, 2024
@hugoShaka hugoShaka force-pushed the hugo/kube-agent-updater-use-new-api branch from b1fac70 to f31a176 Compare December 20, 2024 15:26
Copy link

🤖 Vercel preview here: https://docs-9wrdwc7ne-goteleport.vercel.app/docs

@marcoandredinis marcoandredinis removed their request for review January 17, 2025 10:58
@@ -106,7 +112,16 @@ func main() {
ctrl.Log.Error(trace.BadParameter("--agent-namespace empty"), "agent-namespace must be provided")
os.Exit(1)
}
if versionServer == "" && proxyAddress == "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

should we also validate that both aren't empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Having both set is a valid configuration (and the default one for most clusters). We will try first via the proxy addr, then fallback to the version server if the proxy responds but does not support the new agent AUs.


// If the version server is specified, we enable RFD-109 updates
// See https://github.com/gravitational/teleport/blob/master/rfd/0109-cloud-agent-upgrades.md#kubernetes-model
if versionServer != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be a if else instead? Having both versionServer and proxyAddress can create problems?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We explicitly want to support both at the same time and do a failover based on which one is implemented. That's because we don't know in Helm if the proxy server supports the new updater API. This way we are doing some opportunistic thing by default:

  • if no custom version server is specified in the chart, we set both proxy && version server
  • if the proxy implements the update protocol, it takes precedence
  • else we fall back to the good ol' version server
  • we don't change anything if we're a custom version server is set in the chart because that would be a breaking change

@hugoShaka hugoShaka force-pushed the hugo/kube-agent-updater-use-new-api branch from 45d342b to d4dcb01 Compare January 17, 2025 20:51
Copy link

github-actions bot commented Jan 17, 2025

Amplify deployment status

Branch Commit Job ID Status Preview Updated (UTC)
hugo/kube-agent-updater-use-new-api HEAD 1 ✅SUCCEED hugo-kube-agent-updater-use-new-api 2025-01-17 20:54:47

@hugoShaka hugoShaka requested a review from tigrato January 17, 2025 21:06
@hugoShaka hugoShaka added this pull request to the merge queue Jan 17, 2025
Merged via the queue into master with commit 1b76f97 Jan 17, 2025
44 checks passed
@hugoShaka hugoShaka deleted the hugo/kube-agent-updater-use-new-api branch January 17, 2025 22:55
mvbrock pushed a commit that referenced this pull request Jan 18, 2025
…fault when possible (#50464)

* kube-agent-update: Use the RFD-184 webapi proxy update protocol by default when possible

* Update integrations/kube-agent-updater/cmd/teleport-kube-agent-updater/main.go

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* log update group

---------

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation helm no-changelog Indicates that a PR does not require a changelog entry size/md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants