Apache Flink Kubernetes操作符-如何覆盖Docker入口点



我试图在Dockerfile中覆盖Flink应用程序的容器入口点,但看起来Apache Flink kubernetes操作符忽略了它。

Dockerfile如下:

FROM flink:1.14.2-scala_2.12-java11
ENV FLINK_HOME=/opt/flink
COPY custom-docker-entrypoint.sh /
RUN chmod a+x /custom-docker-entrypoint.sh
COPY --chown=flink:flink --from=build /target/*.jar /opt/flink/flink-web-upload/
ENTRYPOINT ["/custom-docker-entrypoint.sh"]
EXPOSE 6123 8081
CMD ["help"]

FlinkDeployment的定义使用了新的图像:

apiVersion: flink.apache.org/v1beta1
kind: FlinkDeployment
metadata:
name: flink-example
namespace: default
spec:
image: "flink-example:0.1.0"
#...

在吊舱的描述中

kubectl describe pod flink-example

我看到以下输出:

Containers:
flink-main-container:
Command:
/docker-entrypoint.sh

我还尝试在主容器的命令:中定义custom-docker-entrypoint.sh

apiVersion: flink.apache.org/v1beta1
kind: FlinkDeployment
metadata:
name: flink-example
namespace: default
spec:
flinkVersion: v1_14
image: "flink-example:0.1.0"
podTemplate:
apiVersion: v1
kind: Pod
metadata:
name: pod-template
spec:
containers:
- name: flink-main-container
#          command: [ 'sh','-c','/custom-docker-entrypoint.sh' ]
command: [ "/custom-docker-entrypoint.sh" ]

谢谢。

您可以通过:覆盖它

flinkConfiguration:
kubernetes.entry.path: "/custom-docker-entrypoint.sh"

Operator(默认情况下(使用Flink的原生Kubernetes集成。请参阅:https://nightlies.apache.org/flink/flink-docs-master/docs/deployment/config/#kubernetes-进入路径

相关内容

  • 没有找到相关文章

最新更新