deployment-streaming.yaml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: {{ include "mastodon.fullname" . }}-streaming
  5. labels:
  6. {{- include "mastodon.labels" . | nindent 4 }}
  7. spec:
  8. {{- if not .Values.autoscaling.enabled }}
  9. replicas: {{ .Values.replicaCount }}
  10. {{- end }}
  11. selector:
  12. matchLabels:
  13. {{- include "mastodon.selectorLabels" . | nindent 6 }}
  14. app.kubernetes.io/component: streaming
  15. template:
  16. metadata:
  17. annotations:
  18. {{- with .Values.podAnnotations }}
  19. {{- toYaml . | nindent 8 }}
  20. {{- end }}
  21. # roll the pods to pick up any db migrations or other changes
  22. {{- include "mastodon.rollingPodAnnotations" . | nindent 8 }}
  23. labels:
  24. {{- include "mastodon.selectorLabels" . | nindent 8 }}
  25. app.kubernetes.io/component: streaming
  26. spec:
  27. {{- with .Values.imagePullSecrets }}
  28. imagePullSecrets:
  29. {{- toYaml . | nindent 8 }}
  30. {{- end }}
  31. serviceAccountName: {{ include "mastodon.serviceAccountName" . }}
  32. {{- with .Values.podSecurityContext }}
  33. securityContext:
  34. {{- toYaml . | nindent 8 }}
  35. {{- end }}
  36. containers:
  37. - name: {{ .Chart.Name }}
  38. {{- with .Values.securityContext }}
  39. securityContext:
  40. {{- toYaml . | nindent 12 }}
  41. {{- end }}
  42. image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
  43. imagePullPolicy: {{ .Values.image.pullPolicy }}
  44. command:
  45. - node
  46. - ./streaming
  47. envFrom:
  48. - configMapRef:
  49. name: {{ include "mastodon.fullname" . }}-env
  50. env:
  51. - name: "DB_PASS"
  52. valueFrom:
  53. secretKeyRef:
  54. name: {{ template "mastodon.postgresql.secretName" . }}
  55. key: password
  56. - name: "REDIS_PASSWORD"
  57. valueFrom:
  58. secretKeyRef:
  59. name: {{ template "mastodon.redis.secretName" . }}
  60. key: redis-password
  61. - name: "PORT"
  62. value: {{ .Values.mastodon.streaming.port | quote }}
  63. ports:
  64. - name: streaming
  65. containerPort: {{ .Values.mastodon.streaming.port }}
  66. protocol: TCP
  67. livenessProbe:
  68. httpGet:
  69. path: /api/v1/streaming/health
  70. port: streaming
  71. readinessProbe:
  72. httpGet:
  73. path: /api/v1/streaming/health
  74. port: streaming
  75. {{- with .Values.resources }}
  76. resources:
  77. {{- toYaml . | nindent 12 }}
  78. {{- end }}
  79. {{- with .Values.nodeSelector }}
  80. nodeSelector:
  81. {{- toYaml . | nindent 8 }}
  82. {{- end }}
  83. {{- with .Values.affinity }}
  84. affinity:
  85. {{- toYaml . | nindent 8 }}
  86. {{- end }}
  87. {{- with .Values.tolerations }}
  88. tolerations:
  89. {{- toYaml . | nindent 8 }}
  90. {{- end }}