Skip to content

Commit

Permalink
Persistent mongo-devicereg
Browse files Browse the repository at this point in the history
Signed-off-by: Mikael Saarinen <[email protected]>
  • Loading branch information
msrn authored and Nindemic committed Jan 31, 2022
1 parent 5f1ae9e commit 1966a08
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 13 deletions.
12 changes: 6 additions & 6 deletions 02_deployHono/modules/hono/main.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# https://github.com/bitnami/azure-marketplace-charts/tree/a2342181bacffa6d27d265db187dcc938af1c3f0/bitnami/mongodb
resource "helm_release" "mongodb" {
name = "mongodb"
# https://github.com/bitnami/charts/tree/ac496766e033c7d068094122164ef318c46fba15/bitnami/mongodb
resource "helm_release" "mongodb-devicereg" {
name = "mongodb-devicereg"

repository = "https://marketplace.azurecr.io/helm/v1/repo"
repository = "https://charts.bitnami.com/bitnami"
chart = "mongodb"
version = "~> 10.7.1"
version = "~> 10.31.3"
cleanup_on_fail = "true"
values = [
file("${path.module}/mongo_values.yaml")
Expand Down Expand Up @@ -32,7 +32,7 @@ resource "helm_release" "hono" {
chart = "hono"
version = "1.9.8"
cleanup_on_fail = "true"
depends_on = [helm_release.mongodb]
depends_on = [helm_release.mongodb-devicereg]
values = [
file("${path.module}/values.yaml")
]
Expand Down
14 changes: 11 additions & 3 deletions 02_deployHono/modules/hono/mongo_values.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
architecture: "standalone"
persistence:
existingClaim: "mongodb-data"
useStatefulSet: true
enabled: true
existingClaim: "mongopvc"
mountPath: /bitnami/mongodb
subPath: device-reg
accessModes: "ReadWriteMany"
#useStatefulSet: true
metrics:
enabled: true
replicaCount: 2
auth:
database: "honodb"
volumePermissions:
enabled: true
service:
nameOverride: "mongodb-devicereg"
port: 27017

#architecture: "standalone"
#useStatefulSet: true
Expand Down
2 changes: 1 addition & 1 deletion 02_deployHono/modules/hono/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ deviceRegistryExample:
addExampleData: false
mongoDBBasedDeviceRegistry:
mongodb:
host: "mongodb"
host: "mongodb-devicereg"
port: 27017
dbName: "honodb"
adapters:
Expand Down
2 changes: 1 addition & 1 deletion 02_deployHono/modules/kafka/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ livenessProbe:
initialDelaySeconds: 700
readinessProbe:
initialDelaySeconds: 20
logsDirs: /bitnami/kafka/data1
logsDirs: /bitnami/kafka/data
persistence:
existingClaim: "kafkapvc"
size: 5Gi
Expand Down
4 changes: 2 additions & 2 deletions 02_deployHono/modules/mongodb/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
architecture: "replicaset"
persistence:
enabled: true
existingClaim: "mongopvc"
enabled: false
# existingClaim: "mongopvc"
useStatefulSet: true
metrics:
enabled: true
Expand Down
6 changes: 6 additions & 0 deletions 02_deployHono/modules/persistent_storage/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ resource "kubernetes_persistent_volume" "mongo_volume" {
access_modes = ["ReadWriteMany"]
storage_class_name = kubernetes_storage_class.azure_file_retain.metadata.0.name
persistent_volume_reclaim_policy = "Retain"
mount_options = ["dir_mode=0777",
"file_mode=0777",
"uid=1001",
"gid=1001",
"mfsymlinks",
"nobrl"]
persistent_volume_source {
azure_file {
secret_name = kubernetes_secret.storage_secret.metadata.0.name
Expand Down

0 comments on commit 1966a08

Please sign in to comment.