| name | cluster-debug |
| description | Felsök Kubernetes-klusterhälsa med `simon cluster health`. Utlösare: "felsök kluster", "kluster health", "kubernetes health", "cluster health check", "kluster-status", "simon cluster health". Inkluderar Flux, Longhorn, Vault, ESO, CNPG, Talos-hälsokontroller och vanliga Kubernetes-fel.
|
Kubernetes Cluster Health Debug Skill
Felsök Kubernetes-kluster med fokus på simon cluster health kommandot.
När Använda Denna Skill
Denna skill triggas vid alla felsökningsförfrågningar relaterade till:
simon cluster health kommandot
- Kubernetes-kluster status och hälsa
- Flux GitOps-synkronisering
- Longhorn storage-problem
- Vault secrets-hantering
- External Secrets Operator (ESO)
- CloudNativePG databaser
- Talos-nodhälsa
- CSR-godkännande
Snabb Felsökning
Kör hela cluster health
simon cluster health
```bash
flux get all -A
kubectl get volumes -n longhorn-system
kubectl get nodes.longhorn.io -n longhorn-system
kubectl exec -n vault <vault-pod> -- vault status
kubectl get clusters.postgresql.cnpg.io -A
kubectl get backups.postgresql.cnpg.io -A
kubectl get externalsecrets -A
kubectl get csr | grep Pending
Vanliga Problem och Åtgärder
| Symptom | Diagnos | Åtgärd |
|---|
simon cluster health hänger | Ping-fel eller Talos timeout | Kontrollera nätverk och noder |
| Flux Kustomization inte Reconciled | flux get kustomizations | Kör flux reconcile eller kolla logs |
| Longhorn volymer degraded/faulted | kubectl get volumes -n longhorn-system | Reparera med simon kubernetes longhorn repair |
| Vault sealed | vault status | Kör vault unseal på drabbade noder |
| ESO ExternalSecret Failed | kubectl get externalsecrets -A | Verifiera ESO-konfiguration och SecretStore |
| CNPG cluster not ready | kubectl get clusters.postgresql.cnpg.io -A | Kolla poddar och logs i cnpg-system |
| Pending CSR | kubectl get csr | grep Pending | Kör simon kubernetes approve csr ör simon kubernetes approve csr |
simon cluster health Komponenter
Kommandot kontrollerar följande i ordning:
1. Verktygskontroll
Kontrollerar att ping, talosctl, kubectl, yq är installerade.
2. Nod-ping
Ping till alla controlplane- och worker-noder via IP från
~/repos/infrastructure/talos/nodes.yaml.
3. Talos health
talosctl health --nodes <controlplane-ip>
4. Kubernetes noder
kubectl get nodes
5. Flux controllers
kubectl get pods -n flux-system
6. Flux Kustomizations
flux get kustomizations -A
7. Flux Sources (OCI, Helm, Git)
flux get sources oci -A
flux get sources helm -A
flux get sources git -A
8. HelmReleases
flux get helmreleases -A
9. Pending CSR
kubectl get csr | grep Pending
10. Kubelet CSR Approver
kubectl get deployment kubelet-csr-approver -n kubelet-csr-approver
kubectl get pods -n kubelet-csr-approver
11. Longhorn
- Volymer (healthy, degraded, faulted, attached, detached)
- Nod-diskstatus (schedulable/unschedulable)
12. Vault
- Poddar i vault namespace
- Unsealed status
- Health endpoint
- Secret-läsning
13. ESO (External Secrets Operator)
- ExternalSecrets status
- ClusterExternalSecret
- ClusterSecretStore
14. CNPG (CloudNativePG)
- PostgreSQL clusters
- Backups
- Poolers
Felsöknings-kommandon
Flux Problem
flux reconcile kustomization <name> -n <namespace>
flux reconcile source git <name> -n <namespace>
flux logs --kind=Kustomization --name=<name>
flux reconcile source <type>/<name> --force
Longhorn Problem
simon kubernetes longhorn repair
simon kubernetes longhorn test
kubectl get volumes -n longhorn-system -o wide
kubectl get nodes.longhorn.io -n longhorn-system -o yaml
Vault Problem
kubectl exec -n vault <pod> -- vault status
kubectl exec -n vault <pod> -- vault operator unseal <unseal-key>
kubectl get secret vault-secrets -n <namespace>
CSR Problem
kubectl get csr
kubectl certificate approve <csr-name>
kubectl get deployment kubelet-csr-approver -n kubelet-csr-approver
ESO Problem
kubectl get externalsecrets -A -o wide
kubectl get clusterexternalsecret -A
kubectl get secretstores -A
kubectl logs -n external-secrets -l app.kubernetes.io/name=external-secrets
Konfigurationsfiler
~/repos/infrastructure/
├── talos/
│ └── nodes.yaml # Nod-IP och roller
├── infrastructure-flux/ # Flux-konfiguration
│ ├── apps/
│ ├── components/
│ └── clusters/
└── manifests/
├── infrastructure/ # Operators
└── applications/ # Applikationer