This commit is contained in:
2023-08-11 12:48:32 +02:00
parent 0aca51fcfc
commit 3875aff2b2
16 changed files with 523 additions and 147 deletions

View File

@@ -41,6 +41,25 @@ resource "kubectl_manifest" "prj_mongo" {
members: 1
type: ReplicaSet
version: "4.4.0"
podSpec:
podTemplate:
spec:
containers:
- name: mongod
env:
- name: MONGODB_NAME
value: ${var.component}
- name: MONGODB_USER
value: ${var.component}
- name: MONGODB_PASSWORD
valueFrom:
secretKeyRef:
name: "${var.instance}-${var.component}-mongo"
key: password
metadata:
annotations:
"k8up.io/backupcommand": "sh -c 'mongodump --username=$MONGODB_USER --password=$MONGODB_PASSWORD mongodb://localhost/$MONGODB_NAME --archive'"
"k8up.io/file-extension": ".archive"
security:
authentication:
modes: ["SCRAM"]