-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rhobs]: Add rhobs query #653
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4776790
wip
thibaultmg 5ec1116
update proxy volume name
thibaultmg f84fac3
fix useless controller port
thibaultmg 8aac96c
changes hashrings file name
thibaultmg 7f5e848
add query and query-rule
thibaultmg ea4eea5
update observatorium commit
thibaultmg a9f101e
add req duration telemetry quantiles
thibaultmg b91e091
make query rule common
thibaultmg 2cfbe07
upgrade thanos version
thibaultmg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
318 changes: 318 additions & 0 deletions
318
...ces/app-sre-stage-01/rhobs/default/observatorium-metrics-query-rule-default-template.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,318 @@ | ||
apiVersion: template.openshift.io/v1 | ||
kind: Template | ||
metadata: | ||
creationTimestamp: null | ||
name: observatorium-thanos-query-rule-default | ||
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-layer | ||
app.kubernetes.io/instance: observatorium | ||
app.kubernetes.io/name: thanos-query-rule | ||
app.kubernetes.io/part-of: observatorium | ||
app.kubernetes.io/version: v0.32.4 | ||
name: observatorium-thanos-query-rule-default | ||
namespace: rhobs | ||
spec: | ||
host: "" | ||
port: | ||
targetPort: https | ||
tls: | ||
insecureEdgeTerminationPolicy: Redirect | ||
termination: reencrypt | ||
to: | ||
kind: Service | ||
name: observatorium-thanos-query-rule-default | ||
weight: null | ||
- apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
service.alpha.openshift.io/serving-cert-secret-name: query-rule-tls-default | ||
creationTimestamp: null | ||
labels: | ||
app.kubernetes.io/component: query-layer | ||
app.kubernetes.io/instance: observatorium | ||
app.kubernetes.io/name: thanos-query-rule | ||
app.kubernetes.io/part-of: observatorium | ||
app.kubernetes.io/version: v0.32.4 | ||
name: observatorium-thanos-query-rule-default | ||
namespace: rhobs | ||
spec: | ||
ports: | ||
- name: http | ||
port: 10902 | ||
protocol: TCP | ||
targetPort: 10902 | ||
- name: grpc | ||
port: 10901 | ||
protocol: TCP | ||
targetPort: 10901 | ||
- name: https | ||
port: 8443 | ||
protocol: TCP | ||
targetPort: 8443 | ||
selector: | ||
app.kubernetes.io/component: query-layer | ||
app.kubernetes.io/instance: observatorium | ||
app.kubernetes.io/name: thanos-query-rule | ||
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-rule-default"}}' | ||
creationTimestamp: null | ||
labels: | ||
app.kubernetes.io/component: query-layer | ||
app.kubernetes.io/instance: observatorium | ||
app.kubernetes.io/name: thanos-query-rule | ||
app.kubernetes.io/part-of: observatorium | ||
app.kubernetes.io/version: v0.32.4 | ||
name: observatorium-thanos-query-rule-default | ||
namespace: rhobs | ||
- apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
app.kubernetes.io/component: query-layer | ||
app.kubernetes.io/instance: observatorium | ||
app.kubernetes.io/name: thanos-query-rule | ||
app.kubernetes.io/part-of: observatorium | ||
app.kubernetes.io/version: v0.32.4 | ||
prometheus: app-sre | ||
name: observatorium-thanos-query-rule-default | ||
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-layer | ||
app.kubernetes.io/instance: observatorium | ||
app.kubernetes.io/name: thanos-query-rule | ||
app.kubernetes.io/part-of: observatorium | ||
- apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
app.kubernetes.io/component: query-layer | ||
app.kubernetes.io/instance: observatorium | ||
app.kubernetes.io/name: thanos-query-rule | ||
app.kubernetes.io/part-of: observatorium | ||
app.kubernetes.io/version: v0.32.4 | ||
thibaultmg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
name: observatorium-thanos-query-rule-default | ||
namespace: rhobs | ||
spec: | ||
replicas: ${{REPLICAS}} | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/component: query-layer | ||
app.kubernetes.io/instance: observatorium | ||
app.kubernetes.io/name: thanos-query-rule | ||
app.kubernetes.io/part-of: observatorium | ||
strategy: {} | ||
template: | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
app.kubernetes.io/component: query-layer | ||
app.kubernetes.io/instance: observatorium | ||
app.kubernetes.io/name: thanos-query-rule | ||
app.kubernetes.io/part-of: observatorium | ||
app.kubernetes.io/version: v0.32.4 | ||
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-rule | ||
topologyKey: kubernetes.io/hostname | ||
weight: 100 | ||
containers: | ||
- args: | ||
- query | ||
- --endpoint=dnssrv+_grpc._tcp.observatorium-thanos-receive-ingestor-default.rhobs.svc.cluster.local | ||
- --endpoint=dnssrv+_grpc._tcp.observatorium-thanos-store-default.rhobs.svc.cluster.local | ||
- --log.format=logfmt | ||
- --log.level=${LOG_LEVEL} | ||
- --query.auto-downsampling | ||
- --query.lookback-delta=15m | ||
- --query.max-concurrent=10 | ||
- --query.promql-engine=prometheus | ||
- --query.replica-label=replica | ||
- --query.replica-label=prometheus_replica | ||
- --query.replica-label=rule_replica | ||
- --query.timeout=15m | ||
- | | ||
--tracing.config=type: JAEGER | ||
config: | ||
service_name: thanos-query-rule | ||
sampler_type: ratelimiting | ||
sampler_param: 2 | ||
- --web.prefix-header=X-Forwarded-Prefix | ||
env: | ||
- name: HOST_IP_ADDRESS | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: status.hostIP | ||
image: quay.io/thanos/thanos:v0.32.4 | ||
imagePullPolicy: IfNotPresent | ||
livenessProbe: | ||
failureThreshold: 8 | ||
httpGet: | ||
path: /-/healthy | ||
port: 10902 | ||
periodSeconds: 30 | ||
timeoutSeconds: 1 | ||
name: thanos | ||
ports: | ||
- containerPort: 10902 | ||
name: http | ||
protocol: TCP | ||
- containerPort: 10901 | ||
name: grpc | ||
protocol: TCP | ||
readinessProbe: | ||
failureThreshold: 20 | ||
httpGet: | ||
path: /-/ready | ||
port: 10902 | ||
periodSeconds: 5 | ||
resources: | ||
limits: | ||
memory: ${MEMORY_LIMIT} | ||
requests: | ||
cpu: ${CPU_REQUEST} | ||
memory: ${MEMORY_REQUEST} | ||
terminationMessagePolicy: FallbackToLogsOnError | ||
- 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 | ||
- args: | ||
- -provider=openshift | ||
- -https-address=:8443 | ||
- -http-address= | ||
- -email-domain=* | ||
- -upstream=http://localhost:10902 | ||
- -openshift-service-account=observatorium-thanos-query-rule-default | ||
- '-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 | ||
nodeSelector: | ||
kubernetes.io/os: linux | ||
serviceAccountName: observatorium-thanos-query-rule-default | ||
terminationGracePeriodSeconds: 120 | ||
volumes: | ||
- name: tls | ||
secret: | ||
secretName: query-rule-tls-default | ||
parameters: | ||
- name: LOG_LEVEL | ||
value: warn | ||
- name: REPLICAS | ||
value: "1" | ||
- name: CPU_REQUEST | ||
value: 250m | ||
- name: MEMORY_LIMIT | ||
value: 8Gi | ||
- name: MEMORY_REQUEST | ||
value: 2Gi | ||
- from: '[a-zA-Z0-9]{40}' | ||
generate: expression | ||
name: OAUTH_PROXY_COOKIE_SECRET |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am trying to understand why we expose this directly via the internet? Is it for us (rhobs) to access the Thanos UI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is what I was thinking, for debugging purpose