Skip to content

Commit f6ac01f

Browse files
committed
Add nodebb
1 parent 625cb8e commit f6ac01f

File tree

7 files changed

+120
-9
lines changed

7 files changed

+120
-9
lines changed

apps/nodebb/templates/config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: nodebb
5+
namespace: faf-apps
6+
labels:
7+
app: nodebb
8+
data:
9+
MONGODB_USER: "nodebb"
10+
MONGODB_DATABASE: "nodebb"

apps/nodebb/templates/deployment.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
labels:
5+
app: nodebb
6+
name: nodebb
7+
spec:
8+
replicas: 1
9+
revisionHistoryLimit: 10
10+
selector:
11+
matchLabels:
12+
app: nodebb
13+
template:
14+
metadata:
15+
labels:
16+
app: nodebb
17+
spec:
18+
initContainers:
19+
- name: permission-init
20+
image: alpine:3.16.0
21+
command:
22+
- sh
23+
- -c
24+
- chown -R 1000:1000 /data/* && chmod 775 /data/* && ls -lah /data
25+
volumeMounts:
26+
- mountPath: /data/node_modules
27+
name: nodebb
28+
subPath: node_modules
29+
- mountPath: /data/build
30+
name: nodebb
31+
subPath: build
32+
- mountPath: /data/uploads
33+
name: nodebb
34+
subPath: uploads
35+
containers:
36+
- image: nodebb/docker:1.18.5
37+
{{/* command:*/}}
38+
{{/* - /bin/sh*/}}
39+
{{/* - "-c"*/}}
40+
{{/* - sleep 3600*/}}
41+
imagePullPolicy: Always
42+
name: nodebb
43+
volumeMounts:
44+
- mountPath: /usr/src/app/config.json
45+
name: config
46+
subPath: config.json
47+
- mountPath: /usr/src/app/node_modules
48+
name: nodebb
49+
subPath: node_modules
50+
- mountPath: /usr/src/app/build
51+
name: nodebb
52+
subPath: build
53+
- mountPath: /usr/src/app/public/uploads
54+
name: nodebb
55+
subPath: uploads
56+
restartPolicy: Always
57+
volumes:
58+
- name: config
59+
secret:
60+
secretName: nodebb
61+
- name: nodebb
62+
persistentVolumeClaim:
63+
claimName: nodebb-pvc
64+
securityContext:
65+
fsGroup: 1000

apps/nodebb/templates/ingress.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: traefik.io/v1alpha1
2+
kind: IngressRoute
3+
metadata:
4+
name: nodebb
5+
spec:
6+
entryPoints:
7+
- websecure
8+
routes:
9+
- match: Host(`forum.{{.Values.baseDomain}}`)
10+
kind: Rule
11+
services:
12+
- name: nodebb
13+
port: 4567

apps/nodebb/templates/secret.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: secrets.infisical.com/v1alpha1
2+
kind: InfisicalSecret
3+
metadata:
4+
name: nodebb
5+
namespace: faf-apps
6+
spec:
7+
authentication:
8+
universalAuth:
9+
credentialsRef:
10+
secretName: infisical-machine-identity
11+
secretNamespace: faf-ops
12+
secretsScope:
13+
projectSlug: {{.Values.infisical.projectSlug}}
14+
envSlug: {{.Values.infisical.envSlug}}
15+
secretsPath: "/nodebb"
16+
managedSecretReference:
17+
secretName: nodebb
18+
secretNamespace: faf-apps
19+
creationPolicy: "Owner"

apps/nodebb/templates/service.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
# This is a temporary workaround to point to the nodebb instance running in faf-stack for the API to reach it
2-
# (it is exposed to the host though)
3-
# TODO: Replace as soon as nodebb runs in cluster
41
apiVersion: v1
52
kind: Service
63
metadata:
74
name: nodebb
5+
labels:
6+
app: nodebb
87
spec:
9-
type: ExternalName
10-
externalName: {{.Values.hostName}}
8+
selector:
9+
app: nodebb
10+
ports:
11+
- port: 4567
12+
targetPort: 4567

cluster/storage/values.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ managedStorages:
4848
size: 20Gi
4949
pvc:
5050
namespace: faf-infra
51+
- pv:
52+
name: nodebb
53+
size: 15Gi
54+
pvc:
55+
namespace: faf-apps
5156
- pv:
5257
name: wordpress
5358
size: 10Gi
@@ -82,6 +87,3 @@ managedStorages:
8287
# namespace: faf-apps
8388
# size: 20Gi
8489
# size: 10Gi
85-
# - name: nodebb
86-
# namespace: faf-apps
87-
# size: 10Gi

scripts/init-mongodb.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ MONGODB_SCRIPT
5151
fi
5252
}
5353

54-
create_user_and_db faf-apps wikijs DB_USER DB_PASS DB_NAME
54+
create_user_and_db faf-apps nodebb MONGODB_USER MONGO_NODEBB_PASSWORD MONGODB_DATABASE
5555

5656
echo "All users and databases have been processed."

0 commit comments

Comments
 (0)