Treasuremap Monitoring composite

This change adds a function for deploying banzaicloud/thanos-operator,
a composite which deploys grafana and a thanos querier,
and a phase documents for running this composite in the target cluster

This change includes a couple of thanos operator CRs, located in
function/lma-configs, which can be applied by running the phase
lma-configs

Change-Id: I406b45373b6029b2503e11883bb6aa91ebbac481
changes/09/770709/16
Steven Fitzpatrick 2 years ago
parent 8674bb5a92
commit 7aef5fe7a7
  1. 6
      manifests/composite/lma-infra/patches/kube-prometheus-stack.yaml
  2. 3
      manifests/composite/monitoring-stack/README.md
  3. 9
      manifests/composite/monitoring-stack/kustomization.yaml
  4. 36
      manifests/composite/monitoring-stack/patches/grafana.yaml
  5. 7
      manifests/composite/monitoring-stack/patches/thanos-operator.yaml
  6. 1
      manifests/function/lma-configs/alerting/kustomization.yaml
  7. 6
      manifests/function/lma-configs/kustomization.yaml
  8. 1
      manifests/function/lma-configs/logging/kustomization.yaml
  9. 2
      manifests/function/lma-configs/monitoring/kustomization.yaml
  10. 3
      manifests/function/lma-configs/monitoring/thanos/kustomization.yaml
  11. 9
      manifests/function/lma-configs/monitoring/thanos/lma-infra-thanos.yaml
  12. 10
      manifests/function/lma-configs/monitoring/thanos/store-endpoints/lma-infra-prometheus.yaml
  13. 21
      manifests/function/thanos-operator/helmrelease.yaml
  14. 7
      manifests/function/thanos-operator/helmrepository.yaml
  15. 3
      manifests/function/thanos-operator/kustomization.yaml
  16. 4
      manifests/site/test-site/target/lma-configs/kustomization.yaml
  17. 4
      manifests/site/test-site/target/lma-stack/kustomization.yaml
  18. 26
      manifests/type/airship-core/phases/lma-infra-target.yaml
  19. 1
      manifests/type/airship-core/target/workload/kustomization.yaml
  20. 21
      tools/deployment/40_deploy_lma.sh

@ -14,6 +14,12 @@ spec:
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
podMetadata:
labels:
storeAPI: enabled
thanos:
image: quay.io/thanos/thanos:v0.17.2
version: v0.17.2
prometheusOperator:
admissionWebhooks:

@ -0,0 +1,3 @@
# Monitoring Stack
This composite deploys the thanos-operator and grafana charts to allow for monitoring multiple prometheus instances

@ -0,0 +1,9 @@
resources:
- ../../function/grafana
- ../../function/thanos-operator
namespace: lma-infra
patches:
- path: patches/grafana.yaml
- path: patches/thanos-operator.yaml

@ -0,0 +1,36 @@
apiVersion: "helm.toolkit.fluxcd.io/v2beta1"
kind: HelmRelease
metadata:
name: grafana
spec:
values:
adminUser: admin
adminPassword: changeme
defaultDashboardsEnabled: true
datasources:
datasources.yaml:
apiVersion: 1
datasources:
- name: lma-infra-thanos
type: prometheus
url: lma-infra-thanos-query.lma-infra.svc.cluster.local:10902
dashboardProviders:
dashboardproviders.yaml:
apiVersion: 1
providers:
- name: default
orgId: 1
type: file
disableDeletion: false
options:
path: /var/lib/grafana/dashboards/default
dashboards:
default:
logging:
gnetId: 7752
revision: 4
datasource: lma-infra-thanos
minio:
gnetId: 13502
revision: 4
datasource: lma-infra-thanos

@ -0,0 +1,7 @@
apiVersion: "helm.toolkit.fluxcd.io/v2beta1"
kind: HelmRelease
metadata:
name: thanos-operator
data:
values:
nameOverride: lma-infra-thanos

@ -0,0 +1,6 @@
resources:
- logging
- monitoring
- alerting
namespace: lma-infra

@ -0,0 +1,3 @@
resources:
- lma-infra-thanos.yaml
- store-endpoints/lma-infra-prometheus.yaml

@ -0,0 +1,9 @@
apiVersion: monitoring.banzaicloud.io/v1alpha1
kind: Thanos
metadata:
name: lma-infra-thanos
spec:
queryDiscovery: true
query: {}
rule: {}
storeGateway: {}

@ -0,0 +1,10 @@
apiVersion: monitoring.banzaicloud.io/v1alpha1
kind: StoreEndpoint
metadata:
name: lma-infra-prometheus
spec:
thanos: lma-infra-thanos
selector:
labels:
app: prometheus
storeAPI: enabled

@ -0,0 +1,21 @@
apiVersion: "helm.toolkit.fluxcd.io/v2beta1"
kind: HelmRelease
metadata:
name: thanos-operator
spec:
releaseName: thanos-operator
interval: 5m
chart:
spec:
chart: thanos-operator
sourceRef:
kind: HelmRepository
name: banzaicloud
version: 0.1.0
interval: 1m
wait: false
timeout: 5m
# Reference values at
# https://github.com/banzaicloud/thanos-operator/blob/master/charts/thanos-operator/values.yaml
values:
manageCrds: false

@ -0,0 +1,7 @@
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: HelmRepository
metadata:
name: banzaicloud
spec:
url: https://kubernetes-charts.banzaicloud.com
interval: 10m

@ -0,0 +1,3 @@
resources:
- helmrelease.yaml
- helmrepository.yaml

@ -0,0 +1,4 @@
resources:
- ../../../../function/lma-configs
namespace: lma-infra

@ -0,0 +1,4 @@
resources:
- ../../../../composite/monitoring-stack
namespace: lma-infra

@ -1,7 +1,7 @@
apiVersion: airshipit.org/v1alpha1
kind: Phase
metadata:
name: lma-infra-target
name: lma-infra
clusterName: target-cluster
config:
executorRef:
@ -9,3 +9,27 @@ config:
kind: KubernetesApply
name: kubernetes-apply
documentEntryPoint: target/lma-infra
---
apiVersion: airshipit.org/v1alpha1
kind: Phase
metadata:
name: lma-stack
clusterName: target-cluster
config:
executorRef:
apiVersion: airshipit.org/v1alpha1
kind: KubernetesApply
name: kubernetes-apply
documentEntryPoint: target/lma-stack
---
apiVersion: airshipit.org/v1alpha1
kind: Phase
metadata:
name: lma-configs
clusterName: target-cluster
config:
executorRef:
apiVersion: airshipit.org/v1alpha1
kind: KubernetesApply
name: kubernetes-apply
documentEntryPoint: target/lma-configs

@ -1,5 +1,6 @@
resources:
- ../../../../../../airshipctl/manifests/function/airshipctl-base-catalogues
- ../../../../../../airshipctl/manifests/type/gating/target/workload
transformers:
- ../../../../../../airshipctl/manifests/type/gating/target/workload/ingress/replacements

@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -xe
echo "Deploying LMA stack"
airshipctl phase run --debug lma-infra
airshipctl phase run --debug lma-stack
airshipctl phase run --debug lma-configs
Loading…
Cancel
Save