k8s-service模板

service模板

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
apiVersion: v1
kind: Service
metadata:
annotations:
name: my-nginx
namespace: mynginx
labels:
run: my-nginx
spec:
clusterIP: 10.254.163.198
type: {NodePort|NodePort|LoadBalancer|ExternalName}
ports:
- name: http
NodePort:30001
port: 8080
protocol: TCP
targetPort: 80
selector:
run: my-nginx