-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
38 lines (34 loc) · 1.7 KB
/
setup.sh
File metadata and controls
38 lines (34 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
VMETRICS_NAMESAPACE="vmetrics"
VLOGS_NAMESPACE="victorialogs"
TESTING_NAMESPACES="zerotesting zerotesting-dst zerotesting-nimlibp2p"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
VMETRICS_VALUES_FILE="$SCRIPT_DIR/vmetrics.values.yaml"
VLOGS_VALUES_FILE="$SCRIPT_DIR/vlogs.values.yaml"
CERT_DIR="$SCRIPT_DIR/certs"
# Restart Traefik to apply the new sysctl settings
echo "[INFO] Waiting for Traefik deployment to be ready..."
kubectl -n kube-system rollout status deployment/traefik
echo "[INFO] Restarting Traefik deployment..."
kubectl -n kube-system rollout restart deployment/traefik
echo "[INFO] Restarting svclb-traefik pods..."
kubectl -n kube-system delete pod -l svccontroller.k3s.cattle.io/svcname=traefik || true
echo "[INFO] Waiting for Traefik to come back..."
kubectl -n kube-system rollout status deployment/traefik
# Deploy Victoria Metrics using Helm
echo "[INFO] Deploying Victoria Metrics with values file: ${VMETRICS_VALUES_FILE}"
helm repo add vm https://victoriametrics.github.io/helm-charts/
helm repo update
kubectl create namespace "${VMETRICS_NAMESAPACE}" || true
# Create testing namespaces
for ns in ${TESTING_NAMESPACES}; do
kubectl create namespace "${ns}" || true
done
# Create ConfigMap for imported grafana dashboards
kubectl apply -f imported_dashboards/ -n ${VMETRICS_NAMESAPACE} || true
# Install Victoria Metrics Helm chart
helm install vmks vm/victoria-metrics-k8s-stack -f ${VMETRICS_VALUES_FILE} -n ${VMETRICS_NAMESAPACE} --debug
# Deploy Vicoria Logs using Helm
echo "[INFO] Deploying Victoria Logs with values file: ${VLOGS_VALUES_FILE}"
kubectl create namespace "${VLOGS_NAMESPACE}" || true
helm install vls vm/victoria-logs-single -f ${VLOGS_VALUES_FILE} -n ${VLOGS_NAMESPACE} --debug