-
Notifications
You must be signed in to change notification settings - Fork 5
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
extend log command to set severity for components running in managed clusters #41
Comments
Hi @gianlucam76, This is somewhat of a grey area for me, however, I was wondering if it's possible to create a Custom Resource Definition (CRD) that allows users to specify the log severity for components in managed clusters? I think you would also need to create some controller & logic controller(s) with it to help handle what gets updated in that CRD. |
Hi @AdamSadek thanks for your comment. what you are saying is correct and sveltos has part of it. For instance there is this CRD where customer can specify:
And then each Sveltos components uses this method to watch for DebuggingConfiguration instance changes and dynamically adjust the log verbosity accordingly. Today, sveltosctl can set DebuggingConfiguration default instance in the management cluster and the Sveltos components running in the management cluster adjust their log verbosity. Sveltos though has also components running in the managed cluster (sveltos-agent and drift-detection-manager). But sveltosctl has no capability to update DebuggingConfiguration in the managed clusters. The goal of this enhancement is to modify sveltosctl so to configure DebuggingConfiguration also in managed cluster. Let me know what you think. Thank you again |
Thank you for providing more context @gianlucam76. This is the approach I'm currently seeing:
This is a very brief idea of what I had in mind - not really sure if it will work, and I hope I haven't missed anything in my examples. |
Thank you @AdamSadek, what you suggested looks great. Few comments. Since sveltos manages two different type of managed clusters:
we need to ask also clusterType (defined here) on top of cluster namespace/name. Regarding point 5, libsveltos has this method that allows to get client to talk to API Server in the managed cluster. Where:
Maybe we could change collectLogLevelConfiguration to accept the DebuggingConfiguration (and do same for updateLogLevelConfiguration). Or something similar. So we can fetch DebuggingConfiguration from either management cluster or managed cluster with the logic you suggested. Today, collectLogLevelConfiguration method assumes it needs to talk to the management cluster only. So with following code it gets DebuggingConfiguration from management cluster.
PS: Really good job finding all those info on your own. I could have added more info on the issue (apologies). |
Thank you and no worries! @gianlucam76 So in-addition to the cluster namespace and name, we would need to also add the clusterType👍 It's also good to see that there's already a method that deals with the API server communication. 👍 What you suggested sounds great. Making tweaks to the collectLogLevelConfiguration & updateLogLevelConfiguration, to accept the DebuggingConfiguration and then deal with whether it's a management or managed cluster with some logic. Would you have a chronological procedure in mind on making these changes? - some sort of Acceptance Criteria (AC)? Also for testing, do you test the changes right after merging into dev ? |
Hi @AdamSadek regarding testing, unit tests can be added as part of the PR. Set command already has some tests. You can add others based on your change. Then sveltosctl has "make lint" and "make test". After you make changes you can run those locally to make sure all is good (those are also part of each PR's CI). If you want to test on a test setup, you can clone this repo. Then run "make quickstart" which will creates:
at this point you can test your sveltosctl changes by setting "sveltos-agent" component log severity in the managed cluster and verify it is set as expected. repo in test/fv/workload_kubeconfig you can find kubeconfig to access the managed cluster so you can run "KUBECONFIG=<addon-controller_location>/ test/fv/workload_kubeconfig kubectl get debuggingconfiguration -o yaml" to verify it is set. Thank you and please do not hesitate if you have any other question. Thank you so much. |
Is your feature request related to a problem? Please describe.
Currently, using sveltosctl, it is possible to change log severity for components running in the management cluster.
There is though no support to change log severity for components running in managed clusters.
Describe the solution you'd like
Extend sveltosctl log-settings command to set log severity for components running in managed cluster. Cluster namespace/name must be requested to user.
Describe alternatives you've considered
Alternative today is to use kubectl and post DebuggingConfiguration default instance in managed clusters.
The text was updated successfully, but these errors were encountered: