deployment.yaml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: {{ include "canal-admin.fullname" . }}
  5. labels:
  6. {{- include "canal-admin.labels" . | nindent 4 }}
  7. spec:
  8. {{- if not .Values.autoscaling.enabled }}
  9. replicas: {{ .Values.replicaCount }}
  10. {{- end }}
  11. selector:
  12. matchLabels:
  13. {{- include "canal-admin.selectorLabels" . | nindent 6 }}
  14. template:
  15. metadata:
  16. {{- with .Values.podAnnotations }}
  17. annotations:
  18. {{- toYaml . | nindent 8 }}
  19. {{- end }}
  20. labels:
  21. {{- include "canal-admin.labels" . | nindent 8 }}
  22. {{- with .Values.podLabels }}
  23. {{- toYaml . | nindent 8 }}
  24. {{- end }}
  25. spec:
  26. {{- with .Values.imagePullSecrets }}
  27. imagePullSecrets:
  28. {{- toYaml . | nindent 8 }}
  29. {{- end }}
  30. serviceAccountName: {{ include "canal-admin.serviceAccountName" . }}
  31. securityContext:
  32. {{- toYaml .Values.podSecurityContext | nindent 8 }}
  33. containers:
  34. - name: {{ .Chart.Name }}
  35. securityContext:
  36. {{- toYaml .Values.securityContext | nindent 12 }}
  37. image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
  38. imagePullPolicy: {{ .Values.image.pullPolicy }}
  39. ports:
  40. - name: http
  41. containerPort: {{ .Values.service.port }}
  42. protocol: TCP
  43. livenessProbe:
  44. {{- toYaml .Values.livenessProbe | nindent 12 }}
  45. readinessProbe:
  46. {{- toYaml .Values.readinessProbe | nindent 12 }}
  47. resources:
  48. {{- toYaml .Values.resources | nindent 12 }}
  49. volumeMounts:
  50. - mountPath: /home/admin/canal-admin/conf/application.yml
  51. name: secret
  52. subPath: application.yml
  53. {{- with .Values.volumeMounts }}
  54. {{- toYaml . | nindent 12 }}
  55. {{- end }}
  56. volumes:
  57. - name: secret
  58. secret:
  59. defaultMode: 420
  60. secretName: {{ include "canal-admin.fullname" . }}
  61. {{- with .Values.volumes }}
  62. {{- toYaml . | nindent 8 }}
  63. {{- end }}
  64. {{- with .Values.nodeSelector }}
  65. nodeSelector:
  66. {{- toYaml . | nindent 8 }}
  67. {{- end }}
  68. {{- with .Values.affinity }}
  69. affinity:
  70. {{- toYaml . | nindent 8 }}
  71. {{- end }}
  72. {{- with .Values.tolerations }}
  73. tolerations:
  74. {{- toYaml . | nindent 8 }}
  75. {{- end }}