#如果要部署3节点机器,请修改序号,并部署3个sts
kind: StatefulSet apiVersion: apps/v1 metadata: name: rtvt-kafka-1 namespace: rtvt-app labels: app: rtvt-kafka app.kubernetes.io/name: rtvt-kafka app.kubernetes.io/version: v1 version: v1 annotations: kubesphere.io/creator: admin spec: replicas: 1 selector: matchLabels: app: rtvt-kafka app.kubernetes.io/name: rtvt-kafka app.kubernetes.io/version: v1 version: v1 template: metadata: creationTimestamp: null labels: app: rtvt-kafka app.kubernetes.io/name: rtvt-kafka app.kubernetes.io/version: v1 version: v1 annotations: kubesphere.io/creator: admin spec: containers: - name: kafka image: 'harbor-cn.ilivedata.com/test/kafka:3.7.0' ports: - name: tcp-9092 containerPort: 9092 protocol: TCP - name: tcp-9093 containerPort: 9093 protocol: TCP env: - name: LC_ALL value: C.UTF-8 - name: SSL_CERT_DIR value: /etc/ssl/certs - name: KAFKA_NODE_ID value: '1' - name: KAFKA_ADVERTISED_LISTENERS value: 'PLAINTEXT://rtvt-kafka-1-0.rtvt-kafka:9092' - name: KAFKA_ZOOKEEPER_CONNECT value: 'null' - name: KAFKA_LISTENERS value: 'PLAINTEXT://:9092,CONTROLLER://:9093' - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP value: >- CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL - name: KAFKA_PROCESS_ROLES value: 'broker,controller' - name: KAFKA_CONTROLLER_LISTENER_NAMES value: CONTROLLER - name: KAFKA_INTER_BROKER_LISTENER_NAME value: PLAINTEXT - name: KAFKA_CONTROLLER_QUORUM_VOTERS value: >- [email protected]:9093,[email protected]:9093,[email protected]:9093 - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR value: '3' - name: KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR value: '3' - name: KAFKA_TRANSACTION_STATE_LOG_MIN_ISR value: '1' - name: KAFKA_LOG_DIRS value: /tmp/kraft-combined-logs resources: {} terminationMessagePath: /dev/termination-log terminationMessagePolicy: File imagePullPolicy: IfNotPresent restartPolicy: Always terminationGracePeriodSeconds: 30 dnsPolicy: ClusterFirst securityContext: {} schedulerName: default-scheduler serviceName: rtvt-kafka podManagementPolicy: OrderedReady updateStrategy: type: RollingUpdate rollingUpdate: partition: 0 revisionHistoryLimit: 10
标签:rtvt,name,app,value,KAFKA,kafka From: https://www.cnblogs.com/putaoo/p/18104503