initial commit
This commit is contained in:
57
k8s_config/dev/mongodb/create_db.js
Normal file
57
k8s_config/dev/mongodb/create_db.js
Normal file
@@ -0,0 +1,57 @@
|
||||
|
||||
db.createCollection("users")
|
||||
db.createCollection("groups")
|
||||
db.users.insert({
|
||||
"_id" : "979888c6-656f-4af7-b7a4-97a02a3cc13d",
|
||||
"namespace" : "parcoursmob",
|
||||
"authentication" : {
|
||||
"local" : {
|
||||
"username" : "admin@parcoursmob.fr",
|
||||
"password" : "$2a$10$XVq9C9az1O0w.kCzqcMZtOAMxur1ODRT5vF9/GmILyHc1Xjalzymu",
|
||||
"email" : "",
|
||||
"email_validation" : {
|
||||
"validated" : false,
|
||||
"validation_code" : ""
|
||||
},
|
||||
"phone_number" : "",
|
||||
"phone_number_validation" : {
|
||||
"validated" : false,
|
||||
"validation_code" : ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"data" : {
|
||||
"first_name" : "Admin",
|
||||
"last_name" : "Parcoursmob",
|
||||
"phone_number" : "+33600000000",
|
||||
"email" : "noreply@parcoursmob.fr",
|
||||
"groups" : [
|
||||
"483280d0-db2d-4f06-b361-02e4be5012d2",
|
||||
"483280d0-db2d-4f06-b361-02e4be5012d2:admin",
|
||||
],
|
||||
"display_name" : "Admin Parcoursmob"
|
||||
},
|
||||
"metadata" : {
|
||||
"created" : ISODate("2022-08-09T10:14:51.879+0000")
|
||||
}
|
||||
})
|
||||
|
||||
db.groups.insert({
|
||||
"_id" : "483280d0-db2d-4f06-b361-02e4be5012d2",
|
||||
"namespace" : "parcoursmob_organizations",
|
||||
"members" : [],
|
||||
"data" : {
|
||||
"modules" : {
|
||||
"groups_management" : true,
|
||||
"vehicles_management" : true,
|
||||
"directory" : true,
|
||||
"administration" : true,
|
||||
"agenda" : true,
|
||||
"vehicles" : true,
|
||||
"support" : true,
|
||||
"beneficiaries" : true,
|
||||
"journeys" : true
|
||||
},
|
||||
"name" : "COOPGO"
|
||||
}
|
||||
})
|
||||
10
k8s_config/dev/mongodb/kustomization.yaml
Normal file
10
k8s_config/dev/mongodb/kustomization.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
resources:
|
||||
- pcv.yaml
|
||||
- service.yaml
|
||||
- statefulset.yaml
|
||||
|
||||
|
||||
configMapGenerator:
|
||||
- name: create-db-configmap
|
||||
files:
|
||||
- create_db.js
|
||||
10
k8s_config/dev/mongodb/pcv.yaml
Normal file
10
k8s_config/dev/mongodb/pcv.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: mongodb
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
11
k8s_config/dev/mongodb/service.yaml
Normal file
11
k8s_config/dev/mongodb/service.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mongodb
|
||||
spec:
|
||||
clusterIP: None
|
||||
selector:
|
||||
app: mongodb
|
||||
ports:
|
||||
- port: 27017
|
||||
targetPort: 27017
|
||||
40
k8s_config/dev/mongodb/statefulset.yaml
Normal file
40
k8s_config/dev/mongodb/statefulset.yaml
Normal file
@@ -0,0 +1,40 @@
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: mongodb
|
||||
spec:
|
||||
serviceName: mongodb
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mongodb
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mongodb
|
||||
spec:
|
||||
containers:
|
||||
- name: mongodb
|
||||
image: mongo:latest
|
||||
ports:
|
||||
- containerPort: 27017
|
||||
volumeMounts:
|
||||
- name: mongodb-data
|
||||
mountPath: /data/db
|
||||
- name: "init-database"
|
||||
mountPath: "/docker-entrypoint-initdb.d/"
|
||||
env:
|
||||
- name: MONGO_INITDB_DATABASE
|
||||
value: coopgo_platform
|
||||
volumes:
|
||||
- name: "init-database"
|
||||
configMap:
|
||||
name: create-db-configmap
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: mongodb-data
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
Reference in New Issue
Block a user