Hello! I’m using the Flink Kubernetes Operator to ...
# troubleshooting
b
Hello! I’m using the Flink Kubernetes Operator to define a session cluster and a FlinkSessionJob. I am able to use s3 URIs for high availability and checkpoints/savepoints but not for the
job.jarURI
part of a session job, where I get the error:
Could not find a file system implementation for scheme 's3'
. What am I missing? Here are my Kubernetes resources for context (shortened versions):
Copy code
apiVersion: flink.apache.org/v1beta1
kind: FlinkDeployment
metadata:
  name: session-cluster
  namespace: flink-jobs
spec:
  image: flink:1.17
  flinkVersion: v1_17
  jobManager:
    [...]
    podTemplate:
      spec:
        containers:
          - name: flink-main-container
            env:
              - name: ENABLE_BUILT_IN_PLUGINS
                value: flink-s3-fs-presto-1.17.1.jar;flink-s3-fs-hadoop-1.17.1.jar
  taskManager:
    [...]
    podTemplate:
      spec:
        containers:
          - name: flink-main-container
            env:
              - name: ENABLE_BUILT_IN_PLUGINS
                value: flink-s3-fs-presto-1.17.1.jar;flink-s3-fs-hadoop-1.17.1.jar
  serviceAccount: flink
---
apiVersion: flink.apache.org/v1beta1
kind: FlinkSessionJob
metadata:
  name: session-cluster-job
  namespace: flink-jobs
spec:
  deploymentName: session-cluster
  job:
    jarURI: s3://flink-test-bucket/TopSpeedWindowing.jar
    parallelism: 4
    upgradeMode: stateless
z
I think you need to install the additional s3 plugin. I have the below in my dockerfile.
Copy code
RUN mkdir -p /opt/flink/plugins/s3-fs-hadoop
RUN \
  wget -O /opt/flink/plugins/s3-fs-hadoop/flink-s3-fs-hadoop-$FLINK_VERSION.jar \
  https://repo1.maven.org/maven2/org/apache/flink/flink-s3-fs-hadoop/$FLINK_VERSION/flink-s3-fs-hadoop-$FLINK_VERSION.jar
b
Is your docker file on top of the base flink image? And you use the custom image for your session cluster’s FlinkDeployment?
Or is this a custom image for the operator? I’m not sure what is actually pulling from the jarURI for `FlinkSessionJob`s
z
I run
application mode
for my jobs, and the
jar
files are placed during the image build process.
Copy code
FROM eclipse-temurin:11-jre-jammy AS build

# Disable Prompt During Packages Installation
ARG DEBIAN_FRONTEND=noninteractive

# Update Ubuntu Software repository
RUN apt update

RUN mkdir /flink-jobs
WORKDIR /flink-jobs

# Install Scala
RUN curl -fL https://github.com/coursier/coursier/releases/latest/download/cs-x86_64-pc-linux.gz | \
    gzip -d > cs && chmod +x cs && ./cs setup --yes
RUN ./cs install scala:2.12.17 && ./cs install scalac:2.12.17

# Install sbt
ARG SBT_VERSION=1.8.2
RUN \
  mkdir /working/ && \
  cd /working/ && \
  curl -L -o sbt-$SBT_VERSION.deb https://repo.scala-sbt.org/scalasbt/debian/sbt-$SBT_VERSION.deb && \
  dpkg -i sbt-$SBT_VERSION.deb && \
  rm sbt-$SBT_VERSION.deb && \
  apt-get update && \
  apt-get install sbt && \
  cd && \
  rm -r /working/ && \
  sbt sbtVersion

# Clean up cache to reduce image size
RUN rm -rf /var/lib/apt/lists/*
RUN apt clean
b
Yeah then in your jarURI you just reference your files with local://
z
I built the jar files using the base image and placed the uber jar files to the
local
directory in
flink image
b
Which is fine in application mode, I’ve done the same for that, but for a session cluster it’s a different use case
I’m basically trying to get the FlinkSessionJob to download the JARs from s3 rather than https:// or file://, that’s where my issue is. It’s specific to the FlinkSessionJob
Copy code
To support jar from different filesystems, you should extend the base docker image as below, and put the related filesystem jar to the plugin dir and deploy the operator.
So I need a custom flink-kubernetes-operator Docker image with the s3 plugin.