Skip to content

Commit

Permalink
Merge pull request #44 from qclaogui:avoid-restarting-grafana
Browse files Browse the repository at this point in the history
Avoid restarting grafana
  • Loading branch information
qclaogui authored Mar 9, 2024
2 parents 90de7e8 + 31a2965 commit 3b29d4a
Show file tree
Hide file tree
Showing 24 changed files with 103 additions and 97 deletions.
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ deploy-minio:
@$(KUSTOMIZE) build --enable-helm kubernetes/common/minio-operator | kubectl apply -f -
kubectl rollout status -n minio-system deployment/minio-operator --watch --timeout=600s
@$(KUSTOMIZE) build --enable-helm kubernetes/common/minio-tenant | kubectl apply -f -

delete-minio:
@$(KUSTOMIZE) build --enable-helm kubernetes/common/minio-tenant | kubectl delete --ignore-not-found -f -

.PHONY: deploy-gateway
deploy-gateway:
$(info ******************** deploy gateway manifests ********************)
Expand Down Expand Up @@ -221,8 +223,6 @@ define config_changes_trigger_pod_restart
kubectl rollout status -n gateway deployment/nginx --watch --timeout=600s
@kubectl rollout restart daemonset -n monitoring-system grafana-agent
kubectl rollout status -n monitoring-system daemonset/grafana-agent --watch --timeout=600s
@kubectl rollout restart deployment -n monitoring-system grafana
kubectl rollout status -n monitoring-system deployment/grafana --watch --timeout=600s
@$(call echo_info, ${$@_MSG})
endef

Expand All @@ -233,7 +233,7 @@ deploy-monolithic-mode-metrics: deploy-grafana ## Deploy monolithic-mode metrics
@$(KUSTOMIZE) build kubernetes/monolithic-mode/metrics | kubectl apply -f -
kubectl rollout status -n monitoring-system deployment/mimir --watch --timeout=600s
@$(call config_changes_trigger_pod_restart, "Go to http://localhost:8080/explore for the metrics.")
delete-monolithic-mode-metrics:
delete-monolithic-mode-metrics: delete-minio
@$(KUSTOMIZE) build kubernetes/monolithic-mode/metrics | kubectl delete -f -


Expand All @@ -243,7 +243,7 @@ deploy-monolithic-mode-logs: deploy-grafana ## Deploy monolithic-mode logs
@$(KUSTOMIZE) build --enable-helm kubernetes/monolithic-mode/logs | kubectl apply -f -
kubectl rollout status -n logging-system statefulset/loki --watch --timeout=600s
@$(call config_changes_trigger_pod_restart, "Go to http://localhost:8080/explore for the logs.")
delete-monolithic-mode-logs:
delete-monolithic-mode-logs: delete-minio
@$(KUSTOMIZE) build --enable-helm kubernetes/monolithic-mode/logs | kubectl delete -f -


Expand All @@ -253,7 +253,7 @@ deploy-monolithic-mode-profiles: deploy-grafana ## Deploy monolithic-mode profil
@$(KUSTOMIZE) build --enable-helm kubernetes/monolithic-mode/profiles | kubectl apply -f -
kubectl rollout status -n profiles-system statefulset/pyroscope --watch --timeout=600s
@$(call config_changes_trigger_pod_restart,"Go to http://localhost:8080/explore for the profiles.")
delete-monolithic-mode-profiles:
delete-monolithic-mode-profiles: delete-minio
@$(KUSTOMIZE) build --enable-helm kubernetes/monolithic-mode/profiles | kubectl delete -f -


Expand All @@ -263,7 +263,7 @@ deploy-monolithic-mode-traces: deploy-grafana ## Deploy monolithic-mode traces
@$(KUSTOMIZE) build --enable-helm kubernetes/monolithic-mode/traces | kubectl apply -f -
kubectl rollout status -n tracing-system statefulset/tempo --watch --timeout=600s
@$(call config_changes_trigger_pod_restart, "Go to http://localhost:8080/explore for the traces.")
delete-monolithic-mode-traces:
delete-monolithic-mode-traces: delete-minio
@$(KUSTOMIZE) build --enable-helm kubernetes/monolithic-mode/traces | kubectl delete -f -


