1. 程式人生 > >k8s部署zookeeper

k8s部署zookeeper

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>