如何在一个已经存在的PostgreSQL实例上部署Apache Superset

400 阅读1分钟

在这篇博客中,我们将学习如何用PostgreSQL实例部署和设置Apache SupersetApache Superset是一个用于数据探索和数据可视化的开源软件,能够处理PB级的数据。

先决条件

  • 在同一个Kubernetes集群上部署一个Postgresql实例
  • 系统中安装了Helm,并且有Helm的基本知识。
  • PostgreSQL实例的管理员用户名和密码
  • 在PostgreSQL中创建的超级数据库(如果没有,则按照第2步进行)。
  • 如果你想在主机名上设置SSL证书,可以选择Cert-manager。

在你开始之前

克隆脚本和代码的 repo,然后改变目录到克隆的 repo。

git clone https://github.com/knoldus/deploy-apache-superset.git
cd deploy-apache-superset

部署的步骤

1.创建或编辑apache-superset/custom-values.yaml文件

用用户名、密码和服务名称替换占位符。

supersetNode:
  connections:
    ## Changes to service name of your postgresql instance
    db_host: <POSTGRES_SERVICE_NAME>.<NAMESPACE>.svc.cluster.local
    db_port: "5432"
    ## change the <USERNAME> with admin username of postgres 
    db_user: <USERNAME>
    ## change the <PASSWORD> with admin username of postgres
    db_pass: <PASSWORD>
   

2.在postgresql中创建数据库**(如果没有创建)**。

kubectl port-forward service/<SERVICE_NAME_OF_POSTGRES> 5432
createdb -h 127.0.0.1 -p 5432 -U <USERNAME> superset

3.添加ingress的配置值

在Values.ingress中添加数值

ingress:
  enabled: true
  ingressClassName: nginx
  path: /
  pathType: ImplementationSpecific
  hosts:
    - <YOUR_HOST_NAME>
  tls:
   - secretName: <SECRET_NAME_OF_CERT_KEYS>
     hosts:
       - <YOUR_HOST_NAME>

3.部署Apache superset

helm upgrade --install superset apache-superset -f apache-superset/custom-values.yaml --namespace superset --create-namespace

总结

这就是我们如何在一个已经存在的PostgreSQL实例上部署Apache Superset。