5-1 创建Nginx Pod
apiVersion: v1
kind: Pod
metadata:
name: my-nginx
spec:
containers:
- image: nginx
name: my-nginx
kubectl apply -f nginx.yaml
kubectl get po
kubectl describ pod my-nginx
[root@master ~]# kubectl get pods my-nginx
NAME READY STATUS RESTARTS AGE
my-nginx 1/1 Running 0 24s
[root@master ~]# kubectl describe pod my-nginx
Name: my-nginx
Namespace: default
Priority: 0
Node: node1/192.168.137.11
Start Time: Wed, 10 Mar 2021 21:56:16 -0500
Labels: <none>
Annotations: <none>
Status: Running
IP: 10.244.1.3
IPs:
IP: 10.244.1.3
Containers:
my-nginx:
Container ID: docker://e4222b6828431243bb2cb5cff661df39b6ccc1ba6655aec676fa3f96c365a6cd
Image: