Files
infra-prod/deploy/rocket-chat/templates/microservices-stream-hub-deployment.yaml
2025-04-03 15:16:10 +02:00

101 lines
3.7 KiB
YAML

{{- if .Values.microservices.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-stream-hub
labels:
app.kubernetes.io/name: {{ include "rocketchat.name" . }}
helm.sh/chart: {{ include "rocketchat.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.deploymentLabels }}
{{- toYaml .Values.deploymentLabels | nindent 4 }}
{{- end }}
spec:
replicas: 1
revisionHistoryLimit: 0
selector:
matchLabels:
app.kubernetes.io/name: {{ .Release.Name }}-stream-hub
app.kubernetes.io/instance: {{ .Release.Name }}
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
template:
metadata:
labels:
app.kubernetes.io/name: {{ .Release.Name }}-stream-hub
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Values.podLabels }}
{{- toYaml .Values.podLabels | nindent 8 }}
{{- end }}
annotations:
{{ include "rocketchat.annotations" (dict "name" "streamHub" "context" $) | indent 8 }}
spec:
tolerations:
{{ include "rocketchat.tolerations" (dict "name" "streamHub" "context" $) | indent 8 }}
nodeSelector:
{{ include "rocketchat.nodeSelector" (dict "name" "streamHub" "context" $) | indent 8 }}
affinity:
{{ include "rocketchat.nodeAffinity" (dict "name" "streamHub" "context" $) | indent 8 }}
containers:
- name: stream-hub
image: "{{ .Values.microservices.streamHub.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
env:
{{- if .Values.existingMongodbSecret }}
- name: MONGO_URL
valueFrom:
secretKeyRef:
name: {{ .Values.existingMongodbSecret }}
key: mongo-uri
- name: MONGO_OPLOG_URL
valueFrom:
secretKeyRef:
name: {{ .Values.existingMongodbSecret }}
key: mongo-oplog-uri
{{- else }}
- name: MONGO_URL
valueFrom:
secretKeyRef:
name: {{ template "rocketchat.fullname" . }}
key: mongo-uri
- name: MONGO_OPLOG_URL
valueFrom:
secretKeyRef:
name: {{ template "rocketchat.fullname" . }}
key: mongo-oplog-uri
{{- end }}
- name: TRANSPORTER
value: nats://{{ .Release.Name }}-nats:4222
- name: MOLECULER_LOG_LEVEL
value: {{ .Values.microservices.logLevel | quote }}
- name: HEARTBEAT_INTERVAL
value: {{ .Values.microservices.heartbeatInterval | quote }}
- name: HEARTBEAT_TIMEOUT
value: {{ .Values.microservices.heartbeatTimeout | quote }}
- name: RETRY_ENABLED
value: 'yes'
- name: MS_METRICS
value: {{ .Values.prometheusScraping.enabled | default "false" | quote }}
volumeMounts:
{{- if .Values.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.microservices.streamHub.securityContext | nindent 10 }}
resources: {{- toYaml .Values.microservices.streamHub.resources | nindent 10 }}
volumes:
{{- if .Values.extraVolumes }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 6 }}
{{- end }}
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
{{- end }}
{{/* vi: ts=8 et sw=2 smarttab */}}