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

feat: initial integration support #225

Merged
merged 10 commits into from
Oct 15, 2023
Merged

feat: initial integration support #225

merged 10 commits into from
Oct 15, 2023

Conversation

AlexsJones
Copy link
Member

Closes #

πŸ“‘ Description

βœ… Checks

  • [x ] My pull request adheres to the code style of this project
  • [x ] My code requires changes to the documentation
  • [x ] I have updated the documentation as required
  • [x ] All the tests have passed

β„Ή Additional Information

Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
@AlexsJones AlexsJones requested review from a team as code owners September 20, 2023 08:14
@AlexsJones AlexsJones marked this pull request as draft September 20, 2023 08:15
@jkleinlercher
Copy link
Contributor

I tried this version locally and here are my issues:

ClusterRole k8sgpt for serviceaccount k8sgpt

ClusterRole Definition in

clusterRole := r1.ClusterRole{
needs to have more privileges, otherwise the controller gets the following errors when installing trivy:

2023-09-20T14:46:31Z ERROR Reconciler error {"controller": "k8sgpt", "controllerGroup": "core.k8sgpt.ai", "controllerKind": "K8sGPT", "K8sGPT": {"name":"k8sgpt-sample","namespace":"sx-k8sgpt"}, "namespace": "sx-k8sgpt", "name": "k8sgpt-sample", "reconcileID": "874ca62a-83dc-4ff5-ac09-92c8cdfdab02", "error": "failed to call AddConfig RPC: rpc error: code = Unknown desc = failed to install CRD crds/aquasecurity.github.io_clustercompliancereports.yaml: 1 error occurred:\n\t* customresourcedefinitions.apiextensions.k8s.io is forbidden: User \"system:serviceaccount:sx-k8sgpt:k8sgpt\" cannot create resource \"customresourcedefinitions\" in API group \"apiextensions.k8s.io\" at the cluster scope\n\n"}

K8sGPT CRD

K8sGPT CRD https://github.com/k8sgpt-ai/k8sgpt-operator/blob/main/chart/operator/templates/k8sgpt-crd.yaml needs to get updated with the latest changes in f75cbaf#diff-515c96a78fd03639770938bc9d86c9d31cfde1233911fc4d28be1609e6bc90cc

@AlexsJones
Copy link
Member Author

I tried this version locally and here are my issues:

ClusterRole k8sgpt for serviceaccount k8sgpt

ClusterRole Definition in

clusterRole := r1.ClusterRole{

needs to have more privileges, otherwise the controller gets the following errors when installing trivy:
2023-09-20T14:46:31Z ERROR Reconciler error {"controller": "k8sgpt", "controllerGroup": "core.k8sgpt.ai", "controllerKind": "K8sGPT", "K8sGPT": {"name":"k8sgpt-sample","namespace":"sx-k8sgpt"}, "namespace": "sx-k8sgpt", "name": "k8sgpt-sample", "reconcileID": "874ca62a-83dc-4ff5-ac09-92c8cdfdab02", "error": "failed to call AddConfig RPC: rpc error: code = Unknown desc = failed to install CRD crds/aquasecurity.github.io_clustercompliancereports.yaml: 1 error occurred:\n\t* customresourcedefinitions.apiextensions.k8s.io is forbidden: User \"system:serviceaccount:sx-k8sgpt:k8sgpt\" cannot create resource \"customresourcedefinitions\" in API group \"apiextensions.k8s.io\" at the cluster scope\n\n"}

K8sGPT CRD

K8sGPT CRD https://github.com/k8sgpt-ai/k8sgpt-operator/blob/main/chart/operator/templates/k8sgpt-crd.yaml needs to get updated with the latest changes in f75cbaf#diff-515c96a78fd03639770938bc9d86c9d31cfde1233911fc4d28be1609e6bc90cc

It's not ready just yet, thanks for trying though!

@jkleinlercher
Copy link
Contributor

Two additional things. When this branch is used with the K8sGPT CR attribut

    extraOptions:
      backstage:
        enabled: true

the issue #240 will happened, so k8sgpt-ai/k8sgpt#678 would be a prereq for this PR.

And when used with

    integrations:
      trivy:
        skipInstall: true

the trivy integration will still be deactivated (k8sgpt-ai/k8sgpt#670) so k8sgpt-ai/k8sgpt#675 will also be a prereq in this case.

@AlexsJones
Copy link
Member Author

Two additional things. When this branch is used with the K8sGPT CR attribut

    extraOptions:
      backstage:
        enabled: true

the issue k8sgpt-ai/k8sgpt-operator#240 will happened, so k8sgpt-ai/k8sgpt#678 would be a prereq for this PR.

And when used with

    integrations:
      trivy:
        skipInstall: true

the trivy integration will still be deactivated (k8sgpt-ai/k8sgpt#670) so k8sgpt-ai/k8sgpt#675 will also be a prereq in this case.

Good feedback thanks, I anticipate this will only work on the next k8sgpt release also as there are schema changes

Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
@AlexsJones AlexsJones marked this pull request as ready for review September 28, 2023 10:43
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
@AlexsJones
Copy link
Member Author

Solves #179

Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
Copy link
Member

@arbreezy arbreezy left a comment

Choose a reason for hiding this comment

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

@AlexsJones apart from the consideration of how privileged the cluster role is and the unresolved conflicts, it looks good to me

Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
@AlexsJones AlexsJones merged commit 246077e into main Oct 15, 2023
6 checks passed
@AlexsJones AlexsJones deleted the feat/integration-support branch October 15, 2023 19:30
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.

None yet

3 participants