forked from kubecost/cost-analyzer-helm-chart
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kubecost#626 from kubecost/bolt/thanos-0.15-upgrade
Upgrade Thanos to 0.15.0
- Loading branch information
Showing
11 changed files
with
507 additions
and
41 deletions.
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
120 changes: 120 additions & 0 deletions
120
cost-analyzer/charts/thanos/templates/query-frontend-deployment.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,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 }} |
35 changes: 35 additions & 0 deletions
35
cost-analyzer/charts/thanos/templates/query-frontend-horizontalpodautoscaler.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,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
45
cost-analyzer/charts/thanos/templates/query-frontend-ingress.yml
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,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 }} | ||
|
||
|
25 changes: 25 additions & 0 deletions
25
cost-analyzer/charts/thanos/templates/query-frontend-poddisruptionbudget.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,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
32
cost-analyzer/charts/thanos/templates/query-frontend-service.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,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 -}} |
30 changes: 30 additions & 0 deletions
30
cost-analyzer/charts/thanos/templates/query-frontend-servicemonitor.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,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 -}} |
Oops, something went wrong.