k8s nginx .yaml 测试
k8s 简单测试yaml
·
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-test
spec:
replicas: 2
selector:
matchLabels:
app: nginx-test
template:
metadata:
labels:
app: nginx-test
spec:
containers:
- name: nginx-test
image: nginx:1.19
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: nginx-test
spec:
type: NodePort
ports:
- port: 8080
targetPort: 80
nodePort: 38888
selector:
app: nginx-test
更多推荐
已为社区贡献21条内容
所有评论(0)