Skip to content

Commit ca04835

Browse files
committed
update chart to support docs v2
1 parent 4ab92fd commit ca04835

5 files changed

Lines changed: 59 additions & 39 deletions

File tree

Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ apiVersion: v2
22
name: codex-docs
33
description: A Helm chart for CodeX Docs
44
type: application
5-
version: "0.3.0"
6-
appVersion: "0.3.5"
5+
version: "2.0.0-alpha.1"
6+
appVersion: "stage-9f72b32-1666992781"

templates/configmap.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,5 @@ kind: ConfigMap
33
metadata:
44
name: {{ .Release.Name }}-config
55
data:
6-
codexdocsrc: |-
7-
{{ .Values.configuration.codexdocsrc | toJson }}
8-
production.json: |-
9-
{{ .Values.configuration.production | toJson }}
6+
docs-config.yaml: |-
7+
{{- .Values.configuration | toYaml | nindent 4 }}

templates/deployment.yaml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ metadata:
55
labels:
66
{{- include "codexdocs.labels" . | nindent 4 }}
77
spec:
8-
{{/* {{- if not .Values.autoscaling.enabled }}*/}}
9-
{{/* replicas: {{ .Values.replicaCount }}*/}}
10-
{{/* {{- end }}*/}}
8+
{{- if or (eq .Values.configuration.database.driver "local") (eq .Values.configuration.uploads.driver "local")}}
119
replicas: 1
1210
strategy:
1311
type: Recreate
12+
{{- else }}
13+
replicas: {{ .Values.replicaCount }}
14+
{{- end }}
1415
selector:
1516
matchLabels:
1617
{{- include "codexdocs.selectorLabels" . | nindent 6 }}
@@ -34,35 +35,40 @@ spec:
3435
configMap:
3536
defaultMode: 420
3637
name: {{ .Release.Name }}-config
38+
{{- if eq .Values.configuration.database.driver "local" }}
3739
- name: {{ include "codexdocs.fullname" . }}-db
3840
persistentVolumeClaim:
3941
claimName: {{ include "codexdocs.fullname" . }}-db
42+
{{- end }}
43+
{{- if eq .Values.configuration.uploads.driver "local" }}
4044
- name: {{ include "codexdocs.fullname" . }}-uploads
4145
persistentVolumeClaim:
4246
claimName: {{ include "codexdocs.fullname" . }}-uploads
47+
{{- end }}
4348
containers:
4449
- name: {{ .Chart.Name }}
4550
securityContext:
4651
{{- toYaml .Values.securityContext | nindent 12 }}
4752
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
4853
imagePullPolicy: {{ .Values.image.pullPolicy }}
4954
env:
50-
- name: PASSWORD
55+
- name: APP_CONFIG_auth_password
5156
valueFrom:
5257
secretKeyRef:
5358
name: {{ template "codexdocs.secretName" . }}
5459
key: {{ template "codexdocs.secretPasswordKey" . }}
5560
volumeMounts:
5661
- name: config
57-
mountPath: /usr/src/app/.codexdocsrc
58-
subPath: "codexdocsrc"
59-
- name: config
60-
mountPath: /usr/src/app/config/production.json
61-
subPath: "production.json"
62+
mountPath: /usr/src/app/config/docs-config.yaml
63+
subPath: "docs-config.yaml"
64+
{{- if eq .Values.configuration.database.driver "local" }}
6265
- name: {{ include "codexdocs.fullname" . }}-db
63-
mountPath: {{ .Values.configuration.production.database }}
66+
mountPath: {{ .Values.configuration.database.local.path }}
67+
{{- end}}
68+
{{- if eq .Values.configuration.uploads.driver "local" }}
6469
- name: {{ include "codexdocs.fullname" . }}-uploads
65-
mountPath: {{ .Values.configuration.production.uploads }}
70+
mountPath: {{ .Values.configuration.uploads.local.path }}
71+
{{- end}}
6672
ports:
6773
- name: http
6874
containerPort: 3000

templates/volumes.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{ if eq .Values.configuration.database.driver "local" }}
12
apiVersion: v1
23
kind: PersistentVolumeClaim
34
metadata:
@@ -11,6 +12,9 @@ spec:
1112
resources:
1213
requests:
1314
storage: {{ .Values.volumes.db.storage }}
15+
{{end}}
16+
17+
{{ if eq .Values.configuration.uploads.driver "local" }}
1418
---
1519
apiVersion: v1
1620
kind: PersistentVolumeClaim
@@ -24,4 +28,5 @@ spec:
2428
- ReadWriteOnce
2529
resources:
2630
requests:
27-
storage: {{ .Values.volumes.uploads.storage }}
31+
storage: {{ .Values.volumes.uploads.storage }}
32+
{{end}}

values.yaml

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,40 @@
1-
#replicaCount: 1
1+
replicaCount: 1
22

33
configuration:
4-
codexdocsrc:
4+
port: 3000
5+
host: "0.0.0.0"
6+
uploads:
7+
driver: "s3"
8+
s3:
9+
bucket: "my-bucket"
10+
region: "eu-central-1"
11+
baseUrl: "http://docs-static.codex.so.s3-website.eu-central-1.amazonaws.com"
12+
keyPrefix: "/"
13+
accessKeyId: "my-access-key"
14+
secretAccessKey: "my-secret-key"
15+
frontend:
516
title: "CodeX Docs"
617
description: "A block-styled editor with clean JSON output"
7-
landingFrameSrc: "https://codex.so/editor?frame=1"
18+
startPage: ""
19+
misprintsChatId: "12344564"
20+
yandexMetrikaId: ""
21+
carbon:
22+
serve: ""
23+
placement: ""
824
menu:
925
- "Guides"
10-
- "API"
11-
- "Plugins"
12-
- title: "Support Project"
13-
uri: "/support"
14-
misprintsChatId:
15-
startPage:
16-
yandexMetrikaId:
17-
carbon:
18-
placement:
19-
serve:
20-
production:
21-
port: 3000
22-
database: "/mnt/db"
23-
rcFile: "./.codexdocsrc"
24-
uploads: "/usr/src/app/public/uploads"
25-
secret: "iamasecretstring"
26-
favicon: ""
26+
- title: "CodeX"
27+
uri: "https://codex.so"
28+
29+
auth:
30+
password: "will be generated automatically"
31+
secret: supersecret
32+
33+
database:
34+
driver: mongodb # you can change database driver here. 'mongodb' or 'local'
35+
mongodb:
36+
uri: mongodb://localhost:27017/docs
37+
2738

2839
# Authentication parameters
2940
auth:
@@ -42,7 +53,7 @@ auth:
4253

4354
image:
4455
repository: ghcr.io/codex-team/codex.docs
45-
pullPolicy: Always
56+
pullPolicy: IfNotPresent
4657
tag: ""
4758

4859
imagePullSecrets: []

0 commit comments

Comments
 (0)