欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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