|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + name: {{ include "bookstack.fullname" . }} |
| 5 | + labels: |
| 6 | + {{- include "bookstack.labels" . | nindent 4 }} |
| 7 | +spec: |
| 8 | + replicas: 1 |
| 9 | + {{- if .Values.revisionHistoryLimit }} |
| 10 | + revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} |
| 11 | + {{- end }} |
| 12 | + selector: |
| 13 | + matchLabels: |
| 14 | + {{- include "bookstack.selectorLabels" . | nindent 6 }} |
| 15 | + {{- with .Values.strategy }} |
| 16 | + strategy: |
| 17 | + {{- toYaml . | nindent 4 }} |
| 18 | + {{- end }} |
| 19 | + template: |
| 20 | + metadata: |
| 21 | + annotations: |
| 22 | + checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }} |
| 23 | + {{- with .Values.podAnnotations }} |
| 24 | + {{- toYaml . | nindent 8 }} |
| 25 | + {{- end }} |
| 26 | + labels: |
| 27 | + {{- include "bookstack.selectorLabels" . | nindent 8 }} |
| 28 | + spec: |
| 29 | + {{- with .Values.imagePullSecrets }} |
| 30 | + imagePullSecrets: |
| 31 | + {{- toYaml . | nindent 8 }} |
| 32 | + {{- end }} |
| 33 | + serviceAccountName: {{ include "bookstack.serviceAccountName" . }} |
| 34 | + {{- with .Values.podSecurityContext }} |
| 35 | + securityContext: |
| 36 | + {{- toYaml . | nindent 8 }} |
| 37 | + {{- end }} |
| 38 | + containers: |
| 39 | + - name: {{ .Chart.Name }} |
| 40 | + {{- with .Values.securityContext }} |
| 41 | + securityContext: |
| 42 | + {{- toYaml . | nindent 12 }} |
| 43 | + {{- end }} |
| 44 | + image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" |
| 45 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 46 | + ports: |
| 47 | + - name: http |
| 48 | + containerPort: 80 |
| 49 | + protocol: TCP |
| 50 | + envFrom: |
| 51 | + - secretRef: |
| 52 | + name: {{ include "bookstack.fullname" . }} |
| 53 | + env: |
| 54 | + {{- if .Values.settings.url }} |
| 55 | + - name: APP_URL |
| 56 | + value: {{ .Values.settings.url | quote }} |
| 57 | + {{- end }} |
| 58 | + {{- if .Values.settings.debug }} |
| 59 | + - name: APP_DEBUG |
| 60 | + value: {{ .Values.settings.debug | quote }} |
| 61 | + {{- end }} |
| 62 | + {{- if .Values.settings.sessionLifetime }} |
| 63 | + - name: SESSION_LIFETIME |
| 64 | + value: {{ .Values.settings.sessionLifetime | quote }} |
| 65 | + {{- end }} |
| 66 | + {{- if .Values.settings.tz }} |
| 67 | + - name: TZ |
| 68 | + value: {{ .Values.settings.tz | quote }} |
| 69 | + {{- end }} |
| 70 | + {{- if .Values.settings.authSaml2.enabled }} |
| 71 | + - name: AUTH_METHOD |
| 72 | + value: "saml2" |
| 73 | + {{- with .Values.settings.authSaml2 }} |
| 74 | + - name: SAML2_AUTOLOAD_METADATA |
| 75 | + value: {{ .autoloadMetadata | quote }} |
| 76 | + - name: SAML2_DISPLAY_NAME_ATTRIBUTES |
| 77 | + value: {{ .displayNameAttribute | quote }} |
| 78 | + - name: SAML2_EMAIL_ATTRIBUTE |
| 79 | + value: {{ .emailAttribute | quote }} |
| 80 | + - name: SAML2_EXTERNAL_ID_ATTRIBUTE |
| 81 | + value: {{ .externalIdAttribute | quote }} |
| 82 | + - name: SAML2_GROUP_ATTRIBUTE |
| 83 | + value: {{ .groupAttribute | quote }} |
| 84 | + - name: SAML2_IDP_AUTHNCONTEXT |
| 85 | + value: {{ .idpAuthnContent | quote }} |
| 86 | + - name: SAML2_IDP_ENTITYID |
| 87 | + value: {{ .idpEntityId | quote }} |
| 88 | + - name: SAML2_NAME |
| 89 | + value: {{ .name | quote }} |
| 90 | + - name: SAML2_REMOVE_FROM_GROUPS |
| 91 | + value: {{ .removeFromGroups | quote }} |
| 92 | + - name: SAML2_USER_TO_GROUPS |
| 93 | + value: {{ .userToGroups | quote }} |
| 94 | + {{- end }} |
| 95 | + {{- end }} |
| 96 | + {{- if .Values.settings.mail.enabled }} |
| 97 | + {{- with .Values.settings.mail }} |
| 98 | + - name: MAIL_DRIVER |
| 99 | + value: {{ .transport | quote }} |
| 100 | + - name: MAIL_ENCRYPTION |
| 101 | + value: {{ .encryption | quote }} |
| 102 | + - name: MAIL_FROM |
| 103 | + value: {{ .from | quote }} |
| 104 | + - name: MAIL_FROM_NAME |
| 105 | + value: {{ .displayName | quote }} |
| 106 | + - name: MAIL_HOST |
| 107 | + value: {{ .host | quote }} |
| 108 | + - name: MAIL_PORT |
| 109 | + value: {{ .port | quote }} |
| 110 | + {{- end }} |
| 111 | + {{- end }} |
| 112 | + {{- with .Values.env }} |
| 113 | + {{- toYaml . | nindent 12 }} |
| 114 | + {{- end }} |
| 115 | + |
| 116 | + {{- if .Values.customStartupProbe }} |
| 117 | + startupProbe: |
| 118 | + {{- toYaml .Values.customStartupProbe | nindent 12 }} |
| 119 | + {{- else }} |
| 120 | + {{- if .Values.startupProbe.enabled }} |
| 121 | + startupProbe: |
| 122 | + httpGet: |
| 123 | + path: / |
| 124 | + port: http |
| 125 | + httpHeaders: |
| 126 | + - name: Host |
| 127 | + value: localhost:2368 |
| 128 | + {{- with .Values.startupProbe }} |
| 129 | + initialDelaySeconds: {{ .initialDelaySeconds }} |
| 130 | + timeoutSeconds: {{ .timeoutSeconds }} |
| 131 | + failureThreshold: {{ .failureThreshold }} |
| 132 | + successThreshold: {{ .successThreshold }} |
| 133 | + periodSeconds: {{ .periodSeconds }} |
| 134 | + {{- end }} |
| 135 | + {{- end }} |
| 136 | + {{- end }} |
| 137 | + {{- if .Values.customLivenessProbe }} |
| 138 | + livenessProbe: |
| 139 | + {{- toYaml .Values.customLivenessProbe | nindent 12 }} |
| 140 | + {{- else }} |
| 141 | + {{- if .Values.livenessProbe.enabled }} |
| 142 | + livenessProbe: |
| 143 | + httpGet: |
| 144 | + path: / |
| 145 | + port: http |
| 146 | + httpHeaders: |
| 147 | + - name: Host |
| 148 | + value: localhost:2368 |
| 149 | + {{- with .Values.livenessProbe }} |
| 150 | + initialDelaySeconds: {{ .initialDelaySeconds }} |
| 151 | + timeoutSeconds: {{ .timeoutSeconds }} |
| 152 | + failureThreshold: {{ .failureThreshold }} |
| 153 | + successThreshold: {{ .successThreshold }} |
| 154 | + periodSeconds: {{ .periodSeconds }} |
| 155 | + {{- end }} |
| 156 | + {{- end }} |
| 157 | + {{- end }} |
| 158 | + {{- if .Values.customReadinessProbe }} |
| 159 | + readinessProbe: |
| 160 | + {{- toYaml .Values.customReadinessProbe | nindent 12 }} |
| 161 | + {{- else }} |
| 162 | + {{- if .Values.readinessProbe.enabled }} |
| 163 | + readinessProbe: |
| 164 | + httpGet: |
| 165 | + path: / |
| 166 | + port: http |
| 167 | + httpHeaders: |
| 168 | + - name: Host |
| 169 | + value: localhost:2368 |
| 170 | + {{- with .Values.readinessProbe }} |
| 171 | + initialDelaySeconds: {{ .initialDelaySeconds }} |
| 172 | + timeoutSeconds: {{ .timeoutSeconds }} |
| 173 | + failureThreshold: {{ .failureThreshold }} |
| 174 | + successThreshold: {{ .successThreshold }} |
| 175 | + periodSeconds: {{ .periodSeconds }} |
| 176 | + {{- end }} |
| 177 | + {{- end }} |
| 178 | + {{- end }} |
| 179 | + {{- with .Values.resources }} |
| 180 | + resources: |
| 181 | + {{- toYaml . | nindent 12 }} |
| 182 | + {{- end }} |
| 183 | + {{- if .Values.args }} |
| 184 | + args: |
| 185 | + {{- range .Values.args }} |
| 186 | + - {{ . }} |
| 187 | + {{- end }} |
| 188 | + {{- end }} |
| 189 | + volumeMounts: |
| 190 | + - mountPath: /config |
| 191 | + name: bookstack-vol |
| 192 | + {{- with .Values.nodeSelector }} |
| 193 | + nodeSelector: |
| 194 | + {{- toYaml . | nindent 8 }} |
| 195 | + {{- end }} |
| 196 | + {{- with .Values.affinity }} |
| 197 | + affinity: |
| 198 | + {{- toYaml . | nindent 8 }} |
| 199 | + {{- end }} |
| 200 | + {{- with .Values.tolerations }} |
| 201 | + tolerations: |
| 202 | + {{- toYaml . | nindent 8 }} |
| 203 | + {{- end }} |
| 204 | + volumes: |
| 205 | + - name: bookstack-vol |
| 206 | + {{- if .Values.storage.persistentVolumeClaimName }} |
| 207 | + persistentVolumeClaim: |
| 208 | + claimName: {{ .Values.storage.persistentVolumeClaimName }} |
| 209 | + {{- else }} |
| 210 | + {{- if .Values.storage.requestedSize }} |
| 211 | + persistentVolumeClaim: |
| 212 | + claimName: {{ include "bookstack.fullname" . }} |
| 213 | + {{- else }} |
| 214 | + emptyDir: {} |
| 215 | + {{- end }} |
| 216 | + {{- end }} |
0 commit comments