Skip to content
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

Upgrade Thanos to 0.15.0 #626

Merged
merged 3 commits into from
Sep 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cost-analyzer/charts/thanos/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: 0.12.2
appVersion: 0.15.0
description: Thanos is a set of components that can be composed into a highly available metric system with unlimited storage capacity, which can be added seamlessly on top of existing Prometheus deployments.
name: thanos
keywords:
Expand All @@ -9,7 +9,7 @@ keywords:
sources:
- https://github.com/thanos-io/thanos
- https://github.com/banzaicloud/banzai-charts/tree/master/thanos
version: 0.12.2
version: 0.15.0
icon: https://raw.githubusercontent.com/thanos-io/thanos/master/website/static/Thanos-logo_full.svg
maintainers:
- name: Banzai Cloud
Expand Down
120 changes: 120 additions & 0 deletions cost-analyzer/charts/thanos/templates/query-frontend-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
{{ if .Values.queryFrontend.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "thanos.componentname" (list $ "query-frontend") }}
labels:
app.kubernetes.io/name: {{ include "thanos.name" . }}
helm.sh/chart: {{ include "thanos.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/version: {{ .Chart.AppVersion | replace "+" "_" }}
app.kubernetes.io/component: query-frontend
{{ with .Values.queryFrontend.deploymentLabels }}{{ toYaml . | indent 4 }}{{ end }}
{{- with .Values.queryFrontend.deploymentAnnotations }}
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.queryFrontend.autoscaling.enabled }}
replicas: {{ .Values.queryFrontend.replicaCount | default 1 }}
{{- end }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "thanos.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: query-frontend
{{ with .Values.queryFrontend.deploymentMatchLabels }}{{ toYaml . | indent 6 }}{{ end }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "thanos.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: query-frontend
{{ with .Values.queryFrontend.labels }}{{ toYaml . | indent 8 }}{{ end }}
{{- with .Values.queryFrontend.annotations }}
annotations: {{ toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.queryFrontend.metrics.annotations.enabled }}
prometheus.io/scrape: "true"
prometheus.io/port: "{{ .Values.queryFrontend.http.port }}"
{{- end }}
spec:
containers:
- name: thanos-query-frontend
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "query-frontend"
- "--log.level={{ .Values.queryFrontend.logLevel }}"
- "--http-address=0.0.0.0:{{ .Values.queryFrontend.http.port }}"
- "--query-frontend.downstream-url=http://{{ .Release.Name }}-thanos-query-http.{{ .Release.Namespace }}:{{ .Values.query.http.port }}"
- "--query-range.split-interval={{ .Values.queryFrontend.splitInterval }}"
- "--query-range.max-retries-per-request={{ .Values.queryFrontend.maxRetriesPerRequest }}"
- "--query-range.max-query-length={{ .Values.queryFrontend.maxQueryLength }}"
- "--query-range.max-query-parallelism={{ .Values.queryFrontend.maxQueryParallelism }}"
- "--query-range.response-cache-max-freshness={{ .Values.queryFrontend.responseCacheMaxFreshness }}"
{{- if .Values.queryFrontend.responseCache.enabled }}
{{- with .Values.queryFrontend.responseCache }}
- |-
--query-range.response-cache-config=
config:
max_size: {{ quote .maxSize }}
max_size_items: {{ .maxSizeItems }}
validity: {{ quote .validity }}
type: "in-memory"
{{- end }}
{{- else if .Values.queryFrontend.responseCacheConfigFile }}
- "--query-range.response-cache-config-file={{ .Values.queryFrontend.responseCacheConfigFile }}"
{{- else if .Values.queryFrontend.responseCacheConfig }}
- |-
--query-range.response-cache-config={{ toYaml .Values.queryFrontend.responseCacheConfig | nindent 12 }}
{{- end }}
{{- if .Values.queryFrontend.compressResponses }}
- "--query-frontend.compress-responses"
{{- end }}
{{- if .Values.queryFrontend.partialResponse }}
- "--query-range.partial-response"
{{- end }}
{{- if .Values.queryFrontend.extraArgs }}
{{ toYaml .Values.queryFrontend.extraArgs | nindent 8 }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.queryFrontend.http.port }}
resources:
{{ toYaml .Values.queryFrontend.resources | nindent 10 }}
env:
{{- toYaml .Values.queryFrontend.extraEnv | nindent 10 }}
volumeMounts:
{{- if .Values.queryFrontend.certSecretName }}
- mountPath: /etc/certs
name: {{ .Values.queryFrontend.certSecretName }}
readOnly: true
{{- end }}
livenessProbe:
httpGet:
path: /-/healthy
port: http
volumes:
{{- if .Values.queryFrontend.certSecretName }}
- name: {{ .Values.queryFrontend.certSecretName }}
secret:
defaultMode: 420
secretName: {{ .Values.queryFrontend.certSecretName }}
{{- end }}
{{- with .Values.queryFrontend.securityContext }}
securityContext: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.queryFrontend.nodeSelector }}
nodeSelector: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.queryFrontend.affinity }}
affinity: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.queryFrontend.tolerations }}
tolerations: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.queryFrontend.serviceAccount }}
serviceAccountName: "{{ . }}"
{{- end }}
{{ end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{- if .Values.queryFrontend.enabled }}
{{- if .Values.queryFrontend.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "thanos.componentname" (list $ "query-frontend") }}
labels:
app.kubernetes.io/name: {{ include "thanos.name" . }}
helm.sh/chart: {{ include "thanos.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/version: {{ .Chart.AppVersion | replace "+" "_" }}
app.kubernetes.io/component: query-frontend
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "thanos.componentname" (list $ "query-frontend") }}
minReplicas: {{ .Values.queryFrontend.autoscaling.minReplicas }}
maxReplicas: {{ .Values.queryFrontend.autoscaling.maxReplicas }}
metrics:
{{- with .Values.queryFrontend.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ . }}
{{- end }}
{{- with .Values.queryFrontend.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ . }}
{{- end }}
{{- end }}
{{- end }}
45 changes: 45 additions & 0 deletions cost-analyzer/charts/thanos/templates/query-frontend-ingress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
{{- if and .Values.queryFrontend.enabled .Values.queryFrontend.http.ingress.enabled }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ include "thanos.componentname" (list $ "query-frontend") }}-http
labels:
app.kubernetes.io/name: {{ include "thanos.name" . }}
helm.sh/chart: {{ include "thanos.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/version: {{ .Chart.AppVersion | replace "+" "_" }}
app.kubernetes.io/component: query-frontend
{{- if .Values.queryFrontend.http.ingress.labels }}
{{ toYaml .Values.queryFrontend.http.ingress.labels | indent 4 }}
{{- end }}
{{- with .Values.queryFrontend.http.ingress.annotations }}
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.queryFrontend.http.ingress.tls }}
tls:
{{- range .Values.queryFrontend.http.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
{{- if .secretName }}
secretName: {{ .secretName }}
{{- end}}
{{- end }}
{{- end }}
rules:
{{- range .Values.queryFrontend.http.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $.Values.queryFrontend.http.ingress.path }}
backend:
serviceName: {{ include "thanos.componentname" (list $ "query-frontend") }}-http
servicePort: {{ $.Values.queryFrontend.http.port }}
{{- end }}
{{- end }}


Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{- if and .Values.queryFrontend.enabled .Values.queryFrontend.podDisruptionBudget.enabled }}
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: {{ include "thanos.componentname" (list $ "query-frontend") }}
labels:
app.kubernetes.io/name: {{ include "thanos.name" . }}
helm.sh/chart: {{ include "thanos.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/version: {{ $.Chart.AppVersion | replace "+" "_" }}
app.kubernetes.io/component: query-frontend
{{ with .Values.queryFrontend.deploymentLabels }}{{ toYaml . | indent 4 }}{{ end }}
spec:
{{- if .Values.queryFrontend.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.queryFrontend.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.queryFrontend.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.queryFrontend.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "thanos.name" . }}
app.kubernetes.io/component: query-frontend
{{- end }}
32 changes: 32 additions & 0 deletions cost-analyzer/charts/thanos/templates/query-frontend-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{- if .Values.queryFrontend.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "thanos.componentname" (list $ "query-frontend") }}-http
{{- with .Values.queryFrontend.http.service.annotations }}
annotations: {{ toYaml .| nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ include "thanos.name" . }}
helm.sh/chart: {{ include "thanos.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/version: {{ $.Chart.AppVersion | replace "+" "_" }}
app.kubernetes.io/component: query-frontend
{{ with .Values.queryFrontend.http.service.labels }}{{ toYaml . | indent 4 }}{{ end }}
spec:
type: {{ .Values.queryFrontend.http.service.type }}
{{- if .Values.queryFrontend.http.service.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.queryFrontend.http.externalTrafficPolicy }}
{{- end }}
ports:
- port: {{ .Values.queryFrontend.http.port }}
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: {{ include "thanos.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: query-frontend
{{ with .Values.queryFrontend.http.service.matchLabels }}{{ toYaml . | indent 4 }}{{ end }}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{{- if and .Values.queryFrontend.enabled .Values.queryFrontend.metrics.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "thanos.componentname" (list $ "query-frontend") }}
labels:
app.kubernetes.io/name: {{ include "thanos.name" . }}
helm.sh/chart: {{ include "thanos.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/version: {{ .Chart.AppVersion | replace "+" "_" }}
app.kubernetes.io/component: query-frontend
{{ with .Values.queryFrontend.metrics.serviceMonitor.labels }}{{ toYaml . | indent 4 }}{{ end }}
spec:
jobLabel: thanos-query
selector:
matchLabels:
app.kubernetes.io/name: {{ include "thanos.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: query-frontend
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
endpoints:
- port: http
interval: {{ .Values.queryFrontend.metrics.serviceMonitor.interval | default "15s" }}
{{- with .Values.queryFrontend.metrics.serviceMonitor.relabellings }}
metricRelabelings: {{ toYaml . | nindent 8 }}
{{- end }}
{{- end -}}
Loading