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

[Feature]: Monitoring multiple clusters #265

Closed
2 tasks done
prometherion opened this issue Nov 16, 2023 · 2 comments · Fixed by #266
Closed
2 tasks done

[Feature]: Monitoring multiple clusters #265

prometherion opened this issue Nov 16, 2023 · 2 comments · Fixed by #266
Assignees

Comments

@prometherion
Copy link
Contributor

Checklist

  • I've searched for similar issues and couldn't find anything matching
  • I've discussed this feature request in the K8sGPT Slack and got positive feedback

Is this feature request related to a problem?

No

Problem Description

At the current state, k8sgpt-operator is just tracking the cluster which is connected to.

I'd like to track remote clusters and store the resulting Result objects in the management one.

Solution Description

The k8sgpt resource could expose a new API field, named kubeconfig, pointing to a Secret object containing the kubeconfig that must be used to connect to the remote cluster.

apiVersion: core.k8sgpt.ai/v1alpha1
kind: K8sGPT
metadata:
  annotations:
  creationTimestamp: "2023-11-15T15:10:01Z"
  finalizers:
  - k8sgpt.ai/finalizer
  generation: 4
  name: k8sgpt-sample
  namespace: k8sgpt-operator-system
  resourceVersion: "304230"
  uid: 3b17ee59-aec0-4030-9944-f1512eec2f9f
spec:
  ai:
    anonymized: true
    backend: openai
    enabled: true
    language: english
    model: gpt-3.5-turbo
    secret:
      key: openai-api-key
      name: k8sgpt-sample-secret
  kubeconfig:
    key: value
    name: capi-cluster-kubeconfig
  version: v0.3.17

The field spec.kubeconfig wouldn't be marked as mandatory, and when not specified, the k8sgpt deployment would use the ServiceAccount mounted to interact with the cluster where it's running.

When specified, the kubeconfig object will be mounted into the k8sgpt deployment object and consumed thanks to the --kubeconfig CLI argument (ref).

Benefits

With the rise of Cluster API is pretty common to have dozens of clusters. Rather than reconciling multiple times the k8sgpt operator instance across all the clusters, besides the security implications in sharing a sensitive data such as the API keys, this feature would allow to track misconfiguration of deployed clusters.

Potential Drawbacks

No response

Additional Information

No response

@prometherion
Copy link
Contributor Author

I already have a PoC for this feature proposal and I'd like to get assigned.

@prometherion prometherion changed the title [Feature]: <Feature Request Title> [Feature]: Monitoring multiple clusters Nov 16, 2023
@arbreezy
Copy link
Member

thanks @prometherion , I will have a look at your PR prior your showcase at our next office hours

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 a pull request may close this issue.

2 participants