首页 > 技术文章 > httpd.yml实例

luoyan01 2018-09-30 23:51 原文

httpd.yml
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: httpd
spec:
replicas: 4
template:
metadata:
labels:
run: httpd
spec:
containers:
- name: httpd
image: httpd
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: httpd-svc
spec:
type: NodePort #nodeIP
selector:
run: httpd
ports:
- protocol: TCP
nodePort: 30000 #指定端口 访问端口
port: 8080 #ClusterIP
targetPort: 80 #PodIP

 

推荐阅读