Skip to content

Commit

Permalink
Merge pull request #1711 from GiganticMinecraft/add_growi_components
Browse files Browse the repository at this point in the history
fix hacknmd
  • Loading branch information
outductor authored Jan 13, 2024
2 parents 8277f55 + 754eba7 commit 1ad3325
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
apiVersion: mariadb.mmontes.io/v1alpha1
kind: MariaDB
metadata:
namespace: growi-system
name: hackmd-mariadb
spec:
rootPasswordSecretKeyRef:
name: hackmd-mariadb
key: root-password

database: hackmd
username: hackmd
passwordSecretKeyRef:
name: hackmd-mariadb
key: hackmd-password

image: mariadb:10.11.6
imagePullPolicy: IfNotPresent

port: 3306

volumeClaimTemplate:
resources:
requests:
storage: 10Gi
storageClassName: synology-iscsi-storage
accessModes:
- ReadWriteOnce

# myCnf: |
# [mariadb]
# innodb_buffer_pool_size = 1G
# innodb_log_file_size = 256M
# innodb_flush_log_at_trx_commit = 2
# innodb_write_io_threads = 8
# innodb_io_capacity = 1000
# max_allowed_packet = 256M

livenessProbe:
exec:
command:
- bash
- -c
- mysql -u root -p"${MARIADB_ROOT_PASSWORD}" -e "SELECT 1;"
initialDelaySeconds: 20
periodSeconds: 10
timeoutSeconds: 5

readinessProbe:
exec:
command:
- bash
- -c
- mysql -u root -p"${MARIADB_ROOT_PASSWORD}" -e "SELECT 1;"
initialDelaySeconds: 20
periodSeconds: 10
timeoutSeconds: 5

metrics:
enabled: true
exporter:
image: prom/mysqld-exporter:v0.15.1
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 300m
memory: 512Mi
serviceMonitor:
prometheusRelease: prometheus
interval: 10s
scrapeTimeout: 10s
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ spec:
value: "false"
- name: GROWI_URI
value: https://wiki.onp-k8s.admin.seichi.click
# - name: CMD_DB_URL
# valueFrom:
# secretKeyRef:
# name: hackmd-mariadb-url
# key: db-url
- name: CMD_DB_URL
valueFrom:
secretKeyRef:
name: hackmd-mariadb
key: db-url
ports:
- name: http
containerPort: 3000
Expand Down
18 changes: 18 additions & 0 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,22 @@ variable "growi_github_sso_client_secret" {
sensitive = true
}

variable "hackmd_mariadb_root_password" {
description = "HackMD MariaDB root password for Growi"
type = string
sensitive = true
}

variable "hackmd_mariadb_hackmd_password" {
description = "HackMD MariaDB hackmd password for Growi"
type = string
sensitive = true
}

variable "hackmd_mariadb_hackmd_db_url" {
description = "HackMD MariaDB hackmd DB URL for Growi"
type = string
sensitive = true
}

#endregion
19 changes: 18 additions & 1 deletion terraform/onp_cluster_secrets.tf
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,26 @@ resource "kubernetes_secret" "growi_github_sso" {
}

data = {
"OAUTH_GITHUB_CLIENT_ID" = var.growi_github_sso_client_id
"OAUTH_GITHUB_CLIENT_ID" = var.growi_github_sso_client_id
"OAUTH_GITHUB_CLIENT_SECRET" = var.growi_github_sso_client_secret
}

type = "Opaque"
}

resource "kubernetes_secret" "hackmd_mariadb" {
depends_on = [kubernetes_namespace.growi_system]

metadata {
name = "hackmd-mariadb"
namespace = "growi-system"
}

data = {
root-password = var.hackmd_mariadb_root_password
hackmd-password = var.hackmd_mariadb_hackmd_password
db-url = var.hackmd_mariadb_hackmd_db_url
}

type = "Opaque"
}

0 comments on commit 1ad3325

Please sign in to comment.