@@ -45,6 +45,17 @@ helm repo add prometheus-community https://prometheus-community.github.io/helm-c
4545helm repo update
4646echo -e " ${GREEN} ✓ Helm repositories added${NC} "
4747
48+ echo -e " \n${GREEN} ========================================${NC} "
49+ echo -e " ${GREEN} Installing Components (Parallel)${NC} "
50+ echo -e " ${GREEN} ========================================${NC} "
51+ echo -e " The following will be installed:"
52+ echo -e " • cert-manager"
53+ echo -e " • OpenTelemetry Operator"
54+ echo -e " • Prometheus & Grafana"
55+ echo -e " • OpenTelemetry Collector"
56+ echo -e " • Service Monitors"
57+ echo -e " \n${YELLOW} All resources will be applied first, then we'll wait for them to become ready.${NC} \n"
58+
4859# Install cert-manager (required for OpenTelemetry Operator)
4960echo -e " \n${YELLOW} Installing cert-manager...${NC} "
5061if kubectl get namespace cert-manager > /dev/null 2>&1 ; then
5364 kubectl create namespace cert-manager
5465 helm install cert-manager jetstack/cert-manager \
5566 --namespace cert-manager \
56- --set crds.enabled=true \
57- --wait
58- echo -e " ${GREEN} ✓ cert-manager installed${NC} "
67+ --set crds.enabled=true
68+ echo -e " ${GREEN} ✓ cert-manager installation started${NC} "
5969fi
6070
6171# Create observability namespace
@@ -70,15 +80,13 @@ if helm list -n observability | grep -q opentelemetry-operator; then
7080 echo -e " ${YELLOW} OpenTelemetry Operator already installed, upgrading...${NC} "
7181 helm upgrade opentelemetry-operator open-telemetry/opentelemetry-operator \
7282 --namespace observability \
73- --set " manager.collectorImage.repository=otel/opentelemetry-collector-contrib" \
74- --wait
83+ --set " manager.collectorImage.repository=otel/opentelemetry-collector-contrib"
7584else
7685 helm install opentelemetry-operator open-telemetry/opentelemetry-operator \
7786 --namespace observability \
78- --set " manager.collectorImage.repository=otel/opentelemetry-collector-contrib" \
79- --wait
87+ --set " manager.collectorImage.repository=otel/opentelemetry-collector-contrib"
8088fi
81- echo -e " ${GREEN} ✓ OpenTelemetry Operator installed ${NC} "
89+ echo -e " ${GREEN} ✓ OpenTelemetry Operator installation started ${NC} "
8290
8391# Install kube-prometheus-stack (includes Prometheus + Grafana)
8492echo -e " \n${YELLOW} Installing Prometheus and Grafana stack...${NC} "
@@ -88,17 +96,15 @@ if helm list -n observability | grep -q kube-prometheus-stack; then
8896 --namespace observability \
8997 --set prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues=false \
9098 --set prometheus.prometheusSpec.podMonitorSelectorNilUsesHelmValues=false \
91- --set grafana.adminPassword=admin \
92- --wait
99+ --set grafana.adminPassword=admin
93100else
94101 helm install kube-prometheus-stack prometheus-community/kube-prometheus-stack \
95102 --namespace observability \
96103 --set prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues=false \
97104 --set prometheus.prometheusSpec.podMonitorSelectorNilUsesHelmValues=false \
98- --set grafana.adminPassword=admin \
99- --wait
105+ --set grafana.adminPassword=admin
100106fi
101- echo -e " ${GREEN} ✓ Prometheus and Grafana installed ${NC} "
107+ echo -e " ${GREEN} ✓ Prometheus and Grafana installation started ${NC} "
102108
103109# Create OpenTelemetry Collector instance
104110echo -e " \n${YELLOW} Creating OpenTelemetry Collector...${NC} "
195201echo -e " ${GREEN} ✓ ServiceMonitor created${NC} "
196202
197203# Wait for all pods to be ready
198- echo -e " \n${YELLOW} Waiting for all pods to be ready...${NC} "
204+ echo -e " \n${GREEN} ========================================${NC} "
205+ echo -e " ${GREEN} All resources have been applied!${NC} "
206+ echo -e " ${GREEN} ========================================${NC} "
207+ echo -e " \n${YELLOW} Waiting for all pods to become ready (this may take 2-3 minutes)...${NC} "
208+
209+ # Wait for cert-manager pods
210+ echo -e " ${YELLOW} Checking cert-manager pods...${NC} "
211+ kubectl wait --for=condition=ready pod --all -n cert-manager --timeout=300s 2> /dev/null || echo -e " ${YELLOW} cert-manager already running or skipped${NC} "
212+
213+ # Wait for observability pods
214+ echo -e " ${YELLOW} Checking observability pods...${NC} "
199215kubectl wait --for=condition=ready pod --all -n observability --timeout=300s
216+
200217echo -e " ${GREEN} ✓ All pods are ready${NC} "
201218
202219# Import Grafana dashboards
0 commit comments