Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FLINK-36332 Add option to select the Fabric8 httpclient implemention #881

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 38 additions & 10 deletions flink-kubernetes-operator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,21 @@ under the License.
<!-- required by FlinkConfigManagerTest -->
--add-opens=java.base/java.util=ALL-UNNAMED
</surefire.module.config>
<!-- valid options can be checked at https://central.sonatype.com/search?q=kubernetes-httpclient- currently: okhttp, jdk, jetty, vertx -->
<fabric8.httpclinent.impl>okhttp</fabric8.httpclinent.impl>
</properties>

<dependencies>
<dependency>
<groupId>io.javaoperatorsdk</groupId>
<artifactId>operator-framework</artifactId>
<version>${operator.sdk.version}</version>
<exclusions>
<exclusion>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-httpclient-okhttp</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand All @@ -60,25 +68,23 @@ under the License.
</dependency>

<dependency>
<!-- https://github.com/fabric8io/kubernetes-client/blob/main/doc/FAQ.md#what-artifacts-should-my-project-depend-on-->
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-httpclient-okhttp</artifactId>
<artifactId>kubernetes-httpclient-${fabric8.httpclinent.impl}</artifactId>
<version>${fabric8.version}</version>
<exclusions>
<exclusion>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>*</artifactId>
<artifactId>okhttp</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>${okhttp.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>${okhttp.version}</version>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>${jetbrains.annotations.version}</version>
<scope>provided</scope>
</dependency>

<!-- Flink -->
Expand Down Expand Up @@ -174,6 +180,12 @@ under the License.
<artifactId>kubernetes-server-mock</artifactId>
<version>${fabric8.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down Expand Up @@ -413,6 +425,22 @@ under the License.
</plugins>
</build>
</profile>
<profile>
<id>depend-on-okhttp4</id>
<activation>
<property>
<name>fabric8.httpclinent.impl</name>
<value>okhttp</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>${okhttp.version}</version>
</dependency>
Comment on lines +437 to +441
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default kubernetes-httpclient-okhttp pulls in OkHttp 3.X which is reported to have problems with Kubernetes IPV6 stacks e.g. https://issues.apache.org/jira/browse/FLINK-31928

</dependencies>
</profile>
</profiles>

</project>
4 changes: 2 additions & 2 deletions flink-kubernetes-operator/src/main/resources/META-INF/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ This project bundles the following dependencies under the Apache Software Licens
- io.fabric8:kubernetes-model-scheduling:jar:6.13.2
- io.fabric8:kubernetes-model-storageclass:jar:6.13.2
- io.fabric8:zjsonpatch:jar:0.3.0
- io.javaoperatorsdk:operator-framework-core:jar:4.8.3
- io.javaoperatorsdk:operator-framework:jar:4.8.3
- io.javaoperatorsdk:operator-framework-core:jar:4.9.4
- io.javaoperatorsdk:operator-framework:jar:4.9.4
- org.apache.commons:commons-compress:1.21
- org.apache.commons:commons-lang3:3.14.0
- org.apache.commons:commons-math3:3.6.1
Expand Down
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ under the License.
<maven-javadoc-plugin.version>3.3.2</maven-javadoc-plugin.version>
<git-commit-id-maven-plugin.version>5.0.0</git-commit-id-maven-plugin.version>

<operator.sdk.version>4.8.3</operator.sdk.version>
<operator.sdk.version>4.9.4</operator.sdk.version>
<operator.sdk.webhook-framework.version>1.1.1</operator.sdk.webhook-framework.version>

<fabric8.version>6.13.2</fabric8.version>
Expand Down Expand Up @@ -110,6 +110,7 @@ under the License.
<surefire.module.config/>

<derby.version>10.15.2.0</derby.version>
<jetbrains.annotations.version>24.1.0</jetbrains.annotations.version>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required by KubernetesAutoScalerStateStore

@NotNull
@Override
public ConfigChanges getConfigChanges(KubernetesJobAutoScalerContext jobContext) {
return configMapStore
.getSerializedState(jobContext, CONFIG_OVERRIDES_KEY)
.map(KubernetesAutoScalerStateStore::deserializeConfigOverrides)
.orElse(new ConfigChanges());
}

though looking again that looks like a bug and it should use @nonnull instead.

</properties>

<dependencyManagement>
Expand Down