先部署zookeeper,见文档:
zk部署文档

svc

apiVersion: v1
kind: Service
metadata:
  name: sys-k8s-kafka-hs
  namespace: base
  labels:
    app: sys-k8s-kafka
spec:
  ports:
  - port: 9092
    name: server
  clusterIP: None
  selector:
    app: sys-k8s-kafka
---
apiVersion: v1
kind: Service
metadata:
  name: sys-k8s-kafka
  namespace: base
  labels:
    app: sys-k8s-kafka
spec:
  type: NodePort
  ports:
  - port: 9092
    name: server
    nodePort: 30068
  selector:
    app: sys-k8s-kafka

pdb

apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
  name: sys-k8s-kafka
  namespace: base
spec:
  selector:
    matchLabels:
      app: sys-k8s-kafka
  minAvailable: 2

StatefulSet 练的zk名称是zk-cs



发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code