Files
platform/charts/prometheus/deploy.sh
2020-11-06 15:46:25 +01:00

42 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
TOP="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
crd_version="v0.42.0"
namespace=prometheus
charts=(
grafana-smtp-secret.yaml
etcd-cert-secret.yaml
prometheus-etcd-cert.yaml
app-servicemonitor.yaml
gitlab-redis-servicemonitor.yaml
gitlab-servicemonitor.yaml
ingress-nginx-servicemonitor.yaml
)
install_prometheus_crds () {
crds=(
monitoring.coreos.com_alertmanagers.yaml
monitoring.coreos.com_podmonitors.yaml
monitoring.coreos.com_probes.yaml
monitoring.coreos.com_prometheuses.yaml
monitoring.coreos.com_prometheusrules.yaml
monitoring.coreos.com_servicemonitors.yaml
monitoring.coreos.com_thanosrulers.yaml
)
url=https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/$crd_version/example/prometheus-operator-crd/
for i in ${crds[@]}; do
kubectl apply -f $url/$i
done
}
cd $TOP
. ../config.sh
install_prometheus_crds
kubectl_apply_files $namespace "${charts[@]}"
helm_apply $namespace prometheus prometheus-community/kube-prometheus-stack