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
httpd.yml实例
原文地址:https://www.cnblogs.com/luoyan01/p/9733804.html