赞
踩
kafka-ui-deploy.yaml
apiVersion: apps/v1 kind: Deployment metadata: name: kafka-ui labels: app: kafka-ui spec: selector: matchLabels: app: kafka-ui replicas: 1 strategy: type: RollingUpdate rollingUpdate: maxUnavailable: 0 maxSurge: 1 # minReadySeconds: 30 template: metadata: labels: app: kafka-ui tag: kobe spec: containers: - name: kafka-ui image: provectuslabs/kafka-ui:v0.5.0 imagePullPolicy: IfNotPresent env: - name: TZ value: "Asia/Shanghai" - name: LANG value: C.UTF-8 - name: LC_ALL value: C.UTF-8 - name: KAFKA_CLUSTERS_0_NAME value: local - name: KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS value: kafka.logging:9092 # livenessProbe: # failureThreshold: 2 # initialDelaySeconds: 30 # periodSeconds: 10 # successThreshold: 1 # tcpSocket: # port: 8080 # timeoutSeconds: 2 # readinessProbe: # failureThreshold: 2 # initialDelaySeconds: 30 # periodSeconds: 10 # successThreshold: 1 # tcpSocket: # port: 8080 # timeoutSeconds: 2 ports: - containerPort: 8080 protocol: TCP resources: limits: cpu: 194m memory: 500Mi requests: cpu: 80m memory: 300Mi dnsPolicy: ClusterFirst restartPolicy: Always securityContext: {} serviceAccountName: default
kafka-ui-service.yaml
--- apiVersion: v1 kind: Service metadata: labels: app: kafka-ui name: kafka-ui-service spec: ports: - name: http protocol: TCP port: 8080 targetPort: 8080 selector: app: kafka-ui sessionAffinity: None type: NodePort
这里将存活性探针和就绪性探针都注释了,加了刚开始怎么都起不来,原因是kafka-ui启动的时间比较长,然后我这边设置的时间比较短,每次它启动到一半,就绪性探针没探测到8080端口,就会重启该pod,然后就会陷入一个死循环,解决办法有两种,第一种是调大探测时间,第二种就是直接注释掉两个探针,我偷懒就直接注释了,pod是可以正常启动到,因为是不太重要的服务,所以无所谓,如果是业务pod,最好还是慢慢调试
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。