我正在使用以下命令将 Airflow 部署到 Kubernetes 中:https://github.com/helm/charts/tree/master/stable/airflow
我正在尝试通过修改 values.yml 来连接我的外部 PostgreSQL 数据库:
externalDatabase:
## the type of external database: {mysql,postgres}
##
type: postgres
## the host of the external database
##
host: <HOST>
## the port of the external database
##
port: 5432
## the database/scheme to use within the the external database
##
database: airflow
## the user of the external database
##
user: <USER>
## the name of a pre-created secret containing the external database password
##
passwordSecret: ""
## the key within `externalDatabase.passwordSecret` containing the password string
##
passwordSecretKey: ""
## the connection properties for external database, e.g. "?sslmode=require"
properties: "?sslmode=require"
但是它正在请求passwordSecret
和passwordSecretKey
。
如何在 Kubernetes 中创建 passwordSecret 密码?
passwordSecretKey
是airflow用户的密码?
最佳答案
最简单的方法是按照以下步骤操作 here .
创建一个名为 mysecretcreator.yaml 的 yaml 文件
apiVersion: v1
kind: Secret
metadata:
name: mysecret
type: Opaque
data:
username: YWRtaW4=
password: MWYyZDFlMmU2N2Rm
然后运行kubectl apply -f mysecretcreator.yaml
创建 secret 后,将以下内容添加到 custom-values.yaml
## the name of a pre-created secret containing the external database password
##
passwordSecret: "mysecret"
关于kubernetes - 稳定/Airflow 连接外部 PostgreSQL 数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64299467/