安装Apache Superset在EKS上时出现的问题

huangapple go评论76阅读模式
英文:

Issue with installing apache superset on EKS

问题

我已经创建了一个带有ALB设置的EKS集群。我尝试按照https://superset.apache.org/docs/installation/running-on-kubernetes/ 中提供的步骤安装Superset。

我的my-values.yaml文件如下:

ingress:
  enabled: true
  ingressClassName: ~
  annotations:
    kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/target-type: instance
  path: /
  pathType: ImplementationSpecific
  hosts:
    - chart-example.local
  tls: []
  extraHostsRaw: []

当我运行以下命令时:

helm upgrade --install --values my-values.yaml superset superset/superset --timeout 10m30s

它花了很长时间然后返回以下错误:

Error: UPGRADE FAILED: post-upgrade hooks failed: 1 error occurred:
	* timed out waiting for the condition

当我运行以下命令时:

kubectl get pods

它返回以下内容:

NAME                               READY   STATUS       RESTARTS        AGE
superset-7866fcc8b4-tcpk4          0/1     Init:0/1     8 (6m53s ago)   33m
superset-init-db-6q9dp             0/1     Init:Error   0               5m24s
superset-init-db-7hqz4             0/1     Init:Error   0               7m48s
superset-init-db-jt87x             0/1     Init:Error   0               12m
superset-init-db-rt85r             0/1     Init:Error   0               10m
superset-init-db-zptz6             0/1     Init:Error   0               2m40s
superset-postgresql-0              0/1     Pending      0               33m
superset-redis-master-0            1/1     Running      0               33m
superset-worker-748db75bf7-9kzfp   0/1     Init:0/1     8 (6m56s ago)   33m

我是Kubernetes的新手,对这个很陌生。请帮助我!

编辑1:添加了EBS CSI驱动程序和存储类,并继续进行Superset安装。运行了以下命令,并附上了响应:

kubectl get pods
    NAME                               READY   STATUS     RESTARTS       AGE
    superset-7866fcc8b4-q59nd          0/1     Init:0/1   4 (109s ago)   13m
    superset-init-db-gq9b9             0/1     Pending    0              13m
    superset-postgresql-0              0/1     Pending    0              13m
    superset-redis-master-0            1/1     Running    0              13m
    superset-worker-748db75bf7-n7t2r   0/1     Init:0/1   5 (91s ago)    13m

kubectl logs superset-worker-748db75bf7-n7t2r
Defaulted container "superset" out of: superset, wait-for-postgres-redis (init)
Error from server (BadRequest): container "superset" in pod "superset-worker-748db75bf7-n7t2r" is waiting to start: PodInitializing

kubectl logs superset-7866fcc8b4-q59nd
Defaulted container "superset" out of: superset, wait-for-postgres (init)
Error from server (BadRequest): container "superset" in pod "superset-7866fcc8b4-q59nd" is waiting to start: PodInitializing

kubectl describe pod superset-postgresql-0
Events:
  Type     Reason            Age                  From               Message
  ----     ------            ----                 ----               -------
  Warning  FailedScheduling  4m20s (x4 over 16m)  default-scheduler  0/1 nodes are available: 1 Too many pods. preemption: 0/1 nodes are available: 1 No preemption victims found for incoming pod.
英文:

I have created an EKS cluster with ALB setup. I tried installing superset by following the steps provided in https://superset.apache.org/docs/installation/running-on-kubernetes/

my-values.yaml

ingress:
  enabled: true
  ingressClassName: ~
  annotations:
    kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/target-type: instance
    # kubernetes.io/tls-acme: "true"
    ## Extend timeout to allow long running queries.
    # nginx.ingress.kubernetes.io/proxy-connect-timeout: "300"
    # nginx.ingress.kubernetes.io/proxy-read-timeout: "300"
    # nginx.ingress.kubernetes.io/proxy-send-timeout: "300"
  path: /
  pathType: ImplementationSpecific
  hosts:
    - chart-example.local
  tls: []
  extraHostsRaw: []
  #  - secretName: chart-example-tls
  #    hosts:
  #      - chart-example.local

When I am running helm upgrade --install --values my-values.yaml superset superset/superset --timeout 10m30s, it takes a lot of time and returns

Error: UPGRADE FAILED: post-upgrade hooks failed: 1 error occurred:
	* timed out waiting for the condition

and when I run

[ec2-user@ip-1**-**-**-*** ~]$ kubectl get pods
NAME                               READY   STATUS       RESTARTS        AGE
superset-7866fcc8b4-tcpk4          0/1     Init:0/1     8 (6m53s ago)   33m
superset-init-db-6q9dp             0/1     Init:Error   0               5m24s
superset-init-db-7hqz4             0/1     Init:Error   0               7m48s
superset-init-db-jt87x             0/1     Init:Error   0               12m
superset-init-db-rt85r             0/1     Init:Error   0               10m
superset-init-db-zptz6             0/1     Init:Error   0               2m40s
superset-postgresql-0              0/1     Pending      0               33m
superset-redis-master-0            1/1     Running      0               33m
superset-worker-748db75bf7-9kzfp   0/1     Init:0/1     8 (6m56s ago)   33m

