apiVersion: apps/v1 kind: StatefulSet metadata: name: {{ include "overleaf.fullname" . }} labels: {{- include "overleaf.labels" . | nindent 4 }} spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} selector: matchLabels: {{- include "overleaf.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "overleaf.labels" . | nindent 8 }} {{- with .Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "overleaf.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http containerPort: {{ .Values.service.port }} protocol: TCP livenessProbe: httpGet: path: / port: http initialDelaySeconds: 60 readinessProbe: httpGet: path: / port: http initialDelaySeconds: 60 env: - name: SHARELATEX_APP_NAME value: {{ .Values.overleaf.appName }} - name: SHARELATEX_MONGO_URL valueFrom: secretKeyRef: key: {{ .Values.overleaf.mongodb.existingSecretKey }} name: {{ .Values.overleaf.mongodb.existingSecret }} - name: SHARELATEX_REDIS_HOST value: {{ .Values.overleaf.redis.url }} - name: REDIS_HOST value: {{ .Values.overleaf.redis.url }} - name: WEB_HOST value: "0.0.0.0" - name: LISTEN_ADDRESS value: "0.0.0.0" - name: WEB_API_HOST value: "0.0.0.0" - name: DOCUPDATER_HOST value: "0.0.0.0" - name: SPELLING_HOST value: "0.0.0.0" - name: DOCSTORE_HOST value: "0.0.0.0" - name: CHAT_HOST value: "0.0.0.0" - name: FILESTORE_HOST value: "0.0.0.0" - name: CLSI_HOST value: "0.0.0.0" - name: PROJECT_HISTORY_HOST value: "0.0.0.0" - name: REALTIME_HOST value: "0.0.0.0" - name: CONTACTS_HOST value: "0.0.0.0" - name: NOTIFICATIONS_HOST value: "0.0.0.0" - name: WEBPACK_HOST value: "0.0.0.0" - name: V1_HISTORY_HOST value: "0.0.0.0" resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.volumeMounts }} volumeMounts: - name: data mountPath: /var/lib/sharelatex {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.volumes }} volumes: - name: data perstentVolumeClaim: claimName: {{ .Values.persistence.existingClaim }} {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }}