在k8s集群中是不能直接运行容器的,k8s集群中最小调度单元为pod,因为我们要使用pod来运行应用程序。
Pod介绍
Pod是k8s集群能够调度的最小单元
Pod是容器的封装
查看pod
kubectl get pod/pods
apiVersion: v1
kind: Pod
metedata:
name: pod1
spec:
containers:
- name: nginx-container
image: nginx:latest
imagePullPolicy: IfNotPresent
ports:
- name: nginxport
containerPort: 80
kubectl apply -f 02-create-pod.yml
kubectl get pods -o wide
删除pod
直接删除与资源清单删除