1. Automatically Issuing Ingress Certificates
- Install cert-manager
| |
- Create a global issuer
Create the file issuer.yaml
| |
Create the issuer
| |
- Issue a certificate
Create the file cert.yaml
| |
Issue the certificate
| |
2. Common Kubernetes Troubleshooting
2.1 Node Anomalies
Possible causes of failure:
- kubelet process anomaly
- CNI plugin not installed
- docker anomaly
- Insufficient disk space
- Insufficient memory
How to locate the problem:
kubectl describe node, to inspect node eventssystemctl status kubelet, to check the kubelet statusjournalctl -u kubelet -f, to check the system logstop, to check system CPU and memory usagedu -sh、df -h, to check disk usage
2.2 Pod Anomalies
A Pod can sit in one of three abnormal running states for a long time: Pending, Waiting, CrashBackoff
- Pending
kubectl describe pod, to inspect the events.
Possible causes: insufficient available resources, unsatisfied affinity policies, node taints that do not allow scheduling
- Waiting
Possible causes: image pull failure. Try pulling the image manually, and check whether the image name, permissions, and network behave as expected.
- CrashBackoff
Possible causes: the service fails to start, or its dependencies cannot be fully satisfied. Check the kubectl logs output, or enter the Pod or Docker to debug.
2.3 Service Anomalies
- endpoint not added correctly
Possible causes: the Pod is abnormal, or the selector does not match any Pod. Check the service’s selector configuration; run kubectl describe service\endpoints\pod to see whether there are abnormal events.
- service port mapping error
Check the service port mapping and whether it matches the Pod port and the port being accessed.
- network configuration problem
Check whether kube-proxy, iptables, or ipvs is abnormal.
