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: added functionality for emitting results into the k8sgpt-operat… #589

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AlexsJones
Copy link
Member

Enabling --enable-result-logging will spit out into the k8sgpt-operator commandline the following style objects:

2024-12-20T16:05:08Z	INFO	k8sgpt-controller.analysis	{"Name":"argocd/argocd-application-controller","Error":"Error [{StatefulSet uses the service argocd/argocd-application-controller which does not exist. [{argocd KiNSLmNp} {argocd-application-controller NT5eaidvYTFtWmo4RVJUWS8oeStRcXwpYi1TUjA=}]}]","Details":"Error: The StatefulSet is trying to use a service named \"argocd-application-controller\" that hasn't been created or is missing.\n\nSolution: \n1. Check if the service exists: `kubectl get svc argocd-application-controller`\n2. If it doesn't exist, create it using a YAML file or `kubectl expose`.\n3. Verify the service is running: `kubectl get svc`.\n4. Restart the StatefulSet if needed: `kubectl rollout restart statefulset \u003cyour-statefulset-name\u003e`."}
2024-12-20T16:05:10Z	INFO	k8sgpt-controller.analysis	{"Name":"k8sgpt-operator-system/release-interplex","Error":"Error [{StatefulSet uses the service k8sgpt-operator-system/interplex-service which does not exist. [{k8sgpt-operator-system UG4kJkNXWVY/bkwvfCJeaF0xZEVoZA==} {interplex-service b2N1VnFdd3oubmV3Jikjb3s=}]}]","Details":"Error: The StatefulSet is trying to use a service that does not exist, which prevents it from functioning properly.\n\nSolution: \n1. Check the StatefulSet configuration for the service name.\n2. Verify if the service exists using `kubectl get services`.\n3. If it doesn't exist, create the service with the correct specifications.\n4. If it exists, ensure the name matches exactly in the StatefulSet."}
2024-12-20T16:05:12Z	INFO	k8sgpt-controller.analysis	{"Name":"observability/tempo","Error":"Error [{StatefulSet uses the service observability/tempo-headless which does not exist. [{observability Qk94VVtockU1RVNoLw==} {tempo-headless TkU7IUYzKjJkKz8yeTo=}]}]","Details":"Error: The StatefulSet is trying to use a service that does not exist, causing a deployment issue.\n\nSolution: \n1. Check the StatefulSet configuration for the service name.\n2. Verify if the service exists using `kubectl get svc`.\n3. If missing, create the service with the correct name.\n4. Redeploy the StatefulSet using `kubectl apply -f \u003cstatefulset-file.yaml\u003e`."}
2024-12-20T16:05:14Z	INFO	k8sgpt-controller.analysis	{"Name":"k8sgpt-operator-system/release-k8sgpt-opera-controller-manager-metrics-service","Error":"Error [{Service has no endpoints, expected label app.kubernetes.io/instance=release [{app.kubernetes.io/instance dW9kTkZCSkk4Sj4/PU04WExaQ1tMRi08L0U=} {release TWNjdURPdg==}]} {Service has no endpoints, expected label app.kubernetes.io/name=k8sgpt-operator [{app.kubernetes.io/name PiVnbDRXcUF0enJwfSI1cV46MHRHew==} {k8sgpt-operator KDxlTT11QzA1PnNRdEA1}]} {Service has no endpoints, expected label control-plane=controller-manager [{control-plane Imd3QVhXV2okMF0lbQ==} {controller-manager KW14L2pLMF5DZCc4Z2hXJENf}]}]","Details":"Error: The error indicates that the Kubernetes service cannot find any endpoints, meaning there are no pods matching the expected labels to route traffic to.\n\nSolution: \n1. Check if the pods are running: `kubectl get pods`\n2. Verify the service configuration: `kubectl describe service \u003cservice-name\u003e`\n3. Ensure the pods have the correct labels: `kubectl get pods --show-labels`\n4. If labels are incorrect, update them or recreate the pods."}
2024-12-20T16:05:14Z	INFO	k8sgpt-controller	ending AnalysisStep

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

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.

1 participant