Skip to content

Latest commit

 

History

History
43 lines (32 loc) · 941 Bytes

2.pod.md

File metadata and controls

43 lines (32 loc) · 941 Bytes

Pod

pea-pods

pod 就像一个豌豆荚,里面的豌豆就是 container。

最小原子单位。

kubectl run nginx-pod --image=nginx --dry-run=client -output=yaml > nginx-pod.yaml # --dry-run=server
kubectl apply -f nginx-pod.yaml
kubectl get pods
apiVersion: v1               # 对象 api 版本
kind: Pod                    # 对象类型
metadata:                    # 元数据
  labels:                    # 标签 
    run: nginx-pod           # key: value
  name: nginx-pod
spec:
  containers:
    - image: nginx
      name: nginx-pod
      resources: {}
  dnsPolicy: ClusterFirst
  restartPolicy: Always

推荐使用的标签

Assigning Pods to Nodes

污点和容忍度

Taint And Toleration

kubectl get nodes -o custom-columns=NAME:.metadata.name,TAINTS:.spec.taints