k8s deployment 指定节点
apiVersion: apps/v1kind: Deploymentmetadata:name: myappnamespace: testspec:replicas: 1selector:matchLabels:app: myapptemplate:metadata:labels:app: myappspec:containers:- name: myapp
·
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp
namespace: test
spec:
replicas: 1
selector:
matchLabels:
app: myapp
template:
metadata:
labels:
app: myapp
spec:
containers:
- name: myapp
image: rrr.**.com/eee/myapp:21
ports:
- containerPort: 13090
name: https
- containerPort: 5005
name: http
nodeName: worker4
---
apiVersion: v1
kind: Service
metadata:
name: myapp
namespace: test
spec:
type: NodePort
ports:
- port: 13090
targetPort: 13090
nodePort: 31189
name: https
- port: 5005
targetPort: 5005
nodePort: 31188
name: http
selector:
app: myapp
更多推荐
已为社区贡献4条内容
所有评论(0)