argoproj / argo-workflows

Workflow Engine for Kubernetes
https://argo-workflows.readthedocs.io/
Apache License 2.0
14.81k stars 3.17k forks source link

Custom db schema for persistence tables #2452

Open paguos opened 4 years ago

paguos commented 4 years ago

Summary

In the latest release of argo (v2.6.2 at the time of writting) it is not possible to define a schema when enabling persistence. I would like to have persistence stored in a schema different that public.

Motivation

Many applications or organizations use a database for multiple purposes. Having the ability to choose the schema where to store the information about argo would be useful.

Proposal

An extra parameter in the workflow-controller-configmap when persistence is enabled:

postgresql:
        host: localhost
        port: 5432
        database: postgres
        tableName: argo_workflows
        schema: argo # new attribute
        userNameSecret:
          name: argo-postgres-config
          key: username
        passwordSecret:
          name: argo-postgres-config
          key: password

Message from the maintainers:

If you wish to see this enhancement implemented please add a 👍 reaction to this issue! We often sort issues this way to know what to prioritize.

alexec commented 4 years ago

Great idea - would you be interested in submitting a PR?

paguos commented 4 years ago

Great idea - would you be interested in submitting a PR?

I could try 👍

Radolumbo commented 3 years ago

Bump! This is an important feature. Creating things in public in postgres is icky...

alexec commented 3 years ago

Would you like to submit a PR to fix?

Radolumbo commented 3 years ago

Honestly, we're just working around this for now by setting the searchpath of the user who Argo is logging into the DB as. It'll create all the tables in whichever schema you set first in the search path, e.g. ALTER ROLE argo SET search_path = argo,public

I might be able to swing back to it later, but this works for us for now.

jreynard-code commented 1 month ago

Hi guys,

Little up for this thread :) Do you have any idea if this request will be done or not? It will be great to have this possibility :)

Thanks a lot!

Regards

paguos commented 1 month ago

I'm more fluent in go now. I will give it a go, expect something in the coming weeks.