2022-02-25:k8s安装zookeeper,yaml如何写?找份北京的golang后端工作,35岁,有人收我吗?

2022-02-25:k8s安装zookeeper,yaml如何写?找份北京的golang后端工作,35岁,有人收我吗?

答案2022-02-25:

yaml如下:

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: zookeeper
  name: zookeeper
  namespace: moonfdd
spec:
  replicas: 1
  selector:
    matchLabels:
      app: zookeeper
  template:
    metadata:
      labels:
        app: zookeeper
    spec:
      containers:
        - image: zookeeper
          imagePullPolicy: IfNotPresent
          name: zookeeper
#          volumeMounts:
#            - mountPath: /opt/zookeeper/data
#              name: data
#      volumes:
#        - name: data
#          hostPath:
#            path: /root/k8s/moonfdd/zookeeper/opt/zookeeper/data
#            type: DirectoryOrCreate
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: zookeeper
  name: zookeeper
  namespace: moonfdd
spec:
  ports:
    - port: 2181
      protocol: TCP
      targetPort: 2181
  selector:
    app: zookeeper
  type: NodePort

结果如下:

2022-02-25:k8s安装zookeeper,yaml如何写?找份北京的golang后端工作,35岁,有人收我吗?

zookeeper的yaml

上一篇:25、Scrapy数据的保存


下一篇:2022/2/25随笔