Skip to content

Document setup for airflow and postgres #7

@tdunning

Description

@tdunning

I will add comments on this issue over time to remember what setup has been done

This can be collected into a Kubernetes configuration for postgres at some point when we have that running in our production environment.

CREATE DATABASE airflow_db;
CREATE USER airflow_user WITH PASSWORD 'airflow_pass';
GRANT ALL PRIVILEGES ON DATABASE airflow_db TO airflow_user;
ALTER ROLE airflow_user SET search_path = airflow;
  • allow other servers to connect by setting up /etc/postgresql/10/main/pg_hba.conf
    My first attempt is this line:
host    airflow_db      airflow_user    192.168.86.12/30        scram-sha-256

This may be possible to degrade to a local connection.

Pending Questions

How do we set up the SQL Alchemy driver that airflow uses to not store the user and password in-line?
Possible answer

Which parts of Airflow connect to postgres? Do we need to allow connections from non-local workers? If we can do that, we can add a Linux user id for postgres_user and have postgres trust that the unix domain socket can verify the identity. That would avoid having to put a password into the connection string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions