|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Namespace creation |
| 4 | +echo "Creating namespaces..." |
| 5 | +kubectl create namespace monitoring |
| 6 | +kubectl create namespace logging |
| 7 | +kubectl create namespace messaging |
| 8 | +kubectl create namespace database |
| 9 | + |
| 10 | +# Prometheus deployment |
| 11 | +echo "Deploying Prometheus..." |
| 12 | +kubectl apply -f prometheus/prometheus-configmap.yaml -n monitoring |
| 13 | +kubectl apply -f prometheus/k8s/deployment.yaml -n monitoring |
| 14 | +kubectl apply -f prometheus/k8s/service.yaml -n monitoring |
| 15 | + |
| 16 | +# Grafana deployment |
| 17 | +echo "Deploying Grafana..." |
| 18 | +kubectl apply -f grafana/k8s/deployment.yaml -n monitoring |
| 19 | +kubectl apply -f grafana/k8s/service.yaml -n monitoring |
| 20 | +kubectl create configmap grafana-dashboard --from-file=grafana/dashboards/flask-services.json -n monitoring |
| 21 | + |
| 22 | +# Elasticsearch deployment |
| 23 | +echo "Deploying Elasticsearch..." |
| 24 | +kubectl apply -f elasticsearch/k8s/deployment.yaml -n logging |
| 25 | +kubectl apply -f elasticsearch/k8s/service.yaml -n logging |
| 26 | + |
| 27 | +# RabbitMQ deployment |
| 28 | +echo "Deploying RabbitMQ..." |
| 29 | +kubectl apply -f rabbitmq/k8s/deployment.yaml -n messaging |
| 30 | +kubectl apply -f rabbitmq/k8s/service.yaml -n messaging |
| 31 | + |
| 32 | +# PostgreSQL deployment |
| 33 | +echo "Deploying PostgreSQL..." |
| 34 | +kubectl apply -f postgres/k8s/deployment.yaml -n database |
| 35 | +kubectl apply -f postgres/k8s/service.yaml -n database |
| 36 | + |
| 37 | +# Verify deployments |
| 38 | +echo "Deployment complete. Verifying resources..." |
| 39 | +kubectl get pods -n monitoring |
| 40 | +kubectl get pods -n logging |
| 41 | +kubectl get pods -n messaging |
| 42 | +kubectl get pods -n database |
| 43 | +kubectl get services -A |
0 commit comments