Hello Everyone , i have deployed flink K8 operator...
# troubleshooting
a
Hello Everyone , i have deployed flink K8 operator but its not supporting joburi from s3. I have read teh documentation and get that we need to install s3 plugin while installing operator. i am using helm build to deploy operator.
Copy code
if you use helm to install flink-kubernetes-operator, it allows you to specify a postStart hook to download the required plugins.
i need help how we use this posStart hook, is there any example ?
l
Hello, You can use an InitContainer, with awscli image, pull de jar from s3 and mount a volume. Then, use jarURI: local:// https://github.com/apache/flink-kubernetes-operator/blob/main/examples/pod-template.yaml
a
i want to use session cluster and deploy as session job. 1. i have downloaded plugins jars as init-container in both operator and job manager/task manager. still i am getting same error when deploying session job. i have verified by login to pods plugin dir and jar exist there.
Copy code
# optional init containers for operator pod
  initContainers:
    - name: download-s3-plugins
      image: busybox:1.35.0
      command:
        - /bin/sh
        - -c
        - |
          set -e
          echo "🔧 Downloading S3 plugins for Flink Operator (2.1.1)..."
          mkdir -p /opt/flink/plugins/s3-fs-hadoop
          mkdir -p /opt/flink/plugins/s3-fs-presto
          
          echo "📥 Downloading flink-s3-fs-hadoop-2.1.1.jar..."
          wget -O /opt/flink/plugins/s3-fs-hadoop/flink-s3-fs-hadoop-2.1.1.jar \
            <https://repo1.maven.org/maven2/org/apache/flink/flink-s3-fs-hadoop/2.1.1/flink-s3-fs-hadoop-2.1.1.jar>
          
          echo "📥 Downloading flink-s3-fs-presto-2.1.1.jar..."
          wget -O /opt/flink/plugins/s3-fs-presto/flink-s3-fs-presto-2.1.1.jar \
            <https://repo1.maven.org/maven2/org/apache/flink/flink-s3-fs-presto/2.1.1/flink-s3-fs-presto-2.1.1.jar>
          
          echo "✅ S3 plugins downloaded successfully!"
          echo "📂 Plugin files:"
          ls -lh /opt/flink/plugins/s3-fs-hadoop/
          ls -lh /opt/flink/plugins/s3-fs-presto/
      volumeMounts:
        - name: flink-plugins
          mountPath: /opt/flink/plugins
approach you suggested by downloading and deploy as application mode is working but i want to deploy as session job. @Luís Costa
is this a fundamental issue with flink deployment , Is there any solution exist for this ?
l
Yes you need also the s3-fs-presto jars. I've only deployed flink using the CR FlinkDeployment.
a
presto jar i already downloading i have done both hadoop and presto.
> I've only deployed flink using the CR FlinkDeployment. in case of flinkdeployment for every job u have new job manager than how you track your job using ui if you have multiple jobs. for every new job i need to create ingress for job manager ui.
l
Each job has its own jobmanager. For one job you will have 1 jobmanager and multiple taskmanagers. Yes, 1 ingress is created for each job.
I was deploying 1 job = 1 namespace. That way the resources are isolated.
a
is there any solution for session job deployment with s3 plugins. i tried postStart hook , init container all methods to load plugins but still same error.
l
I will try to find some time during next week to test the session job CR deployment
a
I was deploying 1 job = 1 namespace. That way the resources are isolated.
so every job u create u deploy ingressroute and than create a route53 end point to access ui.
l
Yes
a
How do u maintain for this job this is the url need to track for ui
l
The ingress section is defined in FlinkDeployment CR. And I had a naming convention for the hostname, like job_name.aws_region.environment.my_route53_domain
✅ 1
Basicallly, helm chart: • Flink docker image with s3-fs-* jars • FlinkDeployment CR, template • ServiceAccount + Role + Rolebinding - https://nightlies.apache.org/flink/flink-kubernetes-operator-docs-main/docs/operations/rbac/ • values.yaml with defaults
a
got it, but i want shared cluster for some jobs . let me know if you find any solution for flinksessionjob deployment with s3 plugins.
👍 1
I am able to fix it . Now it's working fine but still it's not working with flink version 2.x . Need to debug that what is different in new version
Fyi @Luís Costa
Another problem i found it 1. it not work with iam role (service account) . it require aws_access key and secret key to access s3. I am not sure why it not work with iam role.
l
Strange, FlinkDeployment works fine with IRSA. It works also with flink 2.0. serviceAccount section is needed in the CR. And create the serviceAccount. https://apache-flink.slack.com/archives/C03G7LJTS2G/p1764097738392889?thread_ts=1764071472.222499&cid=C03G7LJTS2G
a
service account is created but when i deploying session job it failing to access bucket but with accesskey and secret key its working. I tried to login in pod and access the bucket it is working with iam role but with flinkessionjob its not working.
l
Is the SA defined in the CR? And iam role arn annotation present in the SA? Please post here the CR and the SA templates.