Skip to content

Commit e6dd170

Browse files
committed
Add mongodb
1 parent 9eae9eb commit e6dd170

10 files changed

Lines changed: 101 additions & 12 deletions

File tree

apps/faf-mongodb/Chart.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
apiVersion: v2
2+
name: faf-mongodb
3+
version: 1.0.0
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: mongodb
5+
spec:
6+
type: ExternalName
7+
# Define mongodb.hostName in config, if you use an external database
8+
externalName: {{ default "mongodb.faf-infra.svc.cluster.local" .Values.mongodb.hostName }}

apps/faf-mongodb/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# placeholder for .Values.mongodb.hostName
2+
mongodb: {}

apps/faf-postgres/templates/service.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ metadata:
44
name: postgres
55
spec:
66
type: ExternalName
7-
# Define mariadb.hostName in config, if you use an external database
8-
externalName: {{ default "postgres.postgres.svc.cluster.local" .Values.postgres.hostName }}
7+
# Define postgres.hostName in config, if you use an external database
8+
externalName: {{ default "postgres.faf-infra.svc.cluster.local" .Values.postgres.hostName }}

apps/mongodb/templates/service.yaml

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: mongodb
5+
labels:
6+
app: mongodb
7+
data:
8+
MONGO_INITDB_ROOT_USERNAME: "root"
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: mongodb
5+
namespace: faf-infra
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: "/mongodb"
16+
managedSecretReference:
17+
secretName: mongodb
18+
secretNamespace: faf-infra
19+
creationPolicy: "Owner"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: mongodb
5+
labels:
6+
app: mongodb
7+
spec:
8+
selector:
9+
app: mongodb
10+
ports:
11+
- port: 27017
12+
targetPort: 27017
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
apiVersion: apps/v1
2+
kind: StatefulSet
3+
metadata:
4+
name: mongodb
5+
labels:
6+
app: mongodb
7+
spec:
8+
serviceName: mongodb
9+
replicas: 1
10+
revisionHistoryLimit: 10
11+
selector:
12+
matchLabels:
13+
app: mongodb
14+
template:
15+
metadata:
16+
labels:
17+
app: mongodb
18+
spec:
19+
containers:
20+
- image: mongo:7.0.14
21+
imagePullPolicy: Always
22+
name: mongodb
23+
ports:
24+
- containerPort: 27017
25+
protocol: TCP
26+
envFrom:
27+
- configMapRef:
28+
name: mongodb
29+
- secretRef:
30+
name: mongodb
31+
volumeMounts:
32+
- name: mongodb-pvc
33+
mountPath: /data/db
34+
subPath: data/db
35+
- name: mongodb-pvc
36+
mountPath: /data/backup
37+
subPath: backup
38+
restartPolicy: Always
39+
volumes:
40+
- name: config
41+
configMap:
42+
name: mongodb
43+
- name: mongodb-pvc
44+
persistentVolumeClaim:
45+
claimName: mongodb-pvc
46+
securityContext:
47+
fsGroup: 999 # MongoDB user

0 commit comments

Comments
 (0)