Code Monkey home page Code Monkey logo

Comments (3)

styk-tv avatar styk-tv commented on August 22, 2024

If we come up with a basic structure then it will be easy to convert the config json to a template. I'm looking currently at this folder

https://github.com/frain-dev/convoy/tree/main/config/testdata/Config

to be able to assemble the config as per config map mapping from deployment file here

          volumeMounts:
            - name: convoy-config
              mountPath: /config
          command: ["/cmd"]
          args: ["server", "--config", "/config/convoy.json", "-w", "false"]

in values.yaml it would be easy to create config section and then keep yaml version of this config directly in values, then have some basic setup and let people know that this yaml is then converted in helmchart to actual json file which is relatively easy to do. that would be an awesome addition to helm chart and would make it work out of the box.

in ConfigMap (convoy-config) template you can use function (have not tested)

{{ $.Values.config | fromYaml | toJson }}

and then your sample configuration could in values.yaml file could look like

config:
  database:
    dsn: postgres://inside-config-file
  queue:
    type: redis
    redis:
      dsn: redis://localhost:8379
  server:
    http:
      port: 8080
  group:
    strategy:
      type: default
      default:
        intervalSeconds: 125
        retryLimit: 15
    signature:
      hash: SHA256
      header: x-test-signature
    disable_endpoint: true
    replay_attacks: true
  auth:
    require_auth: true
    native:
      enabled: true
    file:
      basic:
      - username: admin
        password: qwerty
        role:
          type: super_user
          group: ''

from helm-charts.

jirevwe avatar jirevwe commented on August 22, 2024

Hey @styk-tv

We still run v0.8 on our cloud so we have not gotten around to merging it to main yet.

I like the suggestion you made, I've never done it like that though. I'll take a look at this.

from helm-charts.

jirevwe avatar jirevwe commented on August 22, 2024

Hey @styk-tv

I was able to get this to work using this setup

configmap.yaml

apiVersion: v1
kind: ConfigMap
metadata:
  name: convoy-config
  labels:
    app.kubernetes.io/name: {{ include "convoy.name" . }}
    helm.sh/chart: {{ include "convoy.chart" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
data:
  convoy.json: {{ toJson .Values.config | quote }}

values.yaml

config:
  {
    "host": "http://localhost:5005",
    "database":
      {
        "type": "postgres",
        "dsn": "postgres://postgres:postgres@localhost/convoy",
      },
    "cache": { "type": "redis", "redis": { "dsn": "redis://localhost:6379" } },
    "queue": { "type": "redis", "redis": { "dsn": "redis://localhost:6379" } },
    "smtp":
      {
        "provider": "sendgrid",
        "url": "smtp.sendgrid.net",
        "port": 2525,
        "username": "username",
        "password": "password",
        "from": "[email protected]",
      },
    "server": { "http": { "port": 5005, "worker_port": 5006 } },
    "disable_endpoint": false,
    "auth": { "native": { "enabled": true }, "jwt": { "enabled": true } },
  }

Still testing it out, I'll let you know when I have pushed the changes

from helm-charts.

Related Issues (8)

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.