GithubHelp home page GithubHelp logo

Comments (6)

stevehipwell avatar stevehipwell commented on August 26, 2024

@onedr0p is there a reason you don't want to create your own secret for your use case? I can support using an object with toYaml in addition to the string but I wont support tpl on an object as this is bad practice, something like below.

{{- if .Values.objstoreConfig.create -}}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "thanos.objstoreConfigSecretName" . }}
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "thanos.labels" . | nindent 4 }}
data:
  {{ .Values.objstoreConfig.key }}: |-
  {{- with .Values.objstoreConfig.value }}
  {{- if kindIs "string" . }}
    {{- tpl . $ | b64enc | nindent 4 }}
  {{- else }}
    {{- toYaml . | b64enc | nindent 4 }}
  {{- end }}
  {{- end }}
{{- end -}}

from helm-charts.

onedr0p avatar onedr0p commented on August 26, 2024

Hi @stevehipwell you can see my deployment with the Bitnami chart here using Flux HelmRelease

https://github.com/onedr0p/home-ops/blob/main/kubernetes/apps/monitoring/thanos/app/helmrelease.yaml

Essentially I use Ceph's Bucket CR to create a bucket like this:

apiVersion: objectbucket.io/v1alpha1
kind: ObjectBucketClaim
metadata:
  name: thanos-bucket-v1
  namespace: monitoring
spec:
  bucketName: thanos-v1
  storageClassName: ceph-bucket

This automatically generates a secret and configmap with the credentials and endpoint for the bucket. It would be nice to auto-populate the helm values using the Flux HelmRelease and valuesFrom:

  valuesFrom:
    - targetPath: objstoreConfig.config.bucket
      kind: ConfigMap
      name: thanos-bucket-v1
      valuesKey: BUCKET_NAME
    - targetPath: objstoreConfig.config.endpoint
      kind: ConfigMap
      name: thanos-bucket-v1
      valuesKey: BUCKET_HOST
    - targetPath: objstoreConfig.config.region
      kind: ConfigMap
      name: thanos-bucket-v1
      valuesKey: BUCKET_REGION
    - targetPath: objstoreConfig.config.access_key
      kind: Secret
      name: thanos-bucket-v1
      valuesKey: AWS_ACCESS_KEY_ID
    - targetPath: objstoreConfig.config.secret_key
      kind: Secret
      name: thanos-bucket-v1

I believe what you have there will work unless what I mentioned changes things.

from helm-charts.

stevehipwell avatar stevehipwell commented on August 26, 2024

Is valuesFrom a HelmRelease construct then?

from helm-charts.

onedr0p avatar onedr0p commented on August 26, 2024

Correct https://fluxcd.io/flux/components/helm/helmreleases/#values-overrides

from helm-charts.

stevehipwell avatar stevehipwell commented on August 26, 2024

In which case I'll add support in the next chart release (likely tomorrow).

from helm-charts.

onedr0p avatar onedr0p commented on August 26, 2024

Much appreciated, can't wait to try it out!

from helm-charts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.