k8s安装zookeeper(简易版)
k8s安装zookeeperapiVersion: apps/v1kind: Deploymentmetadata:name: zookeepernamespace: liyuanlabels:app: zkname: zkspec:selector:matchLabels:app: zktemplate:metadata:labels:app: zkspec:no
·
k8s安装zookeeper
apiVersion: apps/v1
kind: Deployment
metadata:
name: zookeeper
namespace: liyuan
labels:
app: zk
spec:
selector:
matchLabels:
app: zk
template:
metadata:
labels:
app: zk
spec:
nodeName: liyuan-node2
containers:
- name: zk
image: zookeeper
imagePullPolicy: IfNotPresent
ports:
- containerPort: 2181
name: zk
resources:
requests:
cpu: "0.1"
memory: "500Mi"
limits:
cpu: "0.1"
memory: "500Mi"
---
apiVersion: v1
kind: Service
metadata:
labels:
app: zk
name: zk-svc
namespace: liyuan
spec:
ports:
- port: 2181
nodePort: 30002
targetPort: 2181
selector:
app: zk
type: NodePort
更多推荐
已为社区贡献16条内容
所有评论(0)