From 464ca3ad96917571a41da5f5e6e4f829f9c2e024 Mon Sep 17 00:00:00 2001 From: Maarten de Waard <maarten@greenhost.nl> Date: Wed, 8 Sep 2021 15:14:32 +0200 Subject: [PATCH] take monitoring out of base and make it an optional component, adjust CI accordingly --- .gitlab-ci.yml | 118 +++++++++--------- docs/design.md | 6 +- docs/installation/install_oas.rst | 3 +- .../monitoring}/monitoring.yaml | 0 4 files changed, 66 insertions(+), 61 deletions(-) rename flux2/cluster/{base => optional/monitoring}/monitoring.yaml (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c8c9035c1..c031b98d5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -73,17 +73,36 @@ include: # # Gitlab CI allows pushing CI vars via `git push` but a bug prevents this when # using merge request pipelines (see https://gitlab.com/gitlab-org/gitlab/-/issues/326098) + +.monitoring_rules: + rules: + - changes: + - flux2/apps/$RESOURCE/*.yaml + - flux2/cluster/optional/$RESOURCE/*.yaml + - flux2/infrastructure/sources/grafana.yaml + - flux2/infrastructure/sources/helm-stable.yaml + - flux2/infrastructure/sources/prometheus-community.yaml + - install/install-app.sh + - test/taiko/* + - if: '$TRIGGER_JOBS =~ /enable-monitoring/' + - if: '$CI_COMMIT_MESSAGE =~ /TRIGGER_JOBS=.*enable-monitoring/' + - if: '$CI_COMMIT_BRANCH == "master"' + .eventrouter_rules: extends: - - .general_rules + - .monitoring_rules .loki_rules: extends: - - .general_rules + - .monitoring_rules .promtail_rules: extends: - - .general_rules + - .monitoring_rules + +.kube_prometheus_stack_rules: + extends: + - .monitoring_rules .nextcloud_rules: rules: @@ -97,10 +116,6 @@ include: - if: '$CI_COMMIT_MESSAGE =~ /TRIGGER_JOBS=.*enable-nextcloud/' - if: '$CI_COMMIT_BRANCH == "master"' -.kube_prometheus_stack_rules: - extends: - - .general_rules - .cert_manager_rules: extends: - .general_rules @@ -326,10 +341,6 @@ setup-openappstack: - kubectl create namespace flux-system - kubectl apply -k ${CLUSTER_DIR} - bash ./install/install-openappstack.sh - # TODO: Should also be removed or made up-to-date - # Show versions of installed apps/binaries - # - cd ansible - # - ansible master -m shell -a 'oas-version-info.sh 2>&1' extends: - .ssh_setup - .report_artifacts @@ -368,19 +379,6 @@ infrastructure-kustomizations-ready: extends: - .kustomization-ready -monitoring-kustomizations-ready: - variables: - RESOURCE: "monitoring" - extends: - - .kustomization-ready - -openappstack-kustomizations-ready: - variables: - RESOURCE: "openappstack" - extends: - - .kustomization-ready - - .helm-release: script: - *debug_information @@ -416,14 +414,6 @@ cert-manager-helm-release: - .base-helm-release - .cert_manager_rules -eventrouter-helm-release: - variables: - RESOURCE: "eventrouter" - NAMESPACE: "oas" - extends: - - .base-helm-release - - .eventrouter_rules - local-path-provisioner-helm-release: variables: RESOURCE: "local-path-provisioner" @@ -432,30 +422,6 @@ local-path-provisioner-helm-release: - .base-helm-release - .local_path_provisioner_rules -loki-helm-release: - variables: - RESOURCE: "loki" - NAMESPACE: "oas" - extends: - - .base-helm-release - - .loki_rules - -promtail-helm-release: - variables: - RESOURCE: "promtail" - NAMESPACE: "oas" - extends: - - .base-helm-release - - .promtail_rules - -kube-prometheus-stack-helm-release: - variables: - RESOURCE: "kube-prometheus-stack" - NAMESPACE: "oas" - extends: - - .base-helm-release - - .kube_prometheus_stack_rules - single-sign-on-helm-release: variables: RESOURCE: "single-sign-on" @@ -480,6 +446,13 @@ single-sign-on-helm-release: - .ssh_setup interruptible: true +enable-monitoring: + variables: + RESOURCE: "monitoring" + extends: + - .enable_app_template + - .monitoring_rules + enable-nextcloud: variables: RESOURCE: "nextcloud" @@ -519,6 +492,30 @@ enable-wordpress: - .helm-release interruptible: true +eventrouter-helm-release: + variables: + RESOURCE: "eventrouter" + NAMESPACE: "oas" + extends: + - .apps-helm-release + - .eventrouter_rules + +kube-prometheus-stack-helm-release: + variables: + RESOURCE: "kube-prometheus-stack" + NAMESPACE: "oas" + extends: + - .apps-helm-release + - .kube_prometheus_stack_rules + +loki-helm-release: + variables: + RESOURCE: "loki" + NAMESPACE: "oas" + extends: + - .apps-helm-release + - .loki_rules + nextcloud-helm-release: variables: RESOURCE: "nextcloud" @@ -534,6 +531,14 @@ nextcloud-helm-release: - .apps-helm-release - .nextcloud_rules +promtail-helm-release: + variables: + RESOURCE: "promtail" + NAMESPACE: "oas" + extends: + - .apps-helm-release + - .promtail_rules + rocketchat-helm-release: variables: RESOURCE: "rocketchat" @@ -579,7 +584,6 @@ wordpress-helm-release: - .apps-helm-release - .wordpress_rules - # Stage: apps-ready # ====================== # diff --git a/docs/design.md b/docs/design.md index 8edfd1baf..7058d8f03 100644 --- a/docs/design.md +++ b/docs/design.md @@ -103,9 +103,9 @@ inside the containers). However, it is possible to mount persistent volumes to specific directories in the container, basically adding a persistent layer on top of the containerised application. To provide this in OAS's simple setup, we use a [local storage -provisioner](https://github.com/greenhost/local-path-provisioner) that -automatically provides persistent data on the VPS running OAS to an application -that requests it. +provisioner](https://open.greenhost.net/openappstack/local-path-provisioner) +that automatically provides persistent data on the VPS running OAS to an +application that requests it. ## Automatic updates diff --git a/docs/installation/install_oas.rst b/docs/installation/install_oas.rst index f0ad750d0..9c83cb79a 100644 --- a/docs/installation/install_oas.rst +++ b/docs/installation/install_oas.rst @@ -169,7 +169,7 @@ Next, run: This installs the *core* of OpenAppStack into your ``k3s`` cluster. To see what's included, check the ``flux2/infrastructure`` and the ``flux2/core`` -folders. In addition, it sets up Prometheus and Grafana to monitor your cluster. +folders. .. _additional_apps: @@ -180,6 +180,7 @@ After the script completes, you can install applications by running the other installation scripts in the ``install`` folder. At the moment, we have scripts to install: +- Monitoring stack (Prometheus, Grafana, Loki, Eventrouter) ``./install/install-app.sh monitoring`` - Nextcloud and Onlyoffice with ``./install/install-app.sh nextcloud`` - Rocket.Chat with ``./install/install-app.sh rocketchat`` - Wekan with ``./install/install-app.sh wekan`` diff --git a/flux2/cluster/base/monitoring.yaml b/flux2/cluster/optional/monitoring/monitoring.yaml similarity index 100% rename from flux2/cluster/base/monitoring.yaml rename to flux2/cluster/optional/monitoring/monitoring.yaml -- GitLab