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>
Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