Expand All @@ -273,7 +273,7 @@ deploy-monolithic-mode-all-in-one: deploy-grafana ## Deploy monolithic-mode all-
@$(KUSTOMIZE) build --enable-helm kubernetes/monolithic-mode/all-in-one | kubectl apply -f -
kubectl rollout status -n monitoring-system deployment/mimir --watch --timeout=600s
@$(call config_changes_trigger_pod_restart, "Go to http://localhost:8080/explore for the all-in-one.")
delete-monolithic-mode-all-in-one:
delete-monolithic-mode-all-in-one: delete-minio
@$(KUSTOMIZE) build --enable-helm kubernetes/monolithic-mode/all-in-one | kubectl delete -f -


Expand All @@ -284,7 +284,7 @@ deploy-read-write-mode-metrics: deploy-grafana ## Deploy read-write-mode metrics
@$(KUSTOMIZE) build kubernetes/read-write-mode/metrics | kubectl apply -f -
kubectl rollout status -n monitoring-system deployment/mimir-write --watch --timeout=600s
@$(call config_changes_trigger_pod_restart, "Go to http://localhost:8080/explore for the metrics.")
delete-read-write-mode-metrics:
delete-read-write-mode-metrics: delete-minio
@$(KUSTOMIZE) build kubernetes/read-write-mode/metrics | kubectl delete -f -


Expand All @@ -294,7 +294,7 @@ deploy-read-write-mode-logs: deploy-grafana ## Deploy read-write-mode logs
@$(KUSTOMIZE) build --enable-helm kubernetes/read-write-mode/logs | kubectl apply -f -
kubectl rollout status -n logging-system statefulset/loki-write --watch --timeout=600s
@$(call config_changes_trigger_pod_restart, "Go to http://localhost:8080/explore for the logs.")
delete-read-write-mode-logs:
delete-read-write-mode-logs: delete-minio
@$(KUSTOMIZE) build --enable-helm kubernetes/read-write-mode/logs | kubectl delete -f -


Expand All @@ -305,7 +305,7 @@ deploy-microservices-mode-logs: deploy-grafana ## Deploy microservices-mode logs
@$(KUSTOMIZE) build --enable-helm kubernetes/microservices-mode/logs | kubectl apply -f -
kubectl rollout status -n logging-system statefulset/loki-distributed-ingester --watch --timeout=600s
@$(call config_changes_trigger_pod_restart, "Go to http://localhost:8080/explore for the logs.")
delete-microservices-mode-logs:
delete-microservices-mode-logs: delete-minio
@$(KUSTOMIZE) build --enable-helm kubernetes/microservices-mode/logs | kubectl delete -f -


Expand All @@ -315,7 +315,7 @@ deploy-microservices-mode-metrics: deploy-grafana ## Deploy microservices-mode m
@$(KUSTOMIZE) build --enable-helm kubernetes/microservices-mode/metrics | kubectl apply -f -
kubectl rollout status -n monitoring-system statefulset/mimir-distributed-ingester --watch --timeout=600s
@$(call config_changes_trigger_pod_restart, "Go to http://localhost:8080/explore for the metrics.")
delete-microservices-mode-metrics:
delete-microservices-mode-metrics: delete-minio
@$(KUSTOMIZE) build --enable-helm kubernetes/microservices-mode/metrics | kubectl delete -f -


Expand All @@ -324,7 +324,7 @@ deploy-microservices-mode-profiles: deploy-grafana ## Deploy microservices-mode
$(info ******************** deploy microservices-mode profiles manifests ********************)
@$(KUSTOMIZE) build --enable-helm kubernetes/microservices-mode/profiles | kubectl apply -f -
@$(call config_changes_trigger_pod_restart, "Go to http://localhost:8080/explore for the profiles.")
delete-microservices-mode-profiles:
delete-microservices-mode-profiles: delete-minio
@$(KUSTOMIZE) build --enable-helm kubernetes/microservices-mode/profiles | kubectl delete -f -


Expand All @@ -334,7 +334,7 @@ deploy-microservices-mode-traces: deploy-grafana ## Deploy microservices-mode tr
@$(KUSTOMIZE) build --enable-helm kubernetes/microservices-mode/traces | kubectl apply -f -
kubectl rollout status -n tracing-system statefulset/tempo-distributed-ingester --watch --timeout=600s
@$(call config_changes_trigger_pod_restart, "Go to http://localhost:8080/explore for the traces.")
delete-microservices-mode-traces:
delete-microservices-mode-traces: delete-minio
@$(KUSTOMIZE) build --enable-helm kubernetes/microservices-mode/traces | kubectl delete -f -


Expand Down
10 changes: 10 additions & 0 deletions kubernetes/common/grafana/configs/datasources.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
apiVersion: 1

deleteDatasources:
- name: Metrics
uid: metrics
- name: Logs
uid: logs
- name: Traces
uid: traces
- name: Profiles
uid: profiles