I am new to kubernetes and this is new to me. Please help!

Edit:1
Added EBS CSI driver and Storage Class and went ahead with superset installation. Ran the following commands. Attaching responses

kubectl get pods
    NAME                               READY   STATUS     RESTARTS       AGE
    superset-7866fcc8b4-q59nd          0/1     Init:0/1   4 (109s ago)   13m
    superset-init-db-gq9b9             0/1     Pending    0              13m
    superset-postgresql-0              0/1     Pending    0              13m
    superset-redis-master-0            1/1     Running    0              13m
    superset-worker-748db75bf7-n7t2r   0/1     Init:0/1   5 (91s ago)    13m

[ec2-user@ip-172-31-23-209 ~]$ kubectl logs superset-worker-748db75bf7-n7t2r
Defaulted container "superset" out of: superset, wait-for-postgres-redis (init)
Error from server (BadRequest): container "superset" in pod "superset-worker-748db75bf7-n7t2r" is waiting to start: PodInitializing

[ec2-user@ip-172-31-23-209 ~]$ kubectl logs superset-7866fcc8b4-q59nd
Defaulted container "superset" out of: superset, wait-for-postgres (init)
Error from server (BadRequest): container "superset" in pod "superset-7866fcc8b4-q59nd" is waiting to start: PodInitializing

kubectl describe pod superset-postgresql-0
Events:
  Type     Reason            Age                  From               Message
  ----     ------            ----                 ----               -------
  Warning  FailedScheduling  4m20s (x4 over 16m)  default-scheduler  0/1 nodes are available: 1 Too many pods. preemption: 0/1 nodes are available: 1 No preemption victims found for incoming pod.

</details>


# 答案1
**得分**: 2

如果您正在运行PostgreSQL,并且使用的是EKS 1.23或更高版本,您需要安装一个CSI驱动程序,例如[EBS CSI驱动程序](https://github.com/kubernetes-sigs/aws-ebs-csi-driver)。从1.23开始,EKS不再提供存储驱动程序(内置驱动程序已被弃用)。安装CSI驱动程序后,创建一个默认的存储类别。您的Pod应该很快就会启动。如果您对Kubernetes不熟悉,我建议通过[EKS插件](https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html)来安装CSI驱动程序。

<details>
<summary>英文:</summary>

If you&#39;re running PostgreSQL, and you&#39;re using EKS 1.23 or higher, you&#39;ll need to install a CSI driver, e.g. the [EBS CSI driver](https://github.com/kubernetes-sigs/aws-ebs-csi-driver). Starting with 1.23, EKS no longer ships with a storage driver (the in-tree driver was deprecated). After installing the CSI driver, create a default storage class. Your pods should start shortly thereafter. If you&#39;re new to Kubernetes, I&#39;d recommend installing the CSI driver through [EKS addons](https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html).

</details>



# 答案2
**得分**: 1

你需要检查这些Pod的日志,以查看为什么它们失败了。但最初看起来:

- Postgres Bitnami图表必须作为Superset安装过程的一部分安装。
- 由于某种原因,Postgres Pod处于挂起状态(很可能是因为它无法创建持久卷;也可能是其他原因)。您可以通过运行`kubectl describe pod superset-postgresql-0`和`kubectl logs superset-init-db-6q9dp -c init`来了解详情。
- Superset Pods无法启动,直到Postgres启动,这在初始化容器中放置它是有意义的,以便在数据库准备好之前不启动您的应用程序。您可以通过在一个日志上运行`kubectl logs superset-7866fcc8b4-tcpk4 -c init`来检查这一点。

这只是我的猜测;您可以通过按照我提供的上述kubectl命令来确定。

长话短说,为了使Superset安装正常工作,需要在实际启动之前作为初始化检查的一部分启动Postgres。Postgres为什么没有启动?查看日志。

<details>
<summary>英文:</summary>

You got to inspect the logs of these pods; to see why it is failing; But initially, seems

- Postgres bitnami chart has to be installed as part of superset installation process. 
- For some reason, **postgres pod is pending** (*most probably because it cannot create a persistent volume; might be something else*). You can know by running `kubectl describe pod superset-postgresql-0` and `kubectl logs superset-init-db-6q9dp -c init`
- Superset pods cannot start until the postgres is up, which make sense to have it in the init container of your pod not to start your app unless DB is ready. You can inspect that by running logs on one of the logs `kubectl logs superset-7866fcc8b4-tcpk4 -c init`.

That is my guess; You can know for sure by following the above kubectl commands I provided. 

Long story short, superset installation to work **needs to have postgres started** as per of init checks before it actually starts; **postgres is not**, that&#39;s why superset is failing. Why postgres is not starting ? Check the logs.



</details>



huangapple
  • 本文由 发表于 2023年6月2日 04:45:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/76385596.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定