运行测试 pod
配置文件
$ cat nginx.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
启动 pod
通过kubectl命令运行nginx。
$ kubectl apply -f nginx.yaml
deployment.apps/nginx-deployment created
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
nginx-deployment-66b6c48dd5-6rnwz 1/1 Running 0 33s
nginx-deployment-66b6c48dd5-9pq49 1/1 Running 0 33s
nginx-deployment-66b6c48dd5-lvmng 1/1 Running 0 34s
当前内容版权归 华为openEuler 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 华为openEuler .