Remote Cluster Configuration for Trivy-Dojo-Report-Operator#84
Open
tidusete wants to merge 2 commits intotelekom-mms:mainfrom
Open
Remote Cluster Configuration for Trivy-Dojo-Report-Operator#84tidusete wants to merge 2 commits intotelekom-mms:mainfrom
tidusete wants to merge 2 commits intotelekom-mms:mainfrom
Conversation
Contributor
Author
60f1538 to
07ee332
Compare
Collaborator
|
Hi @tidusete, thank you for your contribution and your thorough description. As this is a bigger change, also on the general design of this operator, we need to put some more thought into that. Currently what we were doing, was the following:
We need to think about where we wanna head with this solution. In the end, we also could support multiple ways/methods on doing that. @rndmh3ro maybe you can add your 2 cents here as well (design wise) |
efea7e9 to
27d1ff8
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This MR introduces the following changes to the
trivy-dojo-report-operatorapplication:handlers.pyfile to handle the kubeconfig scenario.Changes
charts/templates/deployment.yaml:KUBECONFIGwith the value of the path of the mounted kubeconfig file.createRBACflag to set the service account name.charts/templates/rbac.yaml:createRBACflag to create the service account, cluster role, and cluster role binding.charts/templates/secret.yaml:charts/values.yaml:remoteClusterKubeconfigto store the base64-encoded remote cluster kubeconfig.createRBACto control the creation of RBAC resources.deploy/trivy-dojo-report-operator.yaml:src/handlers.py:login_fnfunction to handle the kubeconfig scenario.src/settings.py:KUBECONFIGto store the path to the kubeconfig file.Rationale
The primary goal of these changes is to provide the flexibility to fetch vulnerabilities from a remote Kubernetes cluster, in addition to the default behavior of fetching them from the same cluster where the operator is running.
If the
remoteClusterKubeconfigvalue is provided, the operator will use the kubeconfig file to authenticate and interact with the remote cluster. In this case, there is no need to create RBAC resources, as the remote cluster's RBAC configuration will be used.If the
remoteClusterKubeconfigvalue is not provided, the operator will continue to use the default behavior of fetching vulnerabilities from the same cluster where it is running, and the RBAC resources will be created as before.The changes to the
handlers.pyfile ensure that the login process handles both the kubeconfig scenario and the default scenario, maintaining backward compatibility.