Skip to content
This repository was archived by the owner on Apr 10, 2024. It is now read-only.

Commit 526dffc

Browse files
committed
Use HTTP/1.1 to perform readiness check
This change re-enables the readiness check, using HTTP/1.1 instead of HTTP/2 to invoke it. The readiness checks are unauthenticated and are throttled when the feature gate UnauthenticatedHTTP2DOSMitigation is set to true, which is the default starting in Kubernetes 1.29 (see https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates). This was the cause of the "GOAWAY received" errors that have been observed on Kubernetes 1.29. This change also decouples starting of the servers from waiting until they become ready, so that if the readiness check fails due to some error that propagates out of the polling loop (e.g. IOException), the caller is free to catch it and continue waiting.
1 parent 9518531 commit 526dffc

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

core/src/main/java/io/javaoperatorsdk/jenvtest/KubeAPIServer.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ public KubeAPIServer(KubeAPIServerConfig config) {
3737
}
3838

3939
public void start() {
40+
startAsync();
41+
waitUntilReady();
42+
}
43+
44+
public void startAsync() {
4045
log.debug("Stating API Server. Using jenvtest dir: {}", config.getJenvtestDir());
4146
binaryManager.initAndDownloadIfRequired();
4247
certManager.createCertificatesIfNeeded();
@@ -45,6 +50,9 @@ public void start() {
4550
if (config.isUpdateKubeConfig()) {
4651
kubeConfig.updateKubeConfig(apiServerPort);
4752
}
53+
}
54+
55+
public void waitUntilReady() {
4856
kubeApiServerProcess.waitUntilReady();
4957
log.debug("API Server ready to use");
5058
}

core/src/main/java/io/javaoperatorsdk/jenvtest/process/KubeAPIServerProcess.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,7 @@ public void waitUntilReady() {
8989
var readinessChecker = new ProcessReadinessChecker();
9090
var timeout = config.getStartupTimeout();
9191
var startTime = System.currentTimeMillis();
92-
// the 1.29.0 binary has issue with this. Will temporarily comment out and further investigate.
93-
// But with this now all the executions are failing
94-
// readinessChecker.waitUntilReady(apiServerPort, "readyz", KUBE_API_SERVER, true, timeout);
92+
readinessChecker.waitUntilReady(apiServerPort, "readyz", KUBE_API_SERVER, true, timeout);
9593
int newTimout = (int) (timeout - (System.currentTimeMillis() - startTime));
9694
readinessChecker.waitUntilDefaultNamespaceAvailable(apiServerPort, binaryManager, certManager,
9795
config, newTimout);

core/src/main/java/io/javaoperatorsdk/jenvtest/process/ProcessReadinessChecker.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ public void checkServerTrusted(
179179
null);
180180
return HttpClient.newBuilder()
181181
.sslContext(sslContext)
182+
.version(HttpClient.Version.HTTP_1_1)
182183
.build();
183184
} catch (NoSuchAlgorithmException | KeyManagementException e) {
184185
throw new JenvtestException(e);

0 commit comments

Comments
 (0)