Skip to content

Flink k8s operator hardcodes --host parameter to job args and CliRunner fails #250

@velo

Description

@velo

Problem

When running in Flink 2.x standalone application mode via the Flink Kubernetes Operator, the container entrypoint passes --host <IP> to the application jar's main class:

/docker-entrypoint.sh standalone-job --host 10.11.35.147 --planfile /opt/flink/usrlib/flink-files/compiled-plan.json ...

The flink-sql-runner's CliRunner doesn't recognize --host, causing startup failure:

Unknown options: '--host', '10.11.35.147'
Usage: SqlRunner [-hV] [-c=<configDir>] [-m=<mode>] [-p=<planFile>]
                 [-s=<sqlFile>] [-u=<udfPath>]

Root Cause

In Flink 2.x, the docker-entrypoint.sh script for standalone-job mode now forwards all remaining arguments (including --host) to the user's main class. This is a behavior change from Flink 1.x.

Solution

Add --host as an optional ignored parameter in CliRunner.java:

@Option(names = {"--host"}, description = "Host address (passed by Flink runtime, ignored)")
private String host;

Impact

This is blocking Flink 2.x deployments via the Kubernetes Operator with mode: standalone.

Related

  • cloud-compilation branch: bump-flink-sql-runner-version
  • Flink Operator 1.13.0 with flinkVersion: v2_1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions