From 2ba0c4435e020d2be0cb9f3d036b13f4b4761e09 Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Sun, 29 May 2022 16:09:57 +0300 Subject: [PATCH] Remove deprecated monitoring stack Signed-off-by: Stefan Prodan --- manifests/monitoring/grafana/datasources.yaml | 18 ------ manifests/monitoring/grafana/deployment.yaml | 60 ------------------- .../monitoring/grafana/kustomization.yaml | 14 ----- manifests/monitoring/grafana/providers.yaml | 17 ------ manifests/monitoring/grafana/service.yaml | 16 ----- manifests/monitoring/kustomization.yaml | 6 -- manifests/monitoring/prometheus/account.yaml | 5 -- .../monitoring/prometheus/deployment.yaml | 52 ---------------- .../monitoring/prometheus/kustomization.yaml | 12 ---- .../monitoring/prometheus/prometheus.yml | 52 ---------------- manifests/monitoring/prometheus/rbac.yaml | 32 ---------- manifests/monitoring/prometheus/service.yaml | 12 ---- 12 files changed, 296 deletions(-) delete mode 100644 manifests/monitoring/grafana/datasources.yaml delete mode 100644 manifests/monitoring/grafana/deployment.yaml delete mode 100644 manifests/monitoring/grafana/kustomization.yaml delete mode 100644 manifests/monitoring/grafana/providers.yaml delete mode 100644 manifests/monitoring/grafana/service.yaml delete mode 100644 manifests/monitoring/kustomization.yaml delete mode 100644 manifests/monitoring/prometheus/account.yaml delete mode 100644 manifests/monitoring/prometheus/deployment.yaml delete mode 100644 manifests/monitoring/prometheus/kustomization.yaml delete mode 100644 manifests/monitoring/prometheus/prometheus.yml delete mode 100644 manifests/monitoring/prometheus/rbac.yaml delete mode 100644 manifests/monitoring/prometheus/service.yaml diff --git a/manifests/monitoring/grafana/datasources.yaml b/manifests/monitoring/grafana/datasources.yaml deleted file mode 100644 index f3961d19..00000000 --- a/manifests/monitoring/grafana/datasources.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: grafana-datasources - namespace: flux-system -data: - datasources.yaml: |- - apiVersion: 1 - deleteDatasources: - - name: prometheus - datasources: - - name: prometheus - type: prometheus - access: proxy - url: http://prometheus:9090 - isDefault: true - editable: true - version: 1 diff --git a/manifests/monitoring/grafana/deployment.yaml b/manifests/monitoring/grafana/deployment.yaml deleted file mode 100644 index d53d66b6..00000000 --- a/manifests/monitoring/grafana/deployment.yaml +++ /dev/null @@ -1,60 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: grafana - labels: - app: grafana -spec: - replicas: 1 - selector: - matchLabels: - app: grafana - template: - metadata: - labels: - app: grafana - annotations: - prometheus.io/scrape: 'false' - spec: - containers: - - name: grafana - image: "grafana/grafana:7.5.4" - imagePullPolicy: IfNotPresent - ports: - - name: http - containerPort: 3000 - protocol: TCP - env: - - name: GF_PATHS_PROVISIONING - value: /etc/grafana/provisioning/ - - name: GF_AUTH_BASIC_ENABLED - value: "false" - - name: GF_AUTH_ANONYMOUS_ENABLED - value: "true" - - name: GF_AUTH_ANONYMOUS_ORG_ROLE - value: Admin - - name: GF_USERS_DEFAULT_THEME - value: "light" - volumeMounts: - - name: grafana - mountPath: /var/lib/grafana - - name: dashboards - mountPath: /etc/grafana/dashboards - - name: datasources - mountPath: /etc/grafana/provisioning/datasources - - name: providers - mountPath: /etc/grafana/provisioning/dashboards - resources: - {} - volumes: - - name: grafana - emptyDir: {} - - name: dashboards - configMap: - name: grafana-dashboards - - name: providers - configMap: - name: grafana-providers - - name: datasources - configMap: - name: grafana-datasources diff --git a/manifests/monitoring/grafana/kustomization.yaml b/manifests/monitoring/grafana/kustomization.yaml deleted file mode 100644 index 13e0356a..00000000 --- a/manifests/monitoring/grafana/kustomization.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -namespace: flux-system -resources: - - service.yaml - - deployment.yaml - - providers.yaml - - datasources.yaml -configMapGenerator: - - name: grafana-dashboards - files: - - dashboards/control-plane.json - - dashboards/cluster.json - diff --git a/manifests/monitoring/grafana/providers.yaml b/manifests/monitoring/grafana/providers.yaml deleted file mode 100644 index 4f5e23c9..00000000 --- a/manifests/monitoring/grafana/providers.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: grafana-providers - namespace: flux-system -data: - providers.yaml: |+ - apiVersion: 1 - providers: - - name: 'default' - orgId: 1 - folder: '' - type: file - disableDeletion: false - editable: true - options: - path: /etc/grafana/dashboards diff --git a/manifests/monitoring/grafana/service.yaml b/manifests/monitoring/grafana/service.yaml deleted file mode 100644 index 87968d71..00000000 --- a/manifests/monitoring/grafana/service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: grafana - namespace: flux-system - labels: - app: grafana -spec: - type: ClusterIP - ports: - - port: 3000 - targetPort: http - protocol: TCP - name: http - selector: - app: grafana diff --git a/manifests/monitoring/kustomization.yaml b/manifests/monitoring/kustomization.yaml deleted file mode 100644 index b93baa2d..00000000 --- a/manifests/monitoring/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -namespace: flux-system -resources: -- prometheus -- grafana diff --git a/manifests/monitoring/prometheus/account.yaml b/manifests/monitoring/prometheus/account.yaml deleted file mode 100644 index e475c196..00000000 --- a/manifests/monitoring/prometheus/account.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: prometheus - namespace: flux-system diff --git a/manifests/monitoring/prometheus/deployment.yaml b/manifests/monitoring/prometheus/deployment.yaml deleted file mode 100644 index 293a9353..00000000 --- a/manifests/monitoring/prometheus/deployment.yaml +++ /dev/null @@ -1,52 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: prometheus - namespace: flux-system -spec: - replicas: 1 - selector: - matchLabels: - app: prometheus - template: - metadata: - labels: - app: prometheus - annotations: - appmesh.k8s.aws/sidecarInjectorWebhook: disabled - sidecar.istio.io/inject: "false" - spec: - serviceAccountName: prometheus - containers: - - name: prometheus - image: prom/prometheus:v2.26.0 - imagePullPolicy: IfNotPresent - args: - - '--storage.tsdb.retention=2h' - - '--config.file=/etc/prometheus/prometheus.yml' - ports: - - containerPort: 9090 - name: http - livenessProbe: - httpGet: - path: /-/healthy - port: 9090 - readinessProbe: - httpGet: - path: /-/ready - port: 9090 - resources: - requests: - cpu: 10m - memory: 128Mi - volumeMounts: - - name: config-volume - mountPath: /etc/prometheus - - name: data-volume - mountPath: /prometheus/data - volumes: - - name: config-volume - configMap: - name: prometheus - - name: data-volume - emptyDir: {} \ No newline at end of file diff --git a/manifests/monitoring/prometheus/kustomization.yaml b/manifests/monitoring/prometheus/kustomization.yaml deleted file mode 100644 index b3377956..00000000 --- a/manifests/monitoring/prometheus/kustomization.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -namespace: flux-system -resources: - - account.yaml - - rbac.yaml - - service.yaml - - deployment.yaml -configMapGenerator: - - name: prometheus - files: - - prometheus.yml diff --git a/manifests/monitoring/prometheus/prometheus.yml b/manifests/monitoring/prometheus/prometheus.yml deleted file mode 100644 index 93f35c09..00000000 --- a/manifests/monitoring/prometheus/prometheus.yml +++ /dev/null @@ -1,52 +0,0 @@ -global: - scrape_interval: 10s -scrape_configs: - -# Kubernetes API -- job_name: kubernetes-apiserver - kubernetes_sd_configs: - - role: endpoints - namespaces: - names: - - default - scheme: https - tls_config: - ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt - insecure_skip_verify: true - bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token - relabel_configs: - - source_labels: [__meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name] - action: keep - regex: kubernetes;https - -# Kubernetes pods -- job_name: kubernetes-pods - kubernetes_sd_configs: - - role: pod - relabel_configs: - - action: keep - regex: true - source_labels: - - __meta_kubernetes_pod_annotation_prometheus_io_scrape - - action: replace - regex: (.+) - source_labels: - - __meta_kubernetes_pod_annotation_prometheus_io_path - target_label: __metrics_path__ - - action: replace - regex: ([^:]+)(?::\d+)?;(\d+) - replacement: $1:$2 - source_labels: - - __address__ - - __meta_kubernetes_pod_annotation_prometheus_io_port - target_label: __address__ - - action: labelmap - regex: __meta_kubernetes_pod_label_(.+) - - action: replace - source_labels: - - __meta_kubernetes_namespace - target_label: namespace - - action: replace - source_labels: - - __meta_kubernetes_pod_name - target_label: pod diff --git a/manifests/monitoring/prometheus/rbac.yaml b/manifests/monitoring/prometheus/rbac.yaml deleted file mode 100644 index 926a6d83..00000000 --- a/manifests/monitoring/prometheus/rbac.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: prometheus-flux-system -rules: - - apiGroups: [""] - resources: - - nodes - - services - - endpoints - - pods - - nodes/proxy - verbs: ["get", "list", "watch"] - - apiGroups: [""] - resources: - - configmaps - verbs: ["get"] - - nonResourceURLs: ["/metrics"] - verbs: ["get"] ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: prometheus-flux-system -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: prometheus-flux-system -subjects: -- kind: ServiceAccount - name: prometheus - namespace: flux-system diff --git a/manifests/monitoring/prometheus/service.yaml b/manifests/monitoring/prometheus/service.yaml deleted file mode 100644 index 143cd9b4..00000000 --- a/manifests/monitoring/prometheus/service.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: prometheus - namespace: flux-system -spec: - selector: - app: prometheus - ports: - - name: http - protocol: TCP - port: 9090 \ No newline at end of file