Use common monitoring

merge-requests/6/head
bom 1 year ago
parent e74280bf78
commit d6ab7c555a

@ -45,15 +45,17 @@ output "ipv4" {
## k8s minicluster ## k8s minicluster
For k8s installation we use our [dda-k8s-crate](https://github.com/DomainDrivenArchitecture/dda-k8s-crate) with the following configuation: For k8s installation we use our [provs](https://repo.prod.meissa.de/meissa/provs) with the following configuation:
``` ```
{:user :k8s postgres-db-user: "nextcloud"
:k8s {:external-ip "ip-from-above"} postgres-db-password: "nextcloud-db-password"
:cert-manager :letsencrypt-prod-issuer nextcloud-admin-user: "cloudadmin"
:persistent-dirs ["cloud", "postgres"] nextcloud-admin-password: "cloudpassword"
} aws-access-key-id: "aws-id"
aws-secret-access-key: "aws-secret"
restic-password: "restic-password"
``` ```
## kubectl apply c4k-nextcloud ## kubectl apply c4k-nextcloud

@ -8,7 +8,8 @@
[dda.c4k-common.yaml :as yaml] [dda.c4k-common.yaml :as yaml]
[dda.c4k-common.postgres :as postgres] [dda.c4k-common.postgres :as postgres]
[dda.c4k-nextcloud.nextcloud :as nextcloud] [dda.c4k-nextcloud.nextcloud :as nextcloud]
[dda.c4k-nextcloud.backup :as backup])) [dda.c4k-nextcloud.backup :as backup]
[dda.c4k-common.monitoring :as mon]))
(def default-storage-class :local-path) (def default-storage-class :local-path)
@ -35,4 +36,6 @@
[(backup/generate-config config) [(backup/generate-config config)
(backup/generate-secret auth) (backup/generate-secret auth)
(backup/generate-cron) (backup/generate-cron)
(backup/generate-backup-restore-deployment config)])))) (backup/generate-backup-restore-deployment config)])
(when (:contains? config :mon-cfg)
(mon/generate (:mon-cfg config) (:mon-auth auth))))))

@ -9,7 +9,8 @@
[dda.c4k-common.base64 :as b64] [dda.c4k-common.base64 :as b64]
[dda.c4k-common.predicate :as cp] [dda.c4k-common.predicate :as cp]
[dda.c4k-common.postgres :as postgres] [dda.c4k-common.postgres :as postgres]
[dda.c4k-common.common :as cm])) [dda.c4k-common.common :as cm]
[dda.c4k-common.monitoring :as mon]))
(s/def ::fqdn cp/fqdn-string?) (s/def ::fqdn cp/fqdn-string?)
(s/def ::issuer cp/letsencrypt-issuer?) (s/def ::issuer cp/letsencrypt-issuer?)
@ -27,12 +28,14 @@
:opt-un [::issuer :opt-un [::issuer
::restic-repository ::restic-repository
::pv-storage-size-gb ::pv-storage-size-gb
::pvc-storage-class-name])) ::pvc-storage-class-name
::mon/mon-cfg]))
(def auth? (s/keys :req-un [::postgres/postgres-db-user ::postgres/postgres-db-password (def auth? (s/keys :req-un [::postgres/postgres-db-user ::postgres/postgres-db-password
::nextcloud-admin-user ::nextcloud-admin-password ::nextcloud-admin-user ::nextcloud-admin-password
::aws-access-key-id ::aws-secret-access-key ::aws-access-key-id ::aws-secret-access-key
::restic-password])) ::restic-password]
:opt-un [::mon/mon-auth]))
#?(:cljs #?(:cljs
(defmethod yaml/load-resource :nextcloud [resource-name] (defmethod yaml/load-resource :nextcloud [resource-name]

@ -4,4 +4,6 @@
:nextcloud-admin-password "cloudpassword" :nextcloud-admin-password "cloudpassword"
:aws-access-key-id "aws-id" :aws-access-key-id "aws-id"
:aws-secret-access-key "aws-secret" :aws-secret-access-key "aws-secret"
:restic-password "restic-password"} :restic-password "restic-password"
:mon-auth {:grafana-cloud-user "user"
:grafana-cloud-password "password"}}

@ -2,4 +2,7 @@
:issuer "staging" :issuer "staging"
:nextcloud-data-volume-path "/var/cloud" :nextcloud-data-volume-path "/var/cloud"
:postgres-data-volume-path "/var/postgres" :postgres-data-volume-path "/var/postgres"
:restic-repository "s3:s3.amazonaws.com/your-bucket/your-folder"} :restic-repository "s3:s3.amazonaws.com/your-bucket/your-folder"
:mon-cfg {:grafana-cloud-url "url-for-your-prom-remote-write-endpoint"
:k3s-cluster-name "jitsi"
:k3s-cluster-stage "test"}}
Loading…
Cancel
Save