kubernetes/Yaml文件/nginx-deploy.yaml

49 lines
662 B
YAML

apiVersion: v1
kind: Namespace
metadata:
name: xaddt
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-xingdian
labels:
xingdian: nginx
namespace: xaddt
spec:
replicas: 2
selector:
matchLabels:
xingdian: nginx
template:
metadata:
labels:
xingdian: nginx
spec:
containers:
- name: nginx-xingdian
image: 10.36.174.164/xingdian/nginx:v1
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: my-xaddt
namespace: xaddt
spec:
selector:
xingdian: nginx
type: NodePort
ports:
- port: 80
targetPort: 80
nodePort: 30011