k8s部署zookeeper
阿新 • • 發佈:2018-12-17
1、zookeeper_rc檔案內容如下:
cat zookeeper-rc.yaml apiVersion: v1 kind: ReplicationController metadata: name: zookeeper-test spec: replicas: 1 selector: app: zookeeper-test template: metadata: labels: app: zookeeper-test spec: containers: - name: zookeeper-test image: 192.168.1.201:5000/zookeeper ports: - containerPort: 2181 ports: - containerPort: 2888
2、zookeeper_svc檔案內容如下
cat zookeeper-svc.yaml
apiVersion: v1
kind: Service
metadata:
name: zookeeper
spec:
type: NodePort
ports:
- port: 2181
nodePort: 30005
selector:
app: zookeeper
</div>