deployment.yaml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. {{- if .Values.ui.enabled }}
  2. {{- $thisValues := .Values.ui }}
  3. {{- $componet := "kafka-ui" }}
  4. apiVersion: apps/v1
  5. kind: Deployment
  6. metadata:
  7. name: {{ include "kafka.ui.fullname" . }}
  8. labels:
  9. {{- include "kafka.labels" . | nindent 4 }}
  10. component: {{ $componet | quote }}
  11. spec:
  12. {{- if $thisValues.replicaCount }}
  13. replicas: {{ $thisValues.replicaCount }}
  14. {{- end }}
  15. selector:
  16. matchLabels:
  17. {{- include "kafka.selectorLabels" . | nindent 6 }}
  18. component: {{ $componet | quote }}
  19. template:
  20. metadata:
  21. {{- with $thisValues.podAnnotations }}
  22. annotations:
  23. {{- toYaml . | nindent 8 }}
  24. {{- end }}
  25. labels:
  26. {{- include "kafka.selectorLabels" . | nindent 8 }}
  27. component: {{ $componet | quote }}
  28. {{- with $thisValues.podLabels }}
  29. {{- toYaml . | nindent 8 }}
  30. {{- end }}
  31. spec:
  32. {{- with .Values.imagePullSecrets }}
  33. imagePullSecrets:
  34. {{- toYaml . | nindent 8 }}
  35. {{- end }}
  36. serviceAccountName: {{ include "kafka.serviceAccountName" . }}
  37. securityContext:
  38. {{- toYaml $thisValues.podSecurityContext | nindent 8 }}
  39. containers:
  40. - name: kafka-ui
  41. securityContext:
  42. {{- toYaml .Values.securityContext | nindent 12 }}
  43. image: "{{ $thisValues.image.repository }}:{{ $thisValues.image.tag }}"
  44. imagePullPolicy: {{ $thisValues.image.pullPolicy }}
  45. env:
  46. - name: DYNAMIC_CONFIG_ENABLED
  47. value: "true"
  48. - name: KAFKA_CLUSTERS_0_NAME
  49. value: {{ include "kafka.fullname" . }}
  50. - name: KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS
  51. value: {{ include "kafka.bootstrapServers" . }}
  52. ports:
  53. - name: http
  54. containerPort: 8080
  55. protocol: TCP
  56. {{- with $thisValues.livenessProbe }}
  57. livenessProbe:
  58. {{- toYaml . | nindent 12 }}
  59. {{- end }}
  60. {{- with $thisValues.readinessProbe }}
  61. readinessProbe:
  62. {{- toYaml . | nindent 12 }}
  63. {{- end }}
  64. {{- with $thisValues.resources }}
  65. resources:
  66. {{- toYaml . | nindent 12 }}
  67. {{- end }}
  68. {{- with $thisValues.nodeSelector }}
  69. nodeSelector:
  70. {{- toYaml . | nindent 8 }}
  71. {{- end }}
  72. {{- with $thisValues.affinity }}
  73. affinity:
  74. {{- toYaml . | nindent 8 }}
  75. {{- end }}
  76. {{- with $thisValues.tolerations }}
  77. tolerations:
  78. {{- toYaml . | nindent 8 }}
  79. {{- end }}
  80. {{- end }}