gpt4 book ai didi

kubernetes - 如何在使用自定义镜像时通过 Kubernetes 上的 Helm 部署 Airflow ?

转载 作者:行者123 更新时间:2023-12-04 08:26:35 26 4
gpt4 key购买 nike

我的目标是能够使用自定义镜像(放置在 ECR 中)在 Kubernetes 上部署 Airflow 。我想使用这个自定义镜像的原因是因为我想在同一个容器中部署另一个具有 Airflow 的工具( dbt )(也在那里开放其他建议)
实际有效:
我已经设法使用 this Helm chart (默认使用以下 image)来部署
我试图做但没有奏效:
我现在想交换默认的 image在 ECR 中使用我的自定义图像,所以我创建了 values.yaml ,其中包含:

airflow:
image:
repository: 000000000.dkr.ecr.eu-central-1.amazonaws.com/foo/meow
tag: latest
然后跑:
helm upgrade airflow-pod airflow-stable/airflow --version "7.14.0" --values values.yaml
我希望覆盖默认的 yaml 并从 ECR 中提取图像。然后我跑了 describe pod airflow-pod ,并发现以下错误日志(片段):
  Type     Reason     Age                   From               Message
---- ------ ---- ---- -------
Normal Scheduled 12m default-scheduler Successfully assigned 000000000.dkr.ecr.eu-central-1.amazonaws.com/foo/meow to ip-10-0-0-0eu-central-1.compute.internal
Normal Pulling 12m kubelet Pulling image "000000000.dkr.ecr.eu-central-1.amazonaws.com/foo/meow:latest"
Normal Pulled 11m kubelet Successfully pulled image "000000000.dkr.ecr.eu-central-1.amazonaws.com/foo/meow:latest"
Normal Created 9m39s (x5 over 11m) kubelet Created container airflow-web
Normal Pulled 9m39s (x4 over 11m) kubelet Container image "000000000.dkr.ecr.eu-central-1.amazonaws.com/foo/meow:latest" already present on machine
Warning Failed 9m38s (x5 over 11m) kubelet Error: failed to start container "airflow-web": Error response from daemon: OCI runtime create failed: container_linux.go:370: starting container process caused: exec: "/usr/bin/dumb-init": stat /usr/bin/dumb-init: no such file or directory: unknown
我试图确认/解决问题
首先,我尝试查看是否是 ECR 问题。所以我把相同的 original image在 ECR(而不是我自己的 dbt 图像)中,发现上面同样的错误仍然存​​在。
其次,我挖掘并发现了以下 question这让我觉得我不能使用那个 Airflow Helm chart来自 ECR repo (非官方 repo )。
我采用的最后一种方法作为替代路径:
我尝试使用 chart on the Apache airflow repo喜欢:
helm install airflow . --namespace airflow-deploy --set executor=CeleryExecutor --set workers.keda.enabled=true --set workers.persistence.enabled=false
但我得到了错误:
Error: failed post-install: timed out waiting for the condition

最佳答案

原始图像似乎有“dumb-init”二进制文件,所以它应该可以工作。但是,如果您使用“imagePullPolicy: IfNotPresent”,那么 Kubernetes 可能会缓存该图像,即使您将新图像重新上传到 ECR,它也可能不会被拉取(尽管我相信最新的应该是这样,除非 Kubernetes 的某些自定义配置到位。
https://kubernetes.io/docs/concepts/containers/images/#updating-images
您始终可以运行图像并在本地检查其内容。 Airflow 的官方 Docker 镜像支持 bash命令:

docker run -it apache/airflow:1.10.12-python3.6 bash
airflow@18278a339579:/opt/airflow$ /usr/bin/dumb-init --help
dumb-init v1.2.2
Usage: /usr/bin/dumb-init [option] command [[arg] ...]
dumb-init is a simple process supervisor that forwards signals to children.
It is designed to run as PID1 in minimal container environments.
Optional arguments:
-c, --single-child Run in single-child mode.
In this mode, signals are only proxied to the
direct child and not any of its descendants.
-r, --rewrite s:r Rewrite received signal s to new signal r before proxying.
To ignore (not proxy) a signal, rewrite it to 0.
This option can be specified multiple times.
-v, --verbose Print debugging information to stderr.
-h, --help Print this help message and exit.
-V, --version Print the current version and exit.
Full help is available online at https://github.com/Yelp/dumb-init

关于kubernetes - 如何在使用自定义镜像时通过 Kubernetes 上的 Helm 部署 Airflow ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65232597/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com