kafka-kraft.yaml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. apiVersion: v1
  2. kind: Namespace
  3. metadata:
  4. name: kafka
  5. ---
  6. apiVersion: v1
  7. kind: Service
  8. metadata:
  9. name: kafka-svc
  10. labels:
  11. app: kafka-app
  12. namespace: kafka
  13. spec:
  14. clusterIP: None
  15. ports:
  16. - name: '9092'
  17. port: 9092
  18. protocol: TCP
  19. targetPort: 9092
  20. selector:
  21. app: kafka-app
  22. ---
  23. apiVersion: apps/v1
  24. kind: StatefulSet
  25. metadata:
  26. name: kafka
  27. labels:
  28. app: kafka-app
  29. namespace: kafka
  30. spec:
  31. serviceName: kafka-svc
  32. replicas: 1
  33. selector:
  34. matchLabels:
  35. app: kafka-app
  36. template:
  37. metadata:
  38. labels:
  39. app: kafka-app
  40. spec:
  41. volumes:
  42. - name: kafka-data
  43. persistentVolumeClaim:
  44. claimName: kafka-pv-claim
  45. containers:
  46. - name: kafka
  47. image: pujielan/kafka:3.4.0
  48. imagePullPolicy: IfNotPresent
  49. ports:
  50. - containerPort: 9092
  51. - containerPort: 9093
  52. env:
  53. - name: REPLICAS
  54. value: '1'
  55. - name: SERVICE
  56. value: kafka-svc
  57. - name: NAMESPACE
  58. value: kafka
  59. - name: SHARE_DIR
  60. value: /mnt/kafka
  61. volumeMounts:
  62. - name: kafka-data
  63. mountPath: /mnt/kafka
  64. volumeClaimTemplates:
  65. - metadata:
  66. name: kafka-data
  67. spec:
  68. accessModes:
  69. - ReadWriteOnce
  70. resources:
  71. requests:
  72. storage: 10Gi
  73. storageClassName: openebs-hostpath