Fix kube_apply_* and update deploy scripts

This commit is contained in:
Jonas Juselius
2020-11-06 10:17:11 +01:00
parent 073d447455
commit 88b4b7315e
14 changed files with 60 additions and 96 deletions

View File

@@ -4,20 +4,17 @@ crd_version="v0.42.0"
namespace=prometheus
charts=(
etcd-cert-secret.yaml
app-servicemonitor.yaml
grafana-ldap-toml.yaml
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
)
. ../config.sh
install_prometheus_crds () {
crd=(
crds=(
monitoring.coreos.com_alertmanagers.yaml
monitoring.coreos.com_podmonitors.yaml
monitoring.coreos.com_probes.yaml
@@ -26,32 +23,19 @@ install_prometheus_crds () {
monitoring.coreos.com_servicemonitors.yaml
monitoring.coreos.com_thanosrulers.yaml
)
url=https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.42.0/example/prometheus-operator-crd/
for i in ${crd[@]}; do
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
}
disable_unset () {
read yaml
# disable ldap for grafana
[ -z "$grafana_ldap_toml" ] && \
echo "$yaml" | sed '/auth\.ldap:/,+1 s/true/false/; /ldap:/,+1 d' | read yaml
# disable storage
[ -z "$fileserver" ] && \
echo "$yaml" | sed '/prometheusSpec:/,+10d' $1 | read yaml
echo $yaml
}
kubectl create ns $namespace
. ../config.sh
install_prometheus_crds
kubectl_apply $namespace "${charts[@]}"
kubectl_apply_files $namespace "${charts[@]}"
helm template \
-n $namespace \
-f values.yaml \
prometheus \
prometheus-community/kube-prometheus-stack \
| make_substitutions \
| kubectl -n $namespace -f -
-n $namespace \
-f values.yaml \
prometheus \
prometheus-community/kube-prometheus-stack \
| kubectl_apply $namespace