Newer
Older
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "onlyoffice-documentserver.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "onlyoffice-documentserver.name" . }}
helm.sh/chart: {{ include "onlyoffice-documentserver.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.onlyoffice.deploymentLabels }}
{{- toYaml .Values.onlyoffice.deploymentLabels | nindent 4 }}
{{- end }}
replicas: {{ .Values.onlyoffice.replicaCount }}
type: {{ .Values.onlyoffice.strategy }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "onlyoffice-documentserver.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "onlyoffice-documentserver.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Values.onlyoffice.podLabels }}
{{- toYaml .Values.onlyoffice.podLabels | nindent 8 }}
{{- end }}
annotations: {{ toYaml .Values.onlyoffice.podAnnotations | nindent 8 }}
spec:
containers:
- name: {{ .Chart.Name }}
lifecycle:
preStop:
exec:
command:
- "documentserver-prepare4shutdown.sh"
image: "{{ .Values.onlyoffice.image.repository }}:{{ .Values.onlyoffice.image.tag }}"
imagePullPolicy: {{ .Values.onlyoffice.image.pullPolicy }}
{{- if .Values.onlyoffice.livenessProbe.enabled }}
exec:
command:
- "/bin/bash"
- "-c"
- "output=$(curl -s http://localhost:{{ .Values.onlyoffice.containerPort }}/healthcheck); if [ $? -ne 0 ]; then exit 1; fi; if [ \"$output\" == \"true\" ]; then exit 0; else exit 2; fi"
initialDelaySeconds: {{ .Values.onlyoffice.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.onlyoffice.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.onlyoffice.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.onlyoffice.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.onlyoffice.livenessProbe.failureThreshold }}
{{- if .Values.onlyoffice.readinessProbe.enabled }}
readinessProbe:
exec:
command:
- "/bin/bash"
- "-c"
- "output=$(curl -s http://localhost:{{ .Values.onlyoffice.containerPort }}/healthcheck); if [ $? -ne 0 ]; then exit 1; fi; if [ \"$output\" == \"true\" ]; then exit 0; else exit 2; fi"
initialDelaySeconds: {{ .Values.onlyoffice.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.onlyoffice.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.onlyoffice.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.onlyoffice.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.onlyoffice.readinessProbe.failureThreshold }}
{{- end }}
{{- if .Values.onlyoffice.startupProbe.enabled }}
startupProbe:
exec:
command:
- "/bin/bash"
- "-c"
- "output=$(curl -s http://localhost:{{ .Values.onlyoffice.containerPort }}/healthcheck); if [ $? -ne 0 ]; then exit 1; fi; if [ \"$output\" == \"true\" ]; then exit 0; else exit 2; fi"
periodSeconds: {{ .Values.onlyoffice.startupProbe.periodSeconds }}
timeoutSeconds: {{ .Values.onlyoffice.startupProbe.timeoutSeconds }}
successThreshold: {{ .Values.onlyoffice.startupProbe.successThreshold }}
failureThreshold: {{ .Values.onlyoffice.startupProbe.failureThreshold }}
{{- end }}
value: "amqp://user:{{ .Values.rabbitmq.auth.password }}@{{ .Release.Name }}-rabbitmq:{{ .Values.rabbitmq.service.ports.amqp }}"
value: "{{ .Values.onlyoffice.jwtSecret }}"
- name: DB_TYPE
value: "mariadb"
value: "{{ .Values.global.onlyofficeDb.user }}"
name: "{{ .Release.Name }}-onlyoffice-database"
key: "database-password"
value: {{ .Values.global.onlyofficeDb.host | default (printf "%s-mariadb" .Release.Name) }}
value: "{{ .Values.global.onlyofficeDb.port }}"
value: "{{ .Values.global.onlyofficeDb.name }}"
{{- if .Values.nextcloud.redis.enabled }}
- name: REDIS_SERVER_HOST
value: "{{ .Release.Name }}-redis-master"
- name: REDIS_SERVER_PORT
value: "{{ .Values.nextcloud.redis.master.service.ports.redis }}"
- name: GENERATE_FONTS
value: "{{ .Values.onlyoffice.generateFonts }}"
{{- if .Values.nextcloud.redis.auth.enabled }}
- name: REDIS_SERVER_PASS
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-redis"
- name: USE_UNAUTHORIZED_STORAGE
value: "{{ .Values.onlyoffice.unauthorizedStorage }}"
- name: ONLYOFFICE_HTTPS_HSTS_ENABLED
value: "{{ .Values.onlyoffice.httpsHstsEnabled }}"
containerPort: {{ .Values.onlyoffice.containerPort }}
- name: spellchecker
containerPort: 8080
protocol: TCP
{{- toYaml .Values.onlyoffice.resources | nindent 12 }}
{{- toYaml .Values.onlyoffice.securityContext | nindent 12 }}
volumeMounts:
- name: onlyoffice-data
mountPath: /var/lib/onlyoffice
volumes:
- name: onlyoffice-data
{{- if .Values.onlyoffice.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ if .Values.onlyoffice.persistence.existingClaim }}{{ .Values.onlyoffice.persistence.existingClaim }}{{- else }}{{ template "onlyoffice-documentserver.fullname" . }}-onlyoffice{{- end }}
{{- else }}
emptyDir: {}
{{- end }}
{{- with .Values.onlyoffice.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.onlyoffice.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.onlyoffice.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}