datasources:
# Mimir for metrics
- name: Metrics
Expand Down
3 changes: 3 additions & 0 deletions kubernetes/common/grafana/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ helmCharts:
images:
- name: docker.io/grafana/grafana
newTag: 10.4.0
- name: quay.io/kiwigrid/k8s-sidecar
newTag: 1.26.1

resources:
- namespace.yaml
Expand Down Expand Up @@ -53,3 +55,4 @@ secretGenerator:
literals:
- NAMESPACE=monitoring-system
- GF_LOG_LEVEL=info
- GF_FEATURE_TOGGLES_ENABLE=traceqlEditor tracesEmbeddedFlameGraph traceqlSearch correlations metricsSummary traceToMetrics traceToProfiles
20 changes: 17 additions & 3 deletions kubernetes/common/grafana/manifests/k8s-all-in-one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,16 @@ data:
datasources.yaml: |
apiVersion: 1
deleteDatasources:
- name: Metrics
uid: metrics
- name: Logs
uid: logs
- name: Traces
uid: traces
- name: Profiles
uid: profiles
datasources:
# Mimir for metrics
- name: Metrics
Expand Down Expand Up @@ -215,7 +225,7 @@ kind: ConfigMap
metadata:
labels:
grafana_datasource: "1"
name: grafana-datasources-6chtc6cfg8
name: grafana-datasources-gcc7kf6bh4
namespace: monitoring-system
---
apiVersion: v1
Expand Down Expand Up @@ -3439,6 +3449,10 @@ metadata:
---
apiVersion: v1
data:
GF_FEATURE_TOGGLES_ENABLE: |
dHJhY2VxbEVkaXRvciB0cmFjZXNFbWJlZGRlZEZsYW1lR3JhcGggdHJhY2VxbFNlYXJjaC
Bjb3JyZWxhdGlvbnMgbWV0cmljc1N1bW1hcnkgdHJhY2VUb01ldHJpY3MgdHJhY2VUb1By
b2ZpbGVz
GF_LOG_LEVEL: aW5mbw==
NAMESPACE: bW9uaXRvcmluZy1zeXN0ZW0=
kind: Secret
Expand Down Expand Up @@ -3542,7 +3556,7 @@ spec:
value: http://localhost:3000/api/admin/provisioning/dashboards/reload
- name: REQ_METHOD
value: POST
image: quay.io/kiwigrid/k8s-sidecar:1.25.2
image: quay.io/kiwigrid/k8s-sidecar:1.26.1
imagePullPolicy: IfNotPresent
name: grafana-sc-dashboard
securityContext:
Expand Down Expand Up @@ -3582,7 +3596,7 @@ spec:
value: http://localhost:3000/api/admin/provisioning/datasources/reload
- name: REQ_METHOD
value: POST
image: quay.io/kiwigrid/k8s-sidecar:1.25.2
image: quay.io/kiwigrid/k8s-sidecar:1.26.1
imagePullPolicy: IfNotPresent
name: grafana-sc-datasources
securityContext:
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/microservices-mode/logs/k8s-all-in-one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ kind: ConfigMap
metadata:
labels:
grafana_datasource: "1"
name: grafana-datasources
name: grafana-datasources-9tgbk45h65
namespace: monitoring-system
---
apiVersion: v1
Expand Down
1 change: 0 additions & 1 deletion kubernetes/microservices-mode/logs/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ configMapGenerator:
- name: grafana-datasources
namespace: monitoring-system
options:
disableNameSuffixHash: true
labels:
grafana_datasource: "1"
files:
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/microservices-mode/metrics/k8s-all-in-one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4098,7 +4098,7 @@ kind: ConfigMap
metadata:
labels:
grafana_datasource: "1"
name: grafana-datasources
name: grafana-datasources-5bcgmmbbkh
namespace: monitoring-system
---
apiVersion: v1
Expand Down
1 change: 0 additions & 1 deletion kubernetes/microservices-mode/metrics/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ configMapGenerator:
- name: grafana-datasources
namespace: monitoring-system
options:
disableNameSuffixHash: true
labels:
grafana_datasource: "1"
files:
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/microservices-mode/profiles/k8s-all-in-one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ kind: ConfigMap
metadata:
labels:
grafana_datasource: "1"
name: grafana-datasources
name: grafana-datasources-t756b6d8cg
namespace: monitoring-system
---
apiVersion: v1
Expand Down
1 change: 0 additions & 1 deletion kubernetes/microservices-mode/profiles/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ configMapGenerator:
- name: grafana-datasources
namespace: monitoring-system
options:
disableNameSuffixHash: true
labels:
grafana_datasource: "1"
files:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
apiVersion: 1

deleteDatasources:
- name: Metrics
uid: metrics
- name: Traces
uid: traces

Expand Down
18 changes: 3 additions & 15 deletions kubernetes/microservices-mode/traces/k8s-all-in-one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4111,6 +4111,8 @@ data:
apiVersion: 1

deleteDatasources:
- name: Metrics
uid: metrics
- name: Traces
uid: traces

Expand Down Expand Up @@ -4172,7 +4174,7 @@ kind: ConfigMap
metadata:
labels:
grafana_datasource: "1"
name: grafana-datasources
name: grafana-datasources-k2hbd65tcb
namespace: monitoring-system
---
apiVersion: v1
Expand Down Expand Up @@ -43572,20 +43574,6 @@ metadata:
namespace: tracing-system
---
apiVersion: v1
data:
GF_FEATURE_TOGGLES_ENABLE: |
dHJhY2VxbEVkaXRvciB0cmFjZXNFbWJlZGRlZEZsYW1lR3JhcGggdHJhY2VxbFNlYXJjaC
Bjb3JyZWxhdGlvbnMgbWV0cmljc1N1bW1hcnkgdHJhY2VUb01ldHJpY3MgdHJhY2VUb1By
b2ZpbGVz
GF_LOG_LEVEL: d2Fybg==
NAMESPACE: bW9uaXRvcmluZy1zeXN0ZW0=
kind: Secret
metadata:
name: grafana-env
namespace: monitoring-system
type: Opaque
---
apiVersion: v1
data:
MIMIR_S3_SECRET_ACCESS_KEY: VkQ1MzhPWXhTRWlHRDRJOW1tRmZxRk1DR3ExdklpR20=
kind: Secret
Expand Down
10 changes: 0 additions & 10 deletions kubernetes/microservices-mode/traces/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ resources:
- ../../../monitoring-mixins/mimir-mixin/deploy

secretGenerator:
- name: grafana-env
namespace: monitoring-system
options:
disableNameSuffixHash: true
literals:
- NAMESPACE=monitoring-system
- GF_LOG_LEVEL=warn
- GF_FEATURE_TOGGLES_ENABLE=traceqlEditor tracesEmbeddedFlameGraph traceqlSearch correlations metricsSummary traceToMetrics traceToProfiles

- name: tempo-distributed-env
namespace: tracing-system
literals:
Expand All @@ -43,7 +34,6 @@ configMapGenerator:
- name: grafana-datasources
namespace: monitoring-system
options:
disableNameSuffixHash: true
labels:
grafana_datasource: "1"
files:
Expand Down
13 changes: 0 additions & 13 deletions kubernetes/monolithic-mode/all-in-one/k8s-all-in-one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62897,19 +62897,6 @@ metadata:
type: Opaque
---
apiVersion: v1
data:
GF_FEATURE_TOGGLES_ENABLE: |
dHJhY2VxbEVkaXRvciB0cmFjZXNFbWJlZGRlZEZsYW1lR3JhcGggdHJhY2VxbFNlYXJjaC
Bjb3JyZWxhdGlvbnMgbWV0cmljc1N1bW1hcnkgdHJhY2VUb01ldHJpY3MgdHJhY2VUb1By
b2ZpbGVz
GF_LOG_LEVEL: d2Fybg==
kind: Secret
metadata:
name: grafana-env
namespace: monitoring-system
type: Opaque
---
apiVersion: v1
data:
MIMIR_S3_SECRET_ACCESS_KEY: VkQ1MzhPWXhTRWlHRDRJOW1tRmZxRk1DR3ExdklpR20=
kind: Secret
Expand Down
6 changes: 0 additions & 6 deletions kubernetes/monolithic-mode/all-in-one/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ generatorOptions:
disableNameSuffixHash: true

secretGenerator:
- name: grafana-env
namespace: monitoring-system
literals:
- GF_LOG_LEVEL=warn
- GF_FEATURE_TOGGLES_ENABLE=traceqlEditor tracesEmbeddedFlameGraph traceqlSearch correlations metricsSummary traceToMetrics traceToProfiles

- name: loki-env
namespace: logging-system
literals:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ datasources:
access: proxy
url: http://nginx.gateway.svc.cluster.local:3100
basicAuth: false
isDefault: true
isDefault: false
version: 1
editable: true
Loading

0 comments on commit 3b29d4a

Please sign in to comment.