Skip to content

Commit

Permalink
add query fe
Browse files Browse the repository at this point in the history
Signed-off-by: Thibault Mange <[email protected]>
  • Loading branch information
thibaultmg committed Dec 4, 2023
1 parent 1ce21b2 commit dfddd12
Show file tree
Hide file tree
Showing 9 changed files with 763 additions and 25 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ require (
)

// Delete when https://github.com/observatorium/observatorium/pull/543 is merged to main branch
replace github.com/observatorium/observatorium => github.com/thibaultmg/observatorium v0.0.0-20231123172357-0705fe74fcd5
replace github.com/observatorium/observatorium => github.com/thibaultmg/observatorium v0.0.0-20231124164749-d47b398822ba
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1253,8 +1253,8 @@ github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I=
github.com/thibaultmg/observatorium v0.0.0-20231123172357-0705fe74fcd5 h1:EQ3Qb3hsVxrhlWKl3DWettTcHwKGbGyJp4t6j0q4W3E=
github.com/thibaultmg/observatorium v0.0.0-20231123172357-0705fe74fcd5/go.mod h1:P+7t9O8AitkuZjUhXC4LHw4iwAzTpIrs0tHz8X3xTvM=
github.com/thibaultmg/observatorium v0.0.0-20231124164749-d47b398822ba h1:C0lH8h/Dh6SCVG6FCNBsn1Rg075gQd3TPBVzjcdCIsk=
github.com/thibaultmg/observatorium v0.0.0-20231124164749-d47b398822ba/go.mod h1:P+7t9O8AitkuZjUhXC4LHw4iwAzTpIrs0tHz8X3xTvM=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,309 @@
apiVersion: template.openshift.io/v1
kind: Template
metadata:
creationTimestamp: null
name: observatorium-thanos-query-frontend
objects:
- apiVersion: route.openshift.io/v1
kind: Route
metadata:
annotations:
cert-manager.io/issuer-kind: ClusterIssuer
cert-manager.io/issuer-name: letsencrypt-prod-http
creationTimestamp: null
labels:
app.kubernetes.io/component: query-cache
app.kubernetes.io/instance: observatorium
app.kubernetes.io/name: thanos-query-frontend
app.kubernetes.io/part-of: observatorium
app.kubernetes.io/version: v0.32.5
name: observatorium-thanos-query-frontend
namespace: rhobs
spec:
host: ""
port:
targetPort: https
tls:
insecureEdgeTerminationPolicy: Redirect
termination: reencrypt
to:
kind: Service
name: observatorium-thanos-query-frontend
weight: null
- apiVersion: v1
kind: Service
metadata:
annotations:
service.alpha.openshift.io/serving-cert-secret-name: query-frontend-tls
creationTimestamp: null
labels:
app.kubernetes.io/component: query-cache
app.kubernetes.io/instance: observatorium
app.kubernetes.io/name: thanos-query-frontend
app.kubernetes.io/part-of: observatorium
app.kubernetes.io/version: v0.32.5
name: observatorium-thanos-query-frontend
namespace: rhobs
spec:
ports:
- name: http
port: 9090
protocol: TCP
targetPort: 9090
- name: https
port: 8443
protocol: TCP
targetPort: 8443
selector:
app.kubernetes.io/component: query-cache
app.kubernetes.io/instance: observatorium
app.kubernetes.io/name: thanos-query-frontend
app.kubernetes.io/part-of: observatorium
- apiVersion: v1
imagePullSecrets:
- name: quay.io
kind: ServiceAccount
metadata:
annotations:
serviceaccounts.openshift.io/oauth-redirectreference.application: '{"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"observatorium-thanos-query-frontend"}}'
creationTimestamp: null
labels:
app.kubernetes.io/component: query-cache
app.kubernetes.io/instance: observatorium
app.kubernetes.io/name: thanos-query-frontend
app.kubernetes.io/part-of: observatorium
app.kubernetes.io/version: v0.32.5
name: observatorium-thanos-query-frontend
namespace: rhobs
- apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/component: query-cache
app.kubernetes.io/instance: observatorium
app.kubernetes.io/name: thanos-query-frontend
app.kubernetes.io/part-of: observatorium
app.kubernetes.io/version: v0.32.5
prometheus: app-sre
name: observatorium-thanos-query-frontend
namespace: openshift-customer-monitoring
spec:
endpoints:
- port: http
relabelings:
- action: replace
separator: /
sourceLabels:
- namespace
- pod
targetLabel: instance
namespaceSelector:
matchNames:
- rhobs
selector:
matchLabels:
app.kubernetes.io/component: query-cache
app.kubernetes.io/instance: observatorium
app.kubernetes.io/name: thanos-query-frontend
app.kubernetes.io/part-of: observatorium
- apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/component: query-cache
app.kubernetes.io/instance: observatorium
app.kubernetes.io/name: thanos-query-frontend
app.kubernetes.io/part-of: observatorium
app.kubernetes.io/version: v0.32.5
name: observatorium-thanos-query-frontend
namespace: rhobs
spec:
replicas: ${{REPLICAS}}
selector:
matchLabels:
app.kubernetes.io/component: query-cache
app.kubernetes.io/instance: observatorium
app.kubernetes.io/name: thanos-query-frontend
app.kubernetes.io/part-of: observatorium
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/component: query-cache
app.kubernetes.io/instance: observatorium
app.kubernetes.io/name: thanos-query-frontend
app.kubernetes.io/part-of: observatorium
app.kubernetes.io/version: v0.32.5
namespace: rhobs
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/instance
operator: In
values:
- observatorium
- key: app.kubernetes.io/name
operator: In
values:
- thanos-query-frontend
topologyKey: kubernetes.io/hostname
weight: 100
containers:
- args:
- query-frontend
- --cache-compression-type=snappy
- --labels.default-time-range=2w
- --labels.max-retries-per-request=0
- --labels.split-interval=1d
- --log.format=logfmt
- --log.level=${LOG_LEVEL}
- --query-frontend.compress-responses
- --query-frontend.downstream-url=http://observatorium-thanos-query.rhobs.svc.cluster.local:10902
- --query-frontend.log-queries-longer-than=5s
- --query-range.max-retries-per-request=0
- --query-range.split-interval=1d
- |
--tracing.config=type: JAEGER
config:
service_name: thanos-query-frontend
sampler_type: ratelimiting
sampler_param: 2
env:
- name: HOST_IP_ADDRESS
valueFrom:
fieldRef:
fieldPath: status.hostIP
image: quay.io/thanos/thanos:v0.32.5
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 8
httpGet:
path: /-/healthy
port: 9090
periodSeconds: 30
timeoutSeconds: 1
name: thanos
ports:
- containerPort: 9090
name: http
protocol: TCP
readinessProbe:
failureThreshold: 20
httpGet:
path: /-/ready
port: 9090
periodSeconds: 5
resources:
limits:
memory: ${MEMORY_LIMIT}
requests:
cpu: ${CPU_REQUEST}
memory: ${MEMORY_REQUEST}
terminationMessagePolicy: FallbackToLogsOnError
- args:
- -provider=openshift
- -https-address=:8443
- -http-address=
- -email-domain=*
- -upstream=http://localhost:10902
- -openshift-service-account=observatorium-thanos-query-frontend
- '-openshift-sar={"resource": "namespaces", "verb": "get", "name": "rhobs",
"namespace": "rhobs"}'
- '-openshift-delegate-urls={"/": {"resource": "namespaces", "verb": "get",
"name": "rhobs", "namespace": "rhobs"}}'
- -tls-cert=/etc/tls/private/tls.crt
- -tls-key=/etc/tls/private/tls.key
- -client-secret-file=/var/run/secrets/kubernetes.io/serviceaccount/token
- -cookie-secret=${OAUTH_PROXY_COOKIE_SECRET}
- -openshift-ca=/etc/pki/tls/cert.pem
- -openshift-ca=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
image: quay.io/openshift/origin-oauth-proxy:4.15
name: oauth-proxy
ports:
- containerPort: 8443
name: https
protocol: TCP
resources:
limits:
cpu: 200m
memory: 200Mi
requests:
cpu: 100m
memory: 100Mi
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- mountPath: /etc/tls/private
name: tls
readOnly: true
- args:
- --reporter.grpc.host-port=dns:///otel-trace-writer-collector-headless.observatorium-tools.svc:14250
- --reporter.type=grpc
- --agent.tags=pod.namespace=$(NAMESPACE),pod.name=$(POD)
env:
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD
valueFrom:
fieldRef:
fieldPath: metadata.name
image: quay.io/app-sre/jaegertracing-jaeger-agent:1.22.0
livenessProbe:
failureThreshold: 5
httpGet:
path: /
port: 14271
name: jaeger-agent
ports:
- containerPort: 5778
name: configs
protocol: TCP
- containerPort: 6831
name: jaeger-thrift
protocol: TCP
- containerPort: 14271
name: metrics
protocol: TCP
readinessProbe:
httpGet:
path: /
port: 14271
initialDelaySeconds: 1
resources:
limits:
cpu: 128m
memory: 128Mi
requests:
cpu: 32m
memory: 64Mi
terminationMessagePolicy: FallbackToLogsOnError
nodeSelector:
kubernetes.io/os: linux
serviceAccountName: observatorium-thanos-query-frontend
terminationGracePeriodSeconds: 120
volumes:
- name: tls
secret:
secretName: query-frontend-tls
parameters:
- name: LOG_LEVEL
value: warn
- name: REPLICAS
value: "1"
- name: CPU_REQUEST
value: 100m
- name: MEMORY_LIMIT
value: 1Gi
- name: MEMORY_REQUEST
value: 256Mi
- from: '[a-zA-Z0-9]{40}'
generate: expression
name: OAUTH_PROXY_COOKIE_SECRET
Original file line number Diff line number Diff line change
Expand Up @@ -177,19 +177,19 @@ objects:
- --query.replica-label=replica
- --query.replica-label=prometheus_replica
- --query.replica-label=rule_replica
- --query.telemetry.request-duration-seconds-quantiles=0.10
- --query.telemetry.request-duration-seconds-quantiles=0.1
- --query.telemetry.request-duration-seconds-quantiles=0.25
- --query.telemetry.request-duration-seconds-quantiles=0.75
- --query.telemetry.request-duration-seconds-quantiles=1.25
- --query.telemetry.request-duration-seconds-quantiles=1.75
- --query.telemetry.request-duration-seconds-quantiles=2.50
- --query.telemetry.request-duration-seconds-quantiles=3.00
- --query.telemetry.request-duration-seconds-quantiles=5.00
- --query.telemetry.request-duration-seconds-quantiles=10.00
- --query.telemetry.request-duration-seconds-quantiles=15.00
- --query.telemetry.request-duration-seconds-quantiles=30.00
- --query.telemetry.request-duration-seconds-quantiles=60.00
- --query.telemetry.request-duration-seconds-quantiles=120.00
- --query.telemetry.request-duration-seconds-quantiles=2.5
- --query.telemetry.request-duration-seconds-quantiles=3
- --query.telemetry.request-duration-seconds-quantiles=5
- --query.telemetry.request-duration-seconds-quantiles=10
- --query.telemetry.request-duration-seconds-quantiles=15
- --query.telemetry.request-duration-seconds-quantiles=30
- --query.telemetry.request-duration-seconds-quantiles=60
- --query.telemetry.request-duration-seconds-quantiles=120
- --query.timeout=15m
- |
--tracing.config=type: JAEGER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
objects:
- apiVersion: v1
data:
hashring.json: '[{"hashring":"default","tenants":["3833951d-bede-4a53-85e5-f73f4913973f","9ca26972-4328-4fe3-92db-31302013d03f","AC879303-C60F-4D0D-A6D5-A485CFD638B8","99c885bc-2d64-4c4d-b55e-8bf30d98c657","770c1124-6ae8-4324-a9d4-9ce08590094b","37b8fd3f-56ff-4b64-8272-917c9b0d1623","d17ea8ce-d4c6-42ef-b259-7d10c9227e93","1b9b6e43-9128-4bbf-bfff-3c120bbe6f11","0fc2b00e-201b-4c17-b9f2-19d91adc4fd2","8ace13a2-1c72-4559-b43d-ab43e32a255a","0031e8d6-e50a-47ea-aecb-c7e0bd84b3f1"],"algorithm":"ketama"},{"hashring":"rhel","tenants":["72e6f641-b2e2-47eb-bbc2-fee3c8fbda26"],"algorithm":"ketama"},{"hashring":"telemeter","tenants":["FB870BF3-9F3A-44FF-9BF7-D7A047A52F43"],"algorithm":"ketama"}]'
hashrings.json: '[{"hashring":"default","tenants":["3833951d-bede-4a53-85e5-f73f4913973f","9ca26972-4328-4fe3-92db-31302013d03f","AC879303-C60F-4D0D-A6D5-A485CFD638B8","99c885bc-2d64-4c4d-b55e-8bf30d98c657","770c1124-6ae8-4324-a9d4-9ce08590094b","37b8fd3f-56ff-4b64-8272-917c9b0d1623","d17ea8ce-d4c6-42ef-b259-7d10c9227e93","1b9b6e43-9128-4bbf-bfff-3c120bbe6f11","0fc2b00e-201b-4c17-b9f2-19d91adc4fd2","8ace13a2-1c72-4559-b43d-ab43e32a255a","0031e8d6-e50a-47ea-aecb-c7e0bd84b3f1"],"algorithm":"ketama"},{"hashring":"rhel","tenants":["72e6f641-b2e2-47eb-bbc2-fee3c8fbda26"],"algorithm":"ketama"},{"hashring":"telemeter","tenants":["FB870BF3-9F3A-44FF-9BF7-D7A047A52F43"],"algorithm":"ketama"}]'
kind: ConfigMap
metadata:
creationTimestamp: null
Expand Down
Loading

0 comments on commit dfddd12

Please sign in to comment.