Commit d0eb9bfe authored by Erik Kristensen's avatar Erik Kristensen
Browse files

thanos support

parent b95f71c8
Loading
Loading
Loading
Loading
+9 −1
Original line number Original line Diff line number Diff line
@@ -26,7 +26,7 @@ spec:
    image: {{ template "system_default_registry" . }}{{ .Values.image.proxy.repository }}:{{ .Values.image.proxy.tag }}
    image: {{ template "system_default_registry" . }}{{ .Values.image.proxy.repository }}:{{ .Values.image.proxy.tag }}
    ports:
    ports:
    - containerPort: 8080
    - containerPort: 8080
      name: http
      name: nginx-http
      protocol: TCP
      protocol: TCP
    {{- if and .Values.resources .Values.resources.proxy }}
    {{- if and .Values.resources .Values.resources.proxy }}
    resources:
    resources:
@@ -107,6 +107,14 @@ spec:
{{- range $key, $value := .Values.externalLabels}}
{{- range $key, $value := .Values.externalLabels}}
    {{ $key }}: {{ $value | quote }}
    {{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.thanos.enabled }}
  thanos: 
    baseImage: {{ template "system_default_registry" . }}{{ .Values.image.thanos.repository }}
    version: {{ .Values.image.thanos.tag }}
    objectStorageConfig:
      key: thanos.yaml
      name: {{ template "app.thanos.fullname" . }}
{{- end }}
{{- end }}
  nodeSelector:
  nodeSelector:
{{- include "linux-node-selector" . | nindent 4 }}
{{- include "linux-node-selector" . | nindent 4 }}
+17 −1
Original line number Original line Diff line number Diff line
@@ -26,3 +26,19 @@ metadata:
stringData:
stringData:
  additional-alertmanager-configs.yaml: {{ template "additional-alertmanager-configs.yaml" . }}
  additional-alertmanager-configs.yaml: {{ template "additional-alertmanager-configs.yaml" . }}
{{- end }}
{{- end }}

{{- if .Values.thanos.enabled }} 
---
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "app.thanos.fullname" . }}
  labels:
    app: {{ template "app.name" . }}
    chart: {{ template "app.version" . }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
stringData:
  thanos.yaml: |-
{{ toYaml .Values.thanos.objectConfig | indent 6 }}
{{-end }}
+30 −2
Original line number Original line Diff line number Diff line
@@ -16,6 +16,34 @@ spec:
    chart: {{ template "app.version" . }}
    chart: {{ template "app.version" . }}
    release: {{ .Release.Name }}
    release: {{ .Release.Name }}
  ports:
  ports:
    - name: http
    - name: nginx-http
      port: 80
      port: 80
      targetPort: http
      targetPort: nginx-http

{{- if .Values.thanos.enabled }} 
---
apiVersion: v1
kind: Service
metadata:
  name: access-thanos
  labels:
    app: {{ template "app.name" . }}
    chart: {{ template "app.version" . }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
    kubernetes.io/cluster-service: "true"
spec:
  type: ClusterIP
  sessionAffinity: ClientIP
  selector:
    app: {{ template "app.name" . }}
    chart: {{ template "app.version" . }}
    release: {{ .Release.Name }}
  ports:
    - name: thanos-grpc
      port: 10901
      targetPort: 10901
    - name: thanos-http
      port: 10902
      targetPort: 10902
{{- end }}
+6 −0
Original line number Original line Diff line number Diff line
@@ -75,3 +75,9 @@ additionalAlertManagerConfigs: []
istioMonitoring:
istioMonitoring:
  enabled: true
  enabled: true
  namespace: istio-system
  namespace: istio-system

thanos:
  enabled: false
  ## ObjectStoreConfig
  ## Ref: https://github.com/thanos-io/thanos/blob/master/docs/storage.md
  objectConfig: {}
+4 −0
Original line number Original line Diff line number Diff line
@@ -56,6 +56,10 @@
{{- printf "%s-%s-cleanup" $name .Release.Name -}}
{{- printf "%s-%s-cleanup" $name .Release.Name -}}
{{- end -}}
{{- end -}}


{{- define "app.thanos.fullname" -}}
{{- $name := include "app.name" . -}}
{{- printf "%s-%s-thanos" $name .Release.Name -}}
{{- end -}}


{{- define "kube_version" -}}
{{- define "kube_version" -}}
{{- printf "%s.%s" .Capabilities.KubeVersion.Major .Capabilities.KubeVersion.Minor -}}
{{- printf "%s.%s" .Capabilities.KubeVersion.Major .Capabilities.KubeVersion.Minor -}}
Loading