-
Notifications
You must be signed in to change notification settings - Fork 525
Plugin reconfiguration support #5166
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9075d0d
Plugin reconfiguration support
azdagron cba8c8c
fix lint on windows
azdagron 912525d
address comments
azdagron d4c2041
lint markdown
azdagron 3528286
address marcos comments
azdagron c684546
clarify examples
azdagron a562588
Merge branch 'main' into plugin-reconfigurable
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,14 +136,75 @@ plugins { | |
|
||
The following configuration options are available to configure a plugin: | ||
|
||
| Configuration | Description | | ||
|-----------------|-------------------------------------------------------------------------------| | ||
| plugin_cmd | Path to the plugin implementation binary (optional, not needed for built-ins) | | ||
| plugin_checksum | An optional sha256 of the plugin binary (optional, not needed for built-ins) | | ||
| enabled | Enable or disable the plugin (enabled by default) | | ||
| plugin_data | Plugin-specific data | | ||
|
||
Please see the [built-in plugins](#built-in-plugins) section for information on plugins that are available out-of-the-box. | ||
| Configuration | Description | | ||
|------------------|----------------------------------------------------------------------------------------| | ||
| plugin_cmd | Path to the plugin implementation binary (optional, not needed for built-ins) | | ||
| plugin_checksum | An optional sha256 of the plugin binary (optional, not needed for built-ins) | | ||
| enabled | Enable or disable the plugin (enabled by default) | | ||
| plugin_data | Plugin-specific data (mutually exclusive with `plugin_data_file`) | | ||
| plugin_data_file | Path to a file containing plugin-specific data (mutually exclusive with `plugin_data`) | | ||
|
||
Please see the [built-in plugins](#built-in-plugins) section below for information on plugins that are available out-of-the-box. | ||
|
||
### Examples | ||
|
||
#### Built-in Plugin with Static Configuration | ||
|
||
```hcl | ||
plugins { | ||
SomeType "some_plugin" { | ||
plugin_data = { | ||
option1 = "foo" | ||
option2 = 3 | ||
} | ||
} | ||
} | ||
``` | ||
|
||
#### Built-in Plugin with Dynamic Configuration | ||
|
||
In the `agent.conf`, declare the plugin using the `plugin_data_file` option to | ||
source the plugin configuration from file. | ||
|
||
```hcl | ||
plugins { | ||
SomeType "some_plugin" { | ||
plugin_data_file = "some_plugin.conf" | ||
} | ||
} | ||
``` | ||
|
||
And then in `some_plugin.conf` you place the plugin configuration: | ||
|
||
```hcl | ||
option1 = "foo" | ||
option2 = 3 | ||
``` | ||
|
||
#### External Plugin with Static Configuration | ||
|
||
```hcl | ||
plugins { | ||
SomeType "some_plugin" { | ||
plugin_cmd = "./path/to/plugin" | ||
plugin_checksum = "4e1243bd22c66e76c2ba9eddc1f91394e57f9f83" | ||
plugin_data = { | ||
option1 = "foo" | ||
option2 = 3 | ||
} | ||
} | ||
} | ||
``` | ||
|
||
### Reconfiguring plugins (Posix only) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe it's just me, but it's not super clear if the plugin configuration should include |
||
|
||
Plugins that use dynamic configuration sources (i.e. `plugin_data_file`) can be reconfigured at runtime by sending a `SIGUSR1` signal to SPIRE Agent. | ||
kfox1111 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
SPIRE Agent, upon receipt of the signal, does the following: | ||
|
||
1. Reloads the plugin data | ||
2. Compares the plugin data to the previous data | ||
3. If changed, the plugin is reconfigured with the new data | ||
|
||
## Telemetry configuration | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we have a config for external plugins with
plugin_data
, it is possible that some users may not realize thatplugin_data_file
can also be used in external plugins. To improve clarity, we should add a minimal description indicating that this feature can be utilized in external plugins as well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to add another example if that would help, but the section above mentions that all of the plugin options apply for all plugins. What I want to avoid is having an example with every different combination?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another example may be an overkill a comment maybe is good enough