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

[Question]: should not use the history event for the pdb checking #476

Closed
3 of 4 tasks
jianzhangbjz opened this issue Jun 2, 2023 · 0 comments · Fixed by #477 or #475
Closed
3 of 4 tasks

[Question]: should not use the history event for the pdb checking #476

jianzhangbjz opened this issue Jun 2, 2023 · 0 comments · Fixed by #477 or #475

Comments

@jianzhangbjz
Copy link
Contributor

Checklist

  • I've searched for similar issues and couldn't find anything matching
  • I've included steps to reproduce the behavior

Affected Components

  • K8sGPT (CLI)
  • K8sGPT Operator

K8sGPT Version

k8sgpt: 0.3.6 (9c0efe6), built at: unknown

Kubernetes Version

No response

Host OS and its Version

Mac OS 12.6.6

Steps to reproduce

  1. Run $ k8sgpt analyze

Expected behaviour

No error report for the PDB(PodDisruptionBudget).

Actual behaviour

MacBook-Pro:~ jianzhang$ k8sgpt analyze -n openshift-operator-lifecycle-manager
AI Provider: openai

0 openshift-operator-lifecycle-manager/packageserver-pdb(packageserver-pdb)
- Error: No matching pods found, expected label app=packageserver 

MacBook-Pro:~ jianzhang$ k8sgpt analyze 
AI Provider: openai

0 openshift-kube-apiserver/kube-apiserver-guard-pdb(kube-apiserver-guard-pdb)
- Error: No matching pods found, expected label app=guard

1 openshift-monitoring/prometheus-operator-admission-webhook(prometheus-operator-admission-webhook)
- Error: No matching pods found, expected label app.kubernetes.io/name=prometheus-operator-admission-webhook
- Error: No matching pods found, expected label app.kubernetes.io/part-of=openshift-monitoring

2 openshift-oauth-apiserver/oauth-apiserver-pdb(oauth-apiserver-pdb)
- Error: No matching pods found, expected label apiserver=true
- Error: No matching pods found, expected label app=openshift-oauth-apiserver

3 openshift-apiserver/openshift-apiserver-pdb(openshift-apiserver-pdb)
- Error: No matching pods found, expected label apiserver=true
- Error: No matching pods found, expected label app=openshift-apiserver-a

4 openshift-cloud-credential-operator/pod-identity-webhook(pod-identity-webhook)
- Error: No matching pods found, expected label app=pod-identity-webhook

5 openshift-cluster-csi-drivers/aws-ebs-csi-driver-controller-pdb(aws-ebs-csi-driver-controller-pdb)
- Error: No matching pods found, expected label app=aws-ebs-csi-driver-controller

6 openshift-etcd/etcd-guard-pdb(etcd-guard-pdb)
- Error: No matching pods found, expected label app=guard

7 openshift-kube-controller-manager/kube-controller-manager-guard-pdb(kube-controller-manager-guard-pdb)
- Error: No matching pods found, expected label app=guard

8 openshift-kube-scheduler/openshift-kube-scheduler-guard-pdb(openshift-kube-scheduler-guard-pdb)
- Error: No matching pods found, expected label app=guard

9 openshift-operator-lifecycle-manager/packageserver-pdb(packageserver-pdb)
- Error: No matching pods found, expected label app=packageserver

Additional Information

The PDB works as expected, and it already found the matched pods, but the history event is preserved. We shouldn't use the event to judge if the pdb works well.

MacBook-Pro:~ jianzhang$ oc get pods --show-labels|grep packageserver
packageserver-69cc8b8cdd-jshp4            1/1     Running     0          106m    app=packageserver,pod-template-hash=69cc8b8cdd
packageserver-69cc8b8cdd-nszzz            1/1     Running     0          106m    app=packageserver,pod-template-hash=69cc8b8cdd

MacBook-Pro:~ jianzhang$ oc describe pdb packageserver-pdb
Name:             packageserver-pdb
Namespace:        openshift-operator-lifecycle-manager
Max unavailable:  1
Selector:         app=packageserver
Status:
    Allowed disruptions:  1
    Current:              2
    Desired:              1
    Total:                2
Events:
  Type    Reason  Age                  From               Message
  ----    ------  ----                 ----               -------
  Normal  NoPods  139m (x2 over 139m)  controllermanager  No matching pods found

MacBook-Pro:~ jianzhang$ oc get event|grep packageserver-pdb
115m        Normal    NoPods                poddisruptionbudget/packageserver-pdb          No matching pods found
jianzhangbjz added a commit to jianzhangbjz/k8sgpt that referenced this issue Jun 6, 2023
The PDB event is a historical record, it's not a good choice to judge the pdb latest status based on it.
So, use the `stataus` instead of `event` to check it.

Closes: k8sgpt-ai#476

Signed-off-by: Jian Zhang <jiazha@redhat.com>
jianzhangbjz added a commit to jianzhangbjz/k8sgpt that referenced this issue Jun 6, 2023
The PDB event is a historical record, it's not a good choice to judge the pdb latest status based on it.
So, use the `stataus` instead of `event` to check it.

Closes: k8sgpt-ai#476

Signed-off-by: Jian Zhang <jiazha@redhat.com>
AlexsJones pushed a commit that referenced this issue Jun 7, 2023
The PDB event is a historical record, it's not a good choice to judge the pdb latest status based on it.
So, use the `stataus` instead of `event` to check it.

Closes: #476

Signed-off-by: Jian Zhang <jiazha@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
1 participant