CKA 备考笔记
程序员文章站
2024-03-14 13:28:40
...
don’t forget change context
kubectl config use-context <name>
count nodes
kubectl get nodes
kubectl describe nodes|grep -i taint
kubectl describe nodes|grep -i taint|grep none|wc -l
retrieve Error Messages
kubectl logs -n <namespace> <pod> -c <container> | grep -i err
find the pod (most CPU)
kubectl top pod -n web --sort-by cpu -l app=auth
expose container port
...
spec:
containers:
- image: nginx
ports:
- containerPort: 80
svc expose to external
apiVersion: v1
kind: Service
metadata:
name: <svcname>
namespace: <ns>
spe