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
daemon: store Cilium's configuration in a file #16017
Conversation
test-me-please |
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.
Good idea
pkg/option/config.go
Outdated
"viper-config.yaml", | ||
"viper-config-1.yaml", | ||
"viper-config-2.yaml", |
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.
Since this is probably what Cilium was configured with, maybe we can have a name that's clearer than this to indicate that?
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.
Also, should viper-config*.yaml rather be stored by date, so that we can diff on a timeline when agent was restarted with different configs?
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.
It's easier to leave without timestamps in the file names, however, the content of agent-config.json
contains an entry with the creation time.
Please also add support for bugtool, so it will pick up all the config files from there. |
1d5637f
to
75df30d
Compare
test-me-please |
75df30d
to
8bfccb1
Compare
test-me-please |
@borkmann it should be picked by the bug tool automatically since it's going to be stored inside the |
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 not sure I'm a fan of calling it Viper
. That doesn't really mean much. What about "desired config" or "explicit config" or "initial config"? This would require renaming the "agent-config" to "agent-runtime-config" to make more sense. WDYT?
@christarazi I think it should be prefixed with viper since in the end this is a file created by viper itself. I like the |
Previously, we have been relying on the Cilium ConfigMap to detect the presence of features. Relying on the ConfigMap has however some downsides, as one has to know the default value of a certain feature if the option is absent from the ConfigMap. To make things worse, this default value is also version dependent in some cases. This PR therefore instead tries to extract the feature status from the agent-runtine-config.json, which is a JSON representation of the `option.Config` struct used in Cilium Agent. It contains the actual values determined at run-time, which is more robust than the ConfigMap equivalent. The agent-runtime-config.json is present since Cilium v1.10 and has been backported to v1.8.10 and v1.9.7. See the PR for more details: cilium/cilium#16017 A downside of this approach is that the `DaemonConfig` struct is not guaranteed to be stable. If there are changes to it in the future, we will likely have to maintain version-specific copies of the struct in the Cilium-CLI. Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
Previously, we have been relying on the Cilium ConfigMap to detect the presence of features. Relying on the ConfigMap has however some downsides, as one has to know the default value of a certain feature if the option is absent from the ConfigMap. To make things worse, this default value is also version dependent in some cases. This PR therefore instead tries to extract the feature status from the agent-runtine-config.json, which is a JSON representation of the `option.Config` struct used in Cilium Agent. It contains the actual values determined at run-time, which is more robust than the ConfigMap equivalent. The agent-runtime-config.json is present since Cilium v1.10 and has been backported to v1.8.10 and v1.9.7. See the PR for more details: cilium/cilium#16017 A downside of this approach is that the `DaemonConfig` struct is not guaranteed to be stable. If there are changes to it in the future, we will likely have to maintain version-specific copies of the struct in the Cilium-CLI. Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
Previously, we have been relying on the Cilium ConfigMap to detect the presence of features. Relying on the ConfigMap has however some downsides, as one has to know the default value of a certain feature if the option is absent from the ConfigMap. To make things worse, this default value is also version dependent in some cases. This PR therefore instead tries to extract the feature status from the agent-runtime-config.json, which is a JSON representation of the `option.Config` struct used in Cilium Agent. It contains the actual values determined at run-time, which is more robust than the ConfigMap equivalent. The agent-runtime-config.json is present since Cilium v1.10 and has been backported to v1.8.10 and v1.9.7. See the PR for more details: cilium/cilium#16017 A downside of this approach is that the `DaemonConfig` struct is not guaranteed to be stable. If there are changes to it in the future, we will likely have to maintain version-specific copies of the struct in the Cilium-CLI. Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
Previously, we have been relying on the Cilium ConfigMap to detect the presence of features. Relying on the ConfigMap has however some downsides, as one has to know the default value of a certain feature if the option is absent from the ConfigMap. To make things worse, this default value is also version dependent in some cases. This PR therefore instead tries to extract the feature status from the agent-runtime-config.json, which is a JSON representation of the `option.Config` struct used in Cilium Agent. It contains the actual values determined at run-time, which is more robust than the ConfigMap equivalent. The agent-runtime-config.json is present since Cilium v1.10 and has been backported to v1.8.10 and v1.9.7. See the PR for more details: cilium/cilium#16017 A downside of this approach is that the `DaemonConfig` struct is not guaranteed to be stable. If there are changes to it in the future, we will likely have to maintain version-specific copies of the struct in the Cilium-CLI. Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
Previously, we have been relying on the Cilium ConfigMap to detect the presence of features. Relying on the ConfigMap has however some downsides, as one has to know the default value of a certain feature if the option is absent from the ConfigMap. To make things worse, this default value is also version dependent in some cases. This PR therefore instead tries to extract the feature status from the agent-runtime-config.json, which is a JSON representation of the `option.Config` struct used in Cilium Agent. It contains the actual values determined at run-time, which is more robust than the ConfigMap equivalent. The agent-runtime-config.json is present since Cilium v1.10 and has been backported to v1.8.10 and v1.9.7. See the PR for more details: cilium/cilium#16017 A downside of this approach is that the `DaemonConfig` struct is not guaranteed to be stable. If there are changes to it in the future, we will likely have to maintain version-specific copies of the struct in the Cilium-CLI. Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
Previously, we have been relying on the Cilium ConfigMap to detect the presence of features. Relying on the ConfigMap has however some downsides, as one has to know the default value of a certain feature if the option is absent from the ConfigMap. To make things worse, this default value is also version dependent in some cases. This PR therefore instead tries to extract the feature status from the agent-runtime-config.json, which is a JSON representation of the `option.Config` struct used in Cilium Agent. It contains the actual values determined at run-time, which is more robust than the ConfigMap equivalent. The agent-runtime-config.json is present since Cilium v1.10 and has been backported to v1.8.10 and v1.9.7. See the PR for more details: cilium#16017 A downside of this approach is that the `DaemonConfig` struct is not guaranteed to be stable. If there are changes to it in the future, we will likely have to maintain version-specific copies of the struct in the Cilium-CLI. Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
To make it easier debug or share configurations across users and
developers, Cilium will store its viper.Config as well as agent's
configuration in files under
/var/run/cilium
. It will store up tothe last 3 previous configurations.
Another use case for it will be to check the previous configuration run
by Cilium in case certain steps need to be executed, for example, to
clean up state left from a previous run that will not be cleaned up by a
new set of flags.
Signed-off-by: André Martins andre@cilium.io