Skip to content

Commit

Permalink
Rosa thano s3 alloy (#82)
Browse files Browse the repository at this point in the history
* allow setting storage class for aro-clf-blob

Signed-off-by: Paul Czarkowski <[email protected]>

* update rosa-thanos-s3 to grafana5 operator, and grafana-alloy

Signed-off-by: Paul Czarkowski <[email protected]>

---------

Signed-off-by: Paul Czarkowski <[email protected]>
  • Loading branch information
paulczar authored May 15, 2024
1 parent 98dc4b5 commit c69f9fc
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 231 deletions.
8 changes: 5 additions & 3 deletions charts/rosa-thanos-s3/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ description: A Helm chart for Kubernetes

type: application

version: 0.1.0
version: 0.3.0

dependencies:
- name: grafana-cr
version: "0.1.1"
version: "0.5.0"
repository: "https://rh-mobb.github.io/helm-charts/"
# repository: file://../grafana-cr

- name: alloy
repository: https://grafana.github.io/helm-charts
version: "0.2.0"
home: "https://rh-mobb.github.io/helm-charts/"

maintainers:
Expand Down
16 changes: 8 additions & 8 deletions charts/rosa-thanos-s3/files/operatorhub.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
subscriptions:
- name: grafana-operator
channel: v4
channel: v5
installPlanApproval: Automatic
source: community-operators
sourceNamespace: openshift-marketplace
Expand All @@ -13,14 +13,14 @@ subscriptions:

operatorGroups:
- name: federated-metrics
targetNamespace: ~
targetNamespace: all
# - name: resource-locker
# namespace: resource-locker-operator
# targetNamespace: resource-locker-operator

catalogSources:
- name: community-operators
sourceType: grpc
image: quay.io/operator-framework/upstream-community-operators:latest
displayName: Community Operators
publisher: OperatorHub.io
# catalogSources:
# - name: community-operators
# sourceType: grpc
# image: quay.io/operator-framework/upstream-community-operators:latest
# displayName: Community Operators
# publisher: OperatorHub.io
208 changes: 0 additions & 208 deletions charts/rosa-thanos-s3/templates/grafana/agent.yaml

This file was deleted.

50 changes: 50 additions & 0 deletions charts/rosa-thanos-s3/templates/grafana/alloy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
apiVersion: v1
kind: ConfigMap
metadata:
labels:
name: grafana-alloy-config
data:
config.alloy: |-
prometheus.scrape "cluster_metrics" {
job_name = "cluster-monitoring"
forward_to = [prometheus.remote_write.cluster_metrics.receiver]
targets = [
{
"__address__" = "prometheus-k8s.openshift-monitoring.svc.cluster.local:9091",
"__scheme__" = "https",
"__metrics_path__" = "/federate",
},
]
honor_labels = true
params = {
"match[]" = ["{job!=\"\"}"],
}
scrape_interval = "30s"
scrape_timeout = "30s"
metrics_path = "/federate"
scheme = "https"
authorization {
type = "Bearer"
credentials_file = "/var/run/secrets/kubernetes.io/serviceaccount/token"
}
tls_config {
insecure_skip_verify = true
}
}
prometheus.remote_write "cluster_metrics" {
external_labels = {
cluster = "{{ .Values.rosa.clusterName }}",
}
endpoint {
name = "thanos-receive"
url = "http://thanos-receive.{{ .Release.Namespace }}.svc.cluster.local:9091/api/v1/receive"
queue_config {
capacity = 2500
max_shards = 200
max_samples_per_send = 1000
}
metadata_config { }
}
}
5 changes: 4 additions & 1 deletion charts/rosa-thanos-s3/templates/grafana/dashboards.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{{ range $path, $_ := .Files.Glob "files/dashboards/*.json" }}
---
apiVersion: integreatly.org/v1alpha1
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
metadata:
name: {{ base $path }}
labels:
app: grafana
spec:
instanceSelector:
matchLabels:
dashboards: "grafana"
json: {{ $.Files.Get $path }}
{{ end }}
25 changes: 14 additions & 11 deletions charts/rosa-thanos-s3/templates/grafana/grafanadatasource.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
apiVersion: integreatly.org/v1alpha1
kind: GrafanaDataSource
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDatasource
metadata:
name: {{ include "rosa-thanos-s3.fullname" . }}-prometheus
labels:
{{- include "rosa-thanos-s3.labels" . | nindent 4 }}
spec:
name: {{ include "rosa-thanos-s3.fullname" . }}.yaml
datasources:
- access: proxy
editable: false
isDefault: true
jsonData:
timeInterval: 5s
name: prometheus
type: prometheus
url: 'http://thanos-querier.{{ .Release.Namespace }}.svc.cluster.local:9090'
instanceSelector:
matchLabels:
dashboards: grafana
datasource:
name: prometheus
access: proxy
editable: false
isDefault: true
jsonData:
timeInterval: 5s
type: prometheus
url: 'http://thanos-querier.{{ .Release.Namespace }}.svc.cluster.local:9090'
7 changes: 7 additions & 0 deletions charts/rosa-thanos-s3/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@ grafana-cr:
basicAuthUsername: "admin"
basicAuthPassword: "password"
# serviceAccountAnnotations: {}

alloy:
alloy:
configMap:
create: false
name: grafana-alloy-config
key: config.alloy

0 comments on commit c69f9fc

Please sign in to comment.