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

agent: add disable_idle_connections configurable #15986

Merged
merged 10 commits into from
Jun 16, 2022
Merged

Conversation

jasonodonnell
Copy link
Contributor

@jasonodonnell jasonodonnell commented Jun 14, 2022

A commit to go-retryablehttp changed the default behavior of closing every successful request to instead keeping the connection open. This was done to allow users of the package to utilize TCP keep alives. This resulted in a large number of connections being left open for 90 seconds by Vault Agent 1.6.0+.

This PR adds a new configurable, disable_idle_connections, which takes a string list to disable idle connections for various features in Vault Agent (auto-auth, caching and templating).

A small example can be found here:

 "auto_auth" = {
  "method" = {
    "config" = {
      "role" = "app"
    }
    "type" = "kubernetes"
  }

  "sink" = {
    "config" = {
      "path" = "/home/vault/.token"
    }
    "type" = "file"
  }
}

"disable_idle_connections" = ["auto-auth", "templating"]
"exit_after_auth" = false
"pid_file" = "/home/vault/.pid"

"template" = {
  "contents" = "{{ with secret \"secret/hashiconf\" }}{{ .Data | toJSONPretty }}{{ end }}"
  "destination" = "/vault/secrets/kv-secret"
  "error_on_missing_key" = true
}

"vault" = {
  "address" = "https://vault.vault.svc.cluster.local:8200"
}

@jasonodonnell jasonodonnell added this to the 1.11.1 milestone Jun 14, 2022
@jasonodonnell jasonodonnell requested a review from a team June 14, 2022 21:14
command/agent/config/config.go Outdated Show resolved Hide resolved
command/agent/config/config.go Outdated Show resolved Hide resolved
command/agent.go Outdated Show resolved Hide resolved
@jasonodonnell jasonodonnell changed the title agent: add disable_keep_alives configurable agent: add disable_idle_connections configurable Jun 16, 2022
api/client.go Outdated Show resolved Hide resolved
command/agent.go Show resolved Hide resolved
command/agent/config/config.go Outdated Show resolved Hide resolved
Copy link
Contributor

@swenson swenson left a comment

Choose a reason for hiding this comment

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

LGTM

@jasonodonnell jasonodonnell requested a review from calvn June 16, 2022 20:17
@jasonodonnell jasonodonnell merged commit e38f6e7 into main Jun 16, 2022
@jasonodonnell jasonodonnell deleted the keep-alive-config branch June 16, 2022 22:06
jasonodonnell added a commit that referenced this pull request Jun 21, 2022
* agent: add disable_keep_alives configurable

* Add empty test

* Add website doc

* Change to disable_idle_connections

* Update tests and doc

* Add note about env

* Changelog

* Change to slice

* Remove unused disable keep alive methods

* Add invalid value test
jasonodonnell added a commit that referenced this pull request Jun 21, 2022
* agent: add disable_keep_alives configurable

* Add empty test

* Add website doc

* Change to disable_idle_connections

* Update tests and doc

* Add note about env

* Changelog

* Change to slice

* Remove unused disable keep alive methods

* Add invalid value test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants