--- apiVersion: apps/v1 kind: Deployment metadata: name: prometheus namespace: telecom-monitoring labels: app: prometheus component: monitoring spec: replicas: 1 selector: matchLabels: app: prometheus template: metadata: labels: app: prometheus component: monitoring spec: containers: - name: prometheus image: prom/prometheus:v2.45.0 ports: - containerPort: 9090 name: http command: - /bin/prometheus - --config.file=/etc/prometheus/prometheus.yml - --storage.tsdb.path=/prometheus - --storage.tsdb.retention.time=30d - --web.console.libraries=/etc/prometheus/console_libraries - --web.console.templates=/etc/prometheus/consoles - --web.enable-lifecycle volumeMounts: - name: prometheus-config mountPath: /etc/prometheus - name: prometheus-storage mountPath: /prometheus resources: requests: memory: "512Mi" cpu: "500m" limits: memory: "1Gi" cpu: "1000m" livenessProbe: httpGet: path: /-/healthy port: 9090 initialDelaySeconds: 30 periodSeconds: 10 readinessProbe: httpGet: path: /-/ready port: 9090 initialDelaySeconds: 5 periodSeconds: 5 volumes: - name: prometheus-config configMap: name: prometheus-config - name: prometheus-storage persistentVolumeClaim: claimName: prometheus-storage --- apiVersion: v1 kind: Service metadata: name: prometheus namespace: telecom-monitoring labels: app: prometheus spec: selector: app: prometheus ports: - name: http port: 9090 targetPort: 9090 type: ClusterIP --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: prometheus-storage namespace: telecom-monitoring spec: accessModes: - ReadWriteOnce resources: requests: storage: 20Gi --- apiVersion: apps/v1 kind: Deployment metadata: name: grafana namespace: telecom-monitoring labels: app: grafana component: monitoring spec: replicas: 1 selector: matchLabels: app: grafana template: metadata: labels: app: grafana component: monitoring spec: containers: - name: grafana image: grafana/grafana:10.2.0 ports: - containerPort: 3000 name: http env: - name: GF_SECURITY_ADMIN_USER valueFrom: configMapKeyRef: name: grafana-config key: GF_SECURITY_ADMIN_USER - name: GF_SECURITY_ADMIN_PASSWORD valueFrom: secretKeyRef: name: grafana-secret key: GF_SECURITY_ADMIN_PASSWORD - name: GF_INSTALL_PLUGINS valueFrom: configMapKeyRef: name: grafana-config key: GF_INSTALL_PLUGINS - name: GF_FEATURE_TOGGLES_ENABLE valueFrom: configMapKeyRef: name: grafana-config key: GF_FEATURE_TOGGLES_ENABLE - name: GF_SECURITY_ADMIN_USER valueFrom: configMapKeyRef: name: grafana-config key: GF_SECURITY_ADMIN_USER volumeMounts: - name: grafana-storage mountPath: /var/lib/grafana - name: grafana-config mountPath: /etc/grafana/provisioning - name: grafana-dashboards mountPath: /var/lib/grafana/dashboards resources: requests: memory: "256Mi" cpu: "250m" limits: memory: "512Mi" cpu: "500m" livenessProbe: httpGet: path: /api/health port: 3000 initialDelaySeconds: 30 periodSeconds: 10 readinessProbe: httpGet: path: /api/health port: 3000 initialDelaySeconds: 5 periodSeconds: 5 volumes: - name: grafana-storage persistentVolumeClaim: claimName: grafana-storage - name: grafana-config configMap: name: grafana-provisioning - name: grafana-dashboards configMap: name: grafana-dashboards --- apiVersion: v1 kind: Service metadata: name: grafana namespace: telecom-monitoring labels: app: grafana spec: selector: app: grafana ports: - name: http port: 3000 targetPort: 3000 type: ClusterIP --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: grafana-storage namespace: telecom-monitoring spec: accessModes: - ReadWriteOnce resources: requests: storage: 10Gi --- apiVersion: apps/v1 kind: Deployment metadata: name: influxdb namespace: telecom-monitoring labels: app: influxdb component: monitoring spec: replicas: 1 selector: matchLabels: app: influxdb template: metadata: labels: app: influxdb component: monitoring spec: containers: - name: influxdb image: influxdb:2.7 ports: - containerPort: 8086 name: http env: - name: DOCKER_INFLUXDB_INIT_MODE value: "setup" - name: DOCKER_INFLUXDB_INIT_USERNAME valueFrom: secretKeyRef: name: influxdb-secret key: INFLUXDB_ADMIN_USER - name: DOCKER_INFLUXDB_INIT_PASSWORD valueFrom: secretKeyRef: name: influxdb-secret key: INFLUXDB_ADMIN_PASSWORD - name: DOCKER_INFLUXDB_INIT_ORG value: "telecom" - name: DOCKER_INFLUXDB_INIT_BUCKET value: "telecom" - name: DOCKER_INFLUXDB_INIT_ADMIN_TOKEN valueFrom: secretKeyRef: name: influxdb-secret key: INFLUXDB_ADMIN_TOKEN volumeMounts: - name: influxdb-storage mountPath: /var/lib/influxdb2 resources: requests: memory: "512Mi" cpu: "500m" limits: memory: "1Gi" cpu: "1000m" livenessProbe: httpGet: path: /health port: 8086 initialDelaySeconds: 30 periodSeconds: 10 readinessProbe: httpGet: path: /health port: 8086 initialDelaySeconds: 5 periodSeconds: 5 volumes: - name: influxdb-storage persistentVolumeClaim: claimName: influxdb-storage --- apiVersion: v1 kind: Service metadata: name: influxdb-service namespace: telecom-monitoring labels: app: influxdb spec: selector: app: influxdb ports: - name: http port: 8086 targetPort: 8086 type: ClusterIP --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: influxdb-storage namespace: telecom-monitoring spec: accessModes: - ReadWriteOnce resources: requests: storage: 20Gi --- apiVersion: apps/v1 kind: Deployment metadata: name: alertmanager namespace: telecom-monitoring labels: app: alertmanager component: monitoring spec: replicas: 1 selector: matchLabels: app: alertmanager template: metadata: labels: app: alertmanager component: monitoring spec: containers: - name: alertmanager image: prom/alertmanager:v0.25.0 ports: - containerPort: 9093 name: http command: - /bin/alertmanager - --config.file=/etc/alertmanager/alertmanager.yml - --storage.path=/alertmanager - --web.external-url=http://alertmanager:9093 volumeMounts: - name: alertmanager-config mountPath: /etc/alertmanager - name: alertmanager-storage mountPath: /alertmanager resources: requests: memory: "128Mi" cpu: "100m" limits: memory: "256Mi" cpu: "200m" livenessProbe: httpGet: path: /-/healthy port: 9093 initialDelaySeconds: 30 periodSeconds: 10 readinessProbe: httpGet: path: /-/ready port: 9093 initialDelaySeconds: 5 periodSeconds: 5 volumes: - name: alertmanager-config configMap: name: alertmanager-config - name: alertmanager-storage persistentVolumeClaim: claimName: alertmanager-storage --- apiVersion: v1 kind: Service metadata: name: alertmanager namespace: telecom-monitoring labels: app: alertmanager spec: selector: app: alertmanager ports: - name: http port: 9093 targetPort: 9093 type: ClusterIP --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: alertmanager-storage namespace: telecom-monitoring spec: accessModes: - ReadWriteOnce resources: requests: storage: 5Gi --- apiVersion: apps/v1 kind: Deployment metadata: name: node-exporter namespace: telecom-monitoring labels: app: node-exporter component: monitoring spec: replicas: 1 selector: matchLabels: app: node-exporter template: metadata: labels: app: node-exporter component: monitoring spec: containers: - name: node-exporter image: prom/node-exporter:v1.6.1 ports: - containerPort: 9100 name: http command: - /bin/node_exporter - --path.procfs=/host/proc - --path.rootfs=/rootfs - --path.sysfs=/host/sys - --collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/) volumeMounts: - name: proc mountPath: /host/proc - name: sys mountPath: /host/sys - name: root mountPath: /rootfs readOnly: true resources: requests: memory: "64Mi" cpu: "50m" limits: memory: "128Mi" cpu: "100m" volumes: - name: proc hostPath: path: /proc - name: sys hostPath: path: /sys - name: root hostPath: path: / --- apiVersion: v1 kind: Service metadata: name: node-exporter namespace: telecom-monitoring labels: app: node-exporter spec: selector: app: node-exporter ports: - name: http port: 9100 targetPort: 9100 type: ClusterIP