Skip to content

Commit

Permalink
[Thanos] Use existing secret for thanos objstore config (#979)
Browse files Browse the repository at this point in the history
Use existing secret for thanos objstore config
  • Loading branch information
samuel-begin authored and tarokkk committed Nov 26, 2019
1 parent 871726e commit 0e65e91
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion thanos/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ keywords:
sources:
- https://github.com/thanos-io/thanos
- https://github.com/banzaicloud/banzai-charts/tree/master/thanos
version: 0.3.9
version: 0.3.10
icon: https://raw.githubusercontent.com/thanos-io/thanos/master/docs/img/Thanos-logo_fullmedium.png
maintainers:
- name: Banzai Cloud
Expand Down
5 changes: 3 additions & 2 deletions thanos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ This section describes the values available
| image.repository | Thanos image repository and name | 'quay.io/thanos/thanos' **For Thanos version 0.6.0 or older change this to 'improbable/thanos'** |
| image.tag | Thanos image tag | v0.8.1 |
| image.pullPolicy | Image Kubernetes pull policy | IfNotPresent |
| objstore | Configuration for the backend object storage in yaml format. Mutually exclusive with objstoreFile. | {} |
| objstoreFile | Configuration for the backend object storage in string format. Mutually exclusive with objstore. | "" |
| objstore | Configuration for the backend object storage in yaml format. Mutually exclusive with other objstore options. | {} |
| objstoreFile | Configuration for the backend object storage in string format. Mutually exclusive with other objstore options. | "" |
| objstoreSecretOverride | Configuration for the backend object storage in an existing secret. Mutually exclusive with other objstore options. | "" |

## Common settings for all components

Expand Down
4 changes: 4 additions & 0 deletions thanos/templates/bucket-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ spec:
volumes:
- name: config-volume
secret:
{{- if .Values.objstoreSecretOverride }}
secretName: "{{ .Values.objstoreSecretOverride }}"
{{- else }}
secretName: {{ include "thanos.fullname" . }}
{{- end }}
{{- with .Values.bucket.securityContext }}
securityContext: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down
4 changes: 4 additions & 0 deletions thanos/templates/compact-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ spec:
{{- end }}
- name: config-volume
secret:
{{- if .Values.objstoreSecretOverride }}
secretName: "{{ .Values.objstoreSecretOverride }}"
{{- else }}
secretName: {{ include "thanos.fullname" . }}
{{- end }}
{{- with .Values.compact.securityContext }}
securityContext: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions thanos/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if or .Values.bucket.enabled .Values.store.enabled .Values.compact.enabled }}
{{- if eq .Values.objstoreSecretOverride "" }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -15,4 +16,5 @@ data:
{{- else }}
object-store.yaml: {{ .Values.objstoreFile | b64enc }}
{{- end }}
{{- end }}
{{- end }}
4 changes: 4 additions & 0 deletions thanos/templates/store-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ spec:
emptyDir: {}
- name: config-volume
secret:
{{- if $root.Values.objstoreSecretOverride }}
secretName: "{{ $root.Values.objstoreSecretOverride }}"
{{- else }}
secretName: {{ include "thanos.fullname" $root }}
{{- end }}
{{- if $root.Values.store.certSecretName }}
- name: {{ $root.Values.store.certSecretName }}
secret:
Expand Down
2 changes: 2 additions & 0 deletions thanos/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,8 @@ sidecar:

# This is the general backend configuration. Please se the examples below to configurate object store.
# More information can be found at thanos github repositoriy: https://github.com/thanos-io/thanos/blob/master/docs/storage.md
# Existing secret containing the configuration. The key must be `object-store.yaml`
objstoreSecretOverride: ""
# Text representation of the configuration
objstoreFile: ""
# YAML representation of the configuration. It's mutually exclusive with objstoreFile.
Expand Down

0 comments on commit 0e65e91

Please sign in to comment